89 lines
2.8 KiB
C#
89 lines
2.8 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
|
||
namespace VRS.Management.Exam
|
||
{
|
||
public partial class ResultMatchPicture : BasePage
|
||
{
|
||
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
|
||
DataService.BLL.zhc_task_material bll = new DataService.BLL.zhc_task_material();
|
||
DataService.BLL.exam_result_match bll_match = new DataService.BLL.exam_result_match();
|
||
protected override void Page_Load(object sender, EventArgs e)
|
||
{
|
||
if (!IsPostBack)
|
||
{
|
||
DataLoad();
|
||
}
|
||
}
|
||
protected void DataLoad()
|
||
{
|
||
string Id = Request.Params["Id"];
|
||
if (!string.IsNullOrWhiteSpace(Id))
|
||
{
|
||
var model = bll_match.GetModel(Id);
|
||
//name.Text = model.subject;
|
||
lbsubject.Text = model.subject;
|
||
if (model.subject == "炭黑生产制造")
|
||
{
|
||
pic_score.Enabled = false;
|
||
btnSure.Visible = false;
|
||
}
|
||
else
|
||
{
|
||
pic_score.Enabled = true;
|
||
btnSure.Visible = true;
|
||
}
|
||
|
||
if (!string.IsNullOrEmpty(model.pic_url))
|
||
{
|
||
imgTopic.ImageUrl = model.pic_url;
|
||
}
|
||
|
||
pic_score.Text = model.pic_score.HasValue ? model.pic_score.Value.ToString() : "";
|
||
/*
|
||
if (model.subject == "炭黑生产制造")
|
||
{
|
||
pic_score.Text = model.score.ToString();
|
||
}
|
||
else
|
||
{
|
||
pic_score.Text = model.pic_score.HasValue ? model.pic_score.Value.ToString() : "";
|
||
}
|
||
*/
|
||
}
|
||
else
|
||
{
|
||
OnError(null);
|
||
}
|
||
}
|
||
|
||
protected void btnSure_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
decimal value = 0;
|
||
if (!decimal.TryParse(pic_score.Text, out value))
|
||
{
|
||
RadAjaxManager1.Alert("分值数值不合法!");
|
||
return;
|
||
}
|
||
DataService.Model.exam_result_match model = bll_match.GetModel(Request.Params["Id"]);
|
||
model.pic_score = value;
|
||
model.sum_score = model.score + model.pic_score;
|
||
if (bll_match.Update(model))
|
||
{
|
||
//log.write_log("修改素材成功。" + "素材名称:" + name.Text.Trim() + ",ID:" + model.material_id);
|
||
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
|
||
}
|
||
else
|
||
RadAjaxManager1.Alert("修改失败!");
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |