FormDesignEdit.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_FormDesignEdit : System.Web.UI.Page
- {
- //模板
- Model.FlowBaseFormContent MR = new Model.FlowBaseFormContent();
- //业务
- BLL.FlowBaseFormContent BR = new BLL.FlowBaseFormContent();
- public string intFormId = "1";
- public string strFormModel
- {
- set {
- ViewState["strFormModelVaie"] = value;
- }
- get {
- if (ViewState["strFormModelVaie"] != null)
- {
- return ViewState["strFormModelVaie"].ToString();
- }
- else
- {
- return "";
- }
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "WorkFlow_FormDesignEdit");
- if (!IsPostBack)
- {
- DropLoadSet();
- object fmid = Request.QueryString["id"];
- if (fmid != null)
- {
- intFormId = fmid.ToString();
- MR = BR.GetModel(int.Parse(intFormId));
- TextBox1.Text = MR.BDMC;
- strFormModel = MR.BDNR;
- DropDownList1.SelectedValue = MR.LCLX.ToString();
- }
- }
- }
- public void DropLoadSet()
- {
- //部门
- DropDownList1.DataTextField = "FLMC";
- DropDownList1.DataValueField = "ID";
- DropDownList1.DataSource = EnumGet.FlowBaseTypeGetEnum();
- DropDownList1.DataBind();
- DropDownList1.SelectedIndex = DropDownList1.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- if (TextBox1.Text == "")
- {
- throw new Exception("表单名不能为空!");
- }
- MR.ID = int.Parse(Request.QueryString["id"].ToString());
- MR.BDMC = TextBox1.Text;
- MR.LCLX =int.Parse(DropDownList1.SelectedValue);
- MR.BDNR = strFormModel;
- BR.Update(MR);
- MessageBox.Show("更新成功", "FormDesignManager.aspx");
- TextBox1.Text = "";
- }
- catch (Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- }