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

80 lines
2.6 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 Task_Proc_Edit : BasePage
{
DataService.BLL.zhc_task_proc bll = new DataService.BLL.zhc_task_proc();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDeviceType("8", dp_className, "");
BindTaskList(dp_task, "");
DataLoad();
}
}
protected void DataLoad()
{
string Id = Request.Params["Id"];
if (!string.IsNullOrWhiteSpace(Id))
{
var model = bll.GetModel(Id);
dp_task.SelectedValue = model.taskId;
name.Text = model.name;
tip.Text = model.tip;
step.Text = model.step;
dp_className.SelectedValue = model.className;
methodName.Text = model.methodName;
dsc.Text = model.dsc;
}
else
{
OnError(null);
}
}
protected void btnSure_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(dp_task.SelectedValue))
{
RadAjaxManager1.Alert("步骤不能为空!");
return;
}
if (string.IsNullOrEmpty(dp_className.SelectedValue))
{
RadAjaxManager1.Alert("类名不能为空!");
return;
}
if (string.IsNullOrEmpty(name.Text))
{
RadAjaxManager1.Alert("步骤名称不能为空!");
return;
}
DataService.Model.zhc_task_proc model = bll.GetModel(Request.Params["Id"]);
model.taskId = dp_task.SelectedValue;
model.name = name.Text.Trim();
model.tip = tip.Text.Trim();
model.step = step.Text.Trim();
model.className = dp_className.SelectedValue;
model.methodName = methodName.Text.Trim();
model.dsc = dsc.Text.Trim();
if (bll.Update(model))
{
log.write_log("修改步骤成功。" + "步骤名称:" + name.Text.Trim() + "步骤ID" + model.proc_id);
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
}
else
RadAjaxManager1.Alert("修改失败!");
}
}
}