using System; using System.Collections.Generic; 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.VSAT { public partial class Examination_Edit : BasePage { DataService.BLL.pro_exam_batch bll = new DataService.BLL.pro_exam_batch(); DataService.BLL.admin_log log = new DataService.BLL.admin_log(); DataService.BLL.admin_user bll_user = new DataService.BLL.admin_user(); DataService.BLL.pro_theory_base bll_theory_base = new DataService.BLL.pro_theory_base(); DataService.BLL.pro_examination bll_examination = new DataService.BLL.pro_examination(); DataService.BLL.pro_exam_theory bll_exam_theory = new DataService.BLL.pro_exam_theory(); protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!IsPostBack) { DataLoad(); } } protected void DataLoad() { string Id = Request.Params["Id"]; if (!string.IsNullOrWhiteSpace(Id)) { var model = bll_examination.GetModel(Id); if (null != model) { exam_name.Text = model.exam_name; exam_code.Text = model.exam_code; span_exam_code.InnerHtml = model.exam_code; //dp_exam_status.SelectedValue = model.exam_status.Value.ToString(); dp_exam_type.SelectedValue = model.exam_type; total_score.Value = double.Parse(model.total_score); pass_score.Value = double.Parse(model.pass_score.Value.ToString()); } } else { OnError(null); } } protected void btnSure_Click(object sender, EventArgs e) { /* if (string.IsNullOrEmpty(name.Text.Trim())) { RadAjaxManager1.Alert("学校名称不能为空!"); return; } if (bll.GetRecordCount(string.Format(" school = '{0}' and id != {1}", name.Text.Trim(), id)) > 0) { RadAjaxManager1.Alert("学生名称禁止重复!"); return; } */ if (string.IsNullOrEmpty(dp_exam_type.SelectedValue)) { RadAjaxManager1.Alert("试卷类型不能为空!"); return; } var id = Request.Params["Id"]; var model = bll_examination.GetModel(id); var user = DataService.BLL.admin_user.load_login(); /* if (string.IsNullOrEmpty(dp_exam_status.SelectedValue)) { RadAjaxManager1.Alert("状态不能为空!"); return; } */ model.exam_name = exam_name.Text; model.exam_code = exam_code.Text; model.exam_type = dp_exam_type.SelectedValue; //限时 //model.limit_time = limit_time.Value.HasValue ? (int)limit_time.Value.Value : 60; //model.exam_status = int.Parse(dp_exam_status.SelectedValue); model.total_score = total_score.Value.HasValue ? total_score.Value.ToString() : "100"; model.pass_score = (decimal?)pass_score.Value; model.r1 = r1.Text.Trim(); model.update_time = DateTime.Now; model.update_by = user.user_id; if (bll_examination.Update(model)) { log.write_log("修改考试成功。" + "名称:" + model.exam_name + ",id:" + model.id); RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();"); } else { RadAjaxManager1.Alert("修改失败!"); } } } }