using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace VRS.Management.VSAT { public partial class Subject_Proc_Edit : BasePage { DataService.BLL.pro_subject_proc bll = new DataService.BLL.pro_subject_proc(); DataService.BLL.admin_log log = new DataService.BLL.admin_log(); 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.GetModel(Id); //name.Text = model.name; tip.Text = model.tip; step.Text = model.step.ToString(); dsc.Text = model.dsc; score.Text = model.score.ToString(); ddl_op.SelectedValue = model.is_op.ToString(); textSeconds.Text = model.seconds.ToString(); //span_step.InnerHtml = model.step.ToString(); } else { OnError(null); } } protected void btnSure_Click(object sender, EventArgs e) { /* if (string.IsNullOrEmpty(name.Text)) { RadAjaxManager1.Alert("设备名称不能为空!"); return; } if (string.IsNullOrEmpty(step.Text)) { RadAjaxManager1.Alert("步调不能为空!"); return; } if (string.IsNullOrEmpty(score.Text)) { RadAjaxManager1.Alert("分值不能为空!"); return; } */ if (string.IsNullOrEmpty(textSeconds.Text)) { RadAjaxManager1.Alert("时间不能为空!"); return; } DataService.Model.pro_subject_proc model = bll.GetModel(Request.Params["Id"]); //设备名称 //model.name = name.Text.Trim(); model.tip = tip.Text.Trim(); model.step = int.Parse(step.Text); //model.score = decimal.Parse(score.Text); model.dsc = dsc.Text.Trim(); model.is_op = int.Parse(ddl_op.SelectedValue); model.seconds = int.Parse(textSeconds.Text); if (bll.Update(model)) { log.write_log("修改步骤成功。" + "步骤名称:" + tip.Text.Trim() + ",步骤ID:" + model.proc_id); if (string.IsNullOrEmpty(model.fault_code)) { RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();"); } else { RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebindMain();"); } } else RadAjaxManager1.Alert("修改失败!"); } } }