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

48 lines
1.7 KiB
C#
Raw 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_Add : 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, "");
}
}
protected void btnSure_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(dp_dev.SelectedValue))
{
RadAjaxManager1.Alert("设备名称不能为空!");
return;
}
string list_id = Request.Params["list_id"];
DataService.Model.zhc_fault_dev model = new DataService.Model.zhc_fault_dev();
model.dev_id = bll.GetNewId();
model.list_id = list_id;
model.eqName = dp_dev.SelectedValue;
model.eqState = int.Parse(dp_state.SelectedValue);
model.r1 = r1.Text.Trim();
if (bll.Add(model))
{
log.write_log("添加故障设备成功。" + "名称:" + dp_dev.SelectedValue + "ID" + model.dev_id + "故障列表ID" + model.list_id);
RadAjaxManager1.ResponseScripts.Add("alert('添加成功!');CloseAndRebind();");
}
else
{
RadAjaxManager1.Alert("添加失败!");
}
}
}
}