gyhlw_dotnet/网站项目/VRS/Management/ZHC/Fault_Dev_Edit.aspx.cs

60 lines
2.0 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace VRS.Management.ZHC
{
public partial class Fault_Dev_Edit : BasePage
{
DataService.BLL.zhc_fault_dev bll = new DataService.BLL.zhc_fault_dev();
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)
{
BindZHCDevice(dp_dev, "");
DataLoad();
}
}
protected void DataLoad()
{
string Id = Request.Params["Id"];
if (!string.IsNullOrWhiteSpace(Id))
{
var model = bll.GetModel(Id);
dp_dev.SelectedValue = model.eqName;
dp_state.SelectedValue = model.eqState.Value.ToString();
r1.Text = model.r1;
}
else
{
OnError(null);
}
}
protected void btnSure_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(dp_dev.SelectedValue))
{
RadAjaxManager1.Alert("故障设备名称不能为空!");
return;
}
DataService.Model.zhc_fault_dev model = bll.GetModel(Request.Params["Id"]);
model.eqName = dp_dev.SelectedValue;
model.eqState = int.Parse(dp_state.SelectedValue);
model.r1 = r1.Text.Trim();
if (bll.Update(model))
{
log.write_log("修改设备名称成功。" + "名称:" + dp_dev.SelectedValue + "ID" + model.dev_id + "故障列表ID" + model.list_id);
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
}
else
RadAjaxManager1.Alert("修改失败!");
}
}
}