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_Add : 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) { base.Page_Load(sender, e); if (!IsPostBack) { } } 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; } string subject_id = Request.Params["subject_id"]; DataService.Model.pro_subject_proc model = new DataService.Model.pro_subject_proc(); model.proc_id = bll.GetNewId(); model.subject_id = subject_id; model.fault_code = Request.Params["fault_code"]; 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(); if (bll.Add(model)) { log.write_log("添加步骤成功。" + "步骤名称:" + name.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("添加失败!"); } } } }