WorkFlowAdd.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class WorkFlow_WorkFlowAdd : System.Web.UI.Page
- {
- /// <summary>
- /// 模型
- /// </summary>
- Model.FlowBase MR = new Model.FlowBase();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.FlowBase BR = new BLL.FlowBase();
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "WorkFlow_WorkFlowAdd");
- if (!IsPostBack)
- {
- DropLoadSet();
- }
- }
- public void DropLoadSet()
- {
- //流程分类
- KeyValue_LCFL.DataTextField = "FLMC";
- KeyValue_LCFL.DataValueField = "ID";
- KeyValue_LCFL.DataSource = EnumGet.FlowBaseTypeGetEnum();
- KeyValue_LCFL.DataBind();
- KeyValue_LCFL.SelectedIndex = KeyValue_LCFL.Items.Count - 1;
- //表单分类
- KeyValue_BDID.DataTextField = "BDMC";
- KeyValue_BDID.DataValueField = "ID";
- KeyValue_BDID.DataSource = EnumGet.FlowBaseFormGetEnum();
- KeyValue_BDID.DataBind();
- KeyValue_BDID.SelectedIndex = KeyValue_BDID.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- if (KeyValue_LCMC.Text == "")
- {
- throw new Exception("流程名称不能为空!");
- }
- int ILCPXH = 0;
- if (!int.TryParse(KeyValue_LCPXH.Text, out ILCPXH))
- {
- throw new Exception("流程排序号必须为数字!");
- }
- MR.BDID = int.Parse(KeyValue_BDID.SelectedValue);
- MR.LCFL = int.Parse(KeyValue_LCFL.SelectedValue);
- MR.LCMC = KeyValue_LCMC.Text;
- MR.LCJS = KeyValue_LCJS.Text;
- MR.YXFJ = int.Parse(KeyValue_YXFJ.SelectedValue);
- MR.LCPXH = ILCPXH;
- BR.Add(MR);
- MessageBox.Show("添加成功!");
- }
- catch(Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
-
- }