WorkFlowStepEdit.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:5k
- 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_WorkFlowStepEdit : System.Web.UI.Page
- {
- /// <summary>
- /// 模型
- /// </summary>
- Model.FlowBaseStep MR = new Model.FlowBaseStep();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.FlowBaseStep BR = new BLL.FlowBaseStep();
- /// <summary>
- /// 模板
- /// </summary>
- Model.FlowBaseFormContent MFBFC = new Model.FlowBaseFormContent();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.FlowBaseFormContent BFBFC = new BLL.FlowBaseFormContent();
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "WorkFlow_WorkFlowStepEdit");
- if (!IsPostBack)
- {
- DropLoadSet();
- if(Request.QueryString["id"]!=null)
- {
- MR = BR.GetModel(int.Parse(Request.QueryString["id"].ToString()));
- KeyValue_LCID.Text=MR.LCID.ToString() ;
- string KYZDStr = MR.KYZD;
- string[] LIS = KYZDStr.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string LI in LIS)
- {
- KeyValue_KYZD.Items.Add(LI);
- }
- KeyValue_BDID.SelectedValue = MR.BDID.ToString();
- KeyValue_YQLSCCBZRY.Text = MR.YQLSCCBZRY;
- KeyValue_BZSXH.Text = MR.BZSXH.ToString();
- KeyValue_XYBID.Text = MR.XYBXH;
- KeyValue_BZMC.Text = MR.BZMC;
- FormCodeList(MR.BDID);
- }
-
- }
- }
- public void FormCodeList(int BDID)
- {
- MFBFC = BFBFC.GetModel(BDID);
- string strFormModel = MFBFC.BDNR;
- string IndexStr = "title=";
- int IdexStart = 0;
- do
- {
- IdexStart = strFormModel.IndexOf(IndexStr, IdexStart);
- if (IdexStart != -1)
- {
- string ItemStr = RtContrlStr(IdexStart, strFormModel);
- IdexStart = IdexStart + 1;
- KeyValue_BXZD.Items.Add(ItemStr);
- }
- }
- while(IdexStart!= -1);
-
- }
- public string RtContrlStr(int IdexStart,string Content)
- {
-
- string IndexStrEnd = " ";
- int StartP = Content.IndexOf(IndexStrEnd, IdexStart);
- int LengthStr = StartP - IdexStart;
- string RtStr = Content.Substring(IdexStart, LengthStr).Replace("title=","");
- return RtStr;
- }
- 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_BZMC.Text == "")
- {
- throw new Exception("步骤名称不能为空!");
- }
- if (KeyValue_YQLSCCBZRY.Text == "")
- {
- throw new Exception("审核人不能为空!");
- }
- int IBZSXH = 0;
- if (!int.TryParse(KeyValue_BZSXH.Text, out IBZSXH))
- {
- throw new Exception("步骤顺序号必须为数字!");
- }
- MR.ID=int.Parse(Request.QueryString["id"].ToString());
- MR.LCID =int.Parse( KeyValue_LCID.Text);
- string KYZDStr = "";
- foreach (ListItem LI in KeyValue_KYZD.Items)
- {
- KYZDStr += LI.Text + ",";
- }
- MR.KYZD = KYZDStr;
- MR.BDID =int.Parse(KeyValue_BDID.SelectedValue);
- MR.YQLSCCBZRY = KeyValue_YQLSCCBZRY.Text;
- MR.BZSXH = IBZSXH;
- MR.XYBXH = KeyValue_XYBID.Text;
- MR.BZMC = KeyValue_BZMC.Text;
- BR.Update(MR);
- MessageBox.Show("更新成功!", "WorkFlowStepSetting.aspx?lcid=" + KeyValue_LCID.Text + "&bdid=" + KeyValue_BDID.SelectedValue);
- }
- catch(Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- protected void ButtonAddAll_Click(object sender, EventArgs e)
- {
- KeyValue_KYZD.Items.Clear();
- foreach (ListItem LI in KeyValue_BXZD.Items)
- {
- KeyValue_KYZD.Items.Add(LI);
- }
- }
- protected void ButtonAdd_Click(object sender, EventArgs e)
- {
- KeyValue_KYZD.Items.Add(KeyValue_BXZD.SelectedItem);
- }
- protected void ButtonDel_Click(object sender, EventArgs e)
- {
-
- KeyValue_KYZD.Items.Remove(KeyValue_KYZD.SelectedItem);
- }
- protected void ButtonDelAll_Click(object sender, EventArgs e)
- {
- KeyValue_KYZD.Items.Clear();
- }
- protected void Button2_Click(object sender, EventArgs e)
- {
- Response.Redirect("WorkFlowStepSetting.aspx?lcid=" + KeyValue_LCID.Text + "&bdid=" + KeyValue_BDID.SelectedValue);
- }
- }