using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace VRS.Management { public partial class Soft_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.admin_school bll_school = new DataService.BLL.admin_school(); DataService.BLL.admin_soft bll = new DataService.BLL.admin_soft(); 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.GetModel(Id); name.Text = model.soft_name; r1.Text = model.r1; } else { OnError(null); } } protected void btnSure_Click(object sender, EventArgs e) { var model = bll.GetModel(Request.Params["Id"]); if (string.IsNullOrEmpty(name.Text.Trim())) { RadAjaxManager1.Alert("类型名称不能为空!"); return; } var id = Request.Params["Id"]; if (bll.GetRecordCount(string.Format(" soft_name = '{0}' and soft_id!='{1}' ", name.Text.Trim(), model.soft_id)) > 0) { RadAjaxManager1.Alert("类型名称称禁止重复!"); return; } model.r1 = r1.Text.Trim(); model.soft_name = name.Text.Trim(); if (bll.Update(model)) { log.write_log("修改终端类型成功。" + "类型名称:" + name.Text.Trim() + ",类型id:" + model.soft_id); RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();"); } else RadAjaxManager1.Alert("修改失败!"); } } }