FormDesignEdit.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class WorkFlow_FormDesignEdit : System.Web.UI.Page
  12. {
  13.     //模板
  14.     Model.FlowBaseFormContent MR = new Model.FlowBaseFormContent();
  15.     //业务
  16.     BLL.FlowBaseFormContent BR = new BLL.FlowBaseFormContent();
  17.     public string intFormId = "1";
  18.     public string strFormModel
  19.     {
  20.         set {
  21.             ViewState["strFormModelVaie"] = value;
  22.         }
  23.         get {
  24.             if (ViewState["strFormModelVaie"] != null)
  25.             {
  26.                 return ViewState["strFormModelVaie"].ToString();
  27.             }
  28.             else
  29.             {
  30.                 return "";
  31.             }
  32.         }
  33.     }
  34.     protected void Page_Load(object sender, EventArgs e)
  35.     {
  36.         LoginLogic.MatchLoad("../", "WorkFlow_FormDesignEdit");
  37.         if (!IsPostBack)
  38.         {
  39.             DropLoadSet();
  40.             object fmid = Request.QueryString["id"];
  41.             if (fmid != null)
  42.             {
  43.                 intFormId = fmid.ToString();
  44.                 MR = BR.GetModel(int.Parse(intFormId));
  45.                 TextBox1.Text = MR.BDMC;
  46.                 strFormModel = MR.BDNR;
  47.                 DropDownList1.SelectedValue = MR.LCLX.ToString();
  48.             }
  49.         }
  50.     }
  51.     public void DropLoadSet()
  52.     {
  53.         //部门
  54.         DropDownList1.DataTextField = "FLMC";
  55.         DropDownList1.DataValueField = "ID";
  56.         DropDownList1.DataSource = EnumGet.FlowBaseTypeGetEnum();
  57.         DropDownList1.DataBind();
  58.         DropDownList1.SelectedIndex = DropDownList1.Items.Count - 1;
  59.     }
  60.     protected void Button1_Click(object sender, EventArgs e)
  61.     {
  62.         try
  63.         {
  64.             if (TextBox1.Text == "")
  65.             {
  66.                 throw new Exception("表单名不能为空!");
  67.             }
  68.             MR.ID = int.Parse(Request.QueryString["id"].ToString());
  69.             MR.BDMC = TextBox1.Text;
  70.             MR.LCLX =int.Parse(DropDownList1.SelectedValue);
  71.             MR.BDNR = strFormModel;
  72.             BR.Update(MR);
  73.             MessageBox.Show("更新成功", "FormDesignManager.aspx");
  74.             TextBox1.Text = "";
  75.         }
  76.         catch (Exception exp)
  77.         {
  78.             MessageBox.Show(exp.Message);
  79.         }
  80.     }
  81. }