159 lines
5.3 KiB
C#
159 lines
5.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using Telerik.Web.UI;
|
|
|
|
|
|
namespace VRS.Management.Exam
|
|
{
|
|
public partial class ResultDetail : BaseListPage
|
|
{
|
|
DataService.BLL.pro_result_detail bll = new DataService.BLL.pro_result_detail();
|
|
DataService.BLL.pro_result bll_result = new DataService.BLL.pro_result();
|
|
|
|
DataService.BLL.exam_result bll_exam_result = new DataService.BLL.exam_result();
|
|
DataService.BLL.exam_result_detail bll_exam_result_detail = new DataService.BLL.exam_result_detail();
|
|
|
|
DataService.BLL.admin_user bll_admin_User = new DataService.BLL.admin_user();
|
|
protected override void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
DataLoad();
|
|
}
|
|
}
|
|
|
|
protected override void DataLoad()
|
|
{
|
|
string Id = Request.Params["Id"];
|
|
var data = bll_exam_result_detail.GetModelList(" result_id='" + Id + "' ").OrderBy(s => s.no).ToList();
|
|
foreach(var item in data)
|
|
{
|
|
if (item.questionType=="选择题")
|
|
{
|
|
if (item.result==1)
|
|
{
|
|
item.result_desc = "正确";
|
|
}
|
|
else if (item.result == 0)
|
|
{
|
|
item.result_desc = "错误";
|
|
}
|
|
}
|
|
}
|
|
hidden_result_id.Value = Id;
|
|
var result = bll_exam_result.GetModel(Id);
|
|
var user = bll_admin_User.GetModel(result.user_id);
|
|
span_name.InnerHtml = user.real_name+ "-" + result.subject + "-" + result.score + "分";
|
|
|
|
var data_select = data.Where(s => s.questionType == "选择题").OrderBy(s => s.no).ToList();
|
|
dataList.DataSource = data_select;
|
|
dataList.Rebind();
|
|
|
|
var data_TianKong = data.Where(s => s.questionType == "填空题").OrderBy(s => s.no).ToList();
|
|
dataList_TianKong.DataSource = data_TianKong;
|
|
dataList_TianKong.Rebind();
|
|
|
|
var data_Jianda = data.Where(s => s.questionType == "简答题").OrderBy(s => s.no).ToList();
|
|
dataList_Jianda.DataSource = data_Jianda;
|
|
dataList_Jianda.Rebind();
|
|
}
|
|
|
|
protected override void GridList_PageIndexChanged(object sender, GridPageChangedEventArgs e)
|
|
{
|
|
DataLoad();
|
|
}
|
|
|
|
protected override void GridList_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
|
|
{
|
|
DataLoad();
|
|
}
|
|
|
|
protected override void GridList_SortCommand(object sender, GridSortCommandEventArgs e)
|
|
{
|
|
DataLoad();
|
|
}
|
|
|
|
protected override void GrdList_DeleteCommand(object sender, GridCommandEventArgs e)
|
|
{
|
|
string Id = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"].ToString();
|
|
bll.Delete(Id);
|
|
DataLoad();
|
|
}
|
|
|
|
protected override void AjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected void btnSelect_Click(object sender, EventArgs e)
|
|
{
|
|
DataLoad();
|
|
}
|
|
|
|
protected void btnDelete_Click(object sender, EventArgs e)
|
|
{
|
|
bll.Delete(IdInput.Value);
|
|
|
|
DataLoad();
|
|
}
|
|
|
|
|
|
protected void dataList_ItemDataBound(object sender, GridItemEventArgs e)
|
|
{
|
|
if (e.Item is GridDataItem)
|
|
{
|
|
GridDataItem item = e.Item as GridDataItem;
|
|
var model = item.DataItem as DataService.Model.pro_result_detail;
|
|
if (null != model)
|
|
{
|
|
if (model.score == 0)
|
|
{
|
|
e.Item.CssClass = "row_highlight";
|
|
}
|
|
}
|
|
|
|
/*
|
|
double score = double.Parse(item.GetDataKeyValue("score").ToString());
|
|
if (score == 0)
|
|
{
|
|
e.Item.CssClass = "row_highlight";
|
|
}
|
|
*/
|
|
}
|
|
}
|
|
|
|
protected void dataList_Jianda_ItemDataBound(object sender, GridItemEventArgs e)
|
|
{
|
|
if (e.Item is GridDataItem)
|
|
{
|
|
GridDataItem item = e.Item as GridDataItem;
|
|
var r1 = item.GetDataKeyValue("r1").ToString();
|
|
var r2 = item.GetDataKeyValue("r2").ToString();
|
|
var r3 = item.GetDataKeyValue("r3").ToString();
|
|
|
|
var image1 = e.Item.FindControl("imgTopic1") as Image;//考生答案
|
|
var image2 = e.Item.FindControl("imgTopic2") as Image;//正确答案
|
|
if (null != image1 && null != image2)
|
|
{
|
|
if (r3 == "1")
|
|
{
|
|
image1.ImageUrl = r1;
|
|
image2.ImageUrl = r2;
|
|
}
|
|
else
|
|
{
|
|
image1.Visible = false;
|
|
image2.Visible = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |