72 lines
2.4 KiB
C#
72 lines
2.4 KiB
C#
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_Add : 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)
|
||
{
|
||
base.Page_Load(sender, e);
|
||
if (!IsPostBack)
|
||
{
|
||
BindDeviceType("8", dp_className, "");
|
||
BindTaskList(dp_task, "");
|
||
}
|
||
}
|
||
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;
|
||
}
|
||
|
||
/*
|
||
if (bll.GetRecordCount(string.Format(" name = '{0}' ", name.Text.Trim())) > 0)
|
||
{
|
||
RadAjaxManager1.Alert("步骤名称禁止重复!");
|
||
return;
|
||
}
|
||
*/
|
||
|
||
DataService.Model.zhc_task_proc model = new DataService.Model.zhc_task_proc();
|
||
model.proc_id = bll.GetNewId();
|
||
model.taskId = dp_task.SelectedValue;
|
||
model.name = name.Text.Trim();
|
||
model.tip = tip.Text.Trim();
|
||
model.step = step.Text.Trim();
|
||
model.position = bll.GetPosition(dp_task.SelectedValue);
|
||
model.className = dp_className.SelectedValue;
|
||
model.methodName = methodName.Text.Trim();
|
||
model.dsc = dsc.Text.Trim();
|
||
if (bll.Add(model))
|
||
{
|
||
log.write_log("添加步骤成功。" + "步骤名称:" + name.Text.Trim() + ",步骤ID:" + model.proc_id);
|
||
RadAjaxManager1.ResponseScripts.Add("alert('添加成功!');CloseAndRebind();");
|
||
}
|
||
else
|
||
{
|
||
RadAjaxManager1.Alert("添加失败!");
|
||
}
|
||
}
|
||
}
|
||
} |