WorkFlowConfigureENew.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:9k
源码类别:
.net编程
开发平台:
C#
- 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;
- using com.etong.DAL.FC;
- public partial class Workflow_WorkFlowConfigureENew : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
- DataView dv = new DataView();
- dv=EFlyWF.GetWFKind();
- txtKind.DataSource = dv;
- txtKind.DataTextField = "KindName";
- txtKind.DataValueField = "KindID";
- txtKind.DataBind();
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- dv =EFlyPrj.GetAllOpRole();
- DLstType.DataTextField = "OpName";
- DLstType.DataValueField = "OpID";
- DLstType.DataSource = dv;
- DLstType.DataBind();
- string strM;
- strM = Request.QueryString["StrM"];
- //修改
- if (strM == "M")
- {
- int iWFID=0;
- try
- {
- iWFID = Convert.ToInt32(Request.QueryString["StrN"]);
- }
- catch
- {
- iWFID = -1;
- }
- if (iWFID == -1)
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:参数错误!');window.location.href('WorkFlowConfigure.aspx')", true);
- }
- else
- {
- dv = EFlyWF.GetWFOldData(iWFID);
- WFName.Text = dv.Table.Rows[0][2].ToString();
- txtUnit.Text = dv.Table.Rows[0][5].ToString();
- txtStatus.SelectedIndex = Convert.ToInt32(dv.Table.Rows[0][4].ToString());
- txtKind.Text = dv.Table.Rows[0][1].ToString();
- DLstType.Items.FindByValue(DLstType.SelectedValue).Selected = false;
- try
- {
- DLstType.Items.FindByValue(dv.Table.Rows[0][6].ToString()).Selected = true;
- }
- catch
- {
- }
- //txtType.SelectedIndex = Convert.ToInt32(dv.Table.Rows[0][6].ToString());
- //EFlyPrj.wID = iWFID;
- //try
- //{
- // DataView wdv = EFlyPrj.GetWFAssignOpRole();
- // for (int k = 0; k < wdv.Table.Rows.Count; k++)
- // {
- // for (int j = 0; j < ChLst.Items.Count; j++)
- // {
- // if (ChLst.Items[j].Value.ToString().Trim() == wdv.Table.Rows[k]["OpID"].ToString().Trim())
- // {
- // ChLst.Items[j].Selected = true;
- // break;
- // }
- // }
- // }
- //}
- //catch (Exception ex)
- //{
- // this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "").Replace("n", "") + "');</script>");
- // return;
- //}
- txtDesc.Text = dv.Table.Rows[0][3].ToString();
- string sTables;
- sTables = dv.Table.Rows[0][9].ToString();
- ListValue.Value = sTables;
- string sValue;
- int iValue;
- int i = sTables.Split('|').Length;
- DataView dv1 = new DataView();
- ListItem LtItem = new ListItem();
- for (int j = 0; j < i; j++)
- {
- sValue = sTables.Split('|').GetValue(j).ToString();
- try
- {
- iValue =Convert.ToInt32(sValue);
- }
- catch
- {
- iValue =-1;
- }
- if (iValue != -1)
- {
- dv1 = EFlyWF.GetWFOldTable(iValue, "1");
- if (dv1.Table.Rows.Count > 0)
- {
- LtItem.Value=sValue;
- LtItem.Text=dv1.Table.Rows[0][1].ToString();
- lbTables.Items.Add(LtItem);
- //lbTables.
- }
- }
- }
- //for (i = 0; i < sTables.Length; i++)
- //{
- //sValue = sTables.Substring(i, sTables.Split('|').Length);
- //}
- //lbTables
- }
- }
- else if (strM == "N")
- {
- }
- else
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:参数错误!');window.location.href('WorkFlowConfigure.aspx')", true);
- }
- }
- }
- protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
- {
- //string strSelect="";
- //this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.showModalDialog('WorkFlowSelectTable.aspx','','help=0;dialogWidth=450px;dialogHeight=350px;status=no;status=no;')", true);
- }
- protected void ImgSave_Click(object sender, ImageClickEventArgs e)
- {
- string sWFName,sUnit,sStatus,sKind,sType,sTable,sDecs;
- int iStatus,iKind,iType;
- sWFName = WFName.Text;
- sUnit = txtUnit.Text;
- sStatus = txtStatus.SelectedValue;
- sKind = txtKind.SelectedValue;
- sType = DLstType.SelectedValue;
- sTable = ListValue.Value;
- //for (i = 0; i < lbTables.Items.Count; i++)
- //{
- // if (i == 0)
- // {
- // sTable = lbTables.Items[i].Value;
- // }
- // else
- // {
- // sTable = sTable + "," + lbTables.Items[i].Value;
- // }
- //}
- sDecs = txtDesc.Text;
- try
- {
- iStatus = Convert.ToInt32(sStatus);
- }
- catch
- {
- iStatus=0;
- }
- try
- {
- iKind = Convert.ToInt32(sKind);
- }
- catch
- {
- iKind =0;
- }
- try
- {
- iType = Convert.ToInt32(sType);
- }
- catch
- {
- iType=0;
- }
- EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
- string strM;
- strM = Request.QueryString["StrM"];
- if (strM == "M")
- {
- int iWFID=0;
- try
- {
- iWFID = Convert.ToInt32(Request.QueryString["StrN"]);
- }
- catch
- {
- iWFID = -1;
- }
- if (EFlyWF.InsertUpWF(iWFID, sDecs, sWFName, iStatus, sUnit, iKind, -1, sTable, iType, -1, 0) == true)
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:工作流修改成功!');window.location.href('WorkFlowConfigure.aspx');", true);
- }
- else
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:工作流修改失败!');", true);
- }
- }
- else if (strM == "N")
- {
- if (EFlyWF.InsertUpWF(-1, sDecs, sWFName, iStatus, sUnit, iKind, -1, sTable, iType, -1, 0) == true)
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:工作流新增成功!');window.location.href('WorkFlowConfigure.aspx');", true);
- }
- else
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:工作流新增失败!');", true);
- }
- //this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert(' aaaa ')", true);
- }
- else
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:系统参数错!');", true);
- }
- }
- }