Exemplo n.º 1
0
 private void NodeInfoRestore()
 {
     if (this.hdnNodeID.Value != "")
     {
         DataTable dataTable = FlowTemplateAction.QueryOneNode(System.Convert.ToInt32(this.hdnNodeID.Value));
         if (dataTable.Rows.Count <= 0)
         {
             this.trAuditMain.Style.Add("display", "none");
             return;
         }
         if (!string.IsNullOrEmpty(dataTable.Rows[0]["AuditMain"].ToString()))
         {
             this.divAuditMain.InnerHtml = this.FormatTextArea(base.Server.HtmlEncode(dataTable.Rows[0]["AuditMain"].ToString()));
             return;
         }
         this.trAuditMain.Style.Add("display", "none");
         return;
     }
     else
     {
         DataTable auditRemark = FlowTemplateAction.GetAuditRemark(this.InstanceID);
         if (auditRemark.Rows.Count <= 0)
         {
             this.trAuditMain.Style.Add("display", "none");
             return;
         }
         if (!string.IsNullOrEmpty(auditRemark.Rows[0]["AuditRemark"].ToString()))
         {
             this.divAuditMain.InnerHtml = auditRemark.Rows[0]["AuditRemark"].ToString();
             return;
         }
         this.trAuditMain.Style.Add("display", "none");
         return;
     }
 }
Exemplo n.º 2
0
    private void TVRole_Create()
    {
        string    text      = "";
        DataTable dataTable = FlowTemplateAction.QueryBusinessCode();
        TreeNode  treeNode  = new TreeNode();

        treeNode.Text        = "业务编码";
        treeNode.NavigateUrl = "";
        treeNode.Target      = "frmPage";
        this.TVRole.Nodes.Add(treeNode);
        foreach (DataRow dataRow in dataTable.Rows)
        {
            TreeNode treeNode2 = new TreeNode();
            treeNode2.Text = dataRow["BusinessName"].ToString();
            string businessCode = dataRow["BusinessCode"].ToString();
            treeNode2.NavigateUrl = "WorkFlowCount.aspx?ti=" + dataRow["BusinessCode"].ToString() + "&class=" + text.ToString();
            treeNode2.Target      = "frmPage";
            treeNode.ChildNodes.Add(treeNode2);
            DataTable dataTable2 = FlowTemplateAction.QueryBusinessClass(businessCode);
            foreach (DataRow dataRow2 in dataTable2.Rows)
            {
                TreeNode treeNode3 = new TreeNode();
                treeNode3.Text        = dataRow2["BusinessClassName"].ToString();
                treeNode3.NavigateUrl = "WorkFlowCount.aspx?ti=" + dataRow2["BusinessCode"].ToString() + "&class=" + dataRow2["BusinessClass"].ToString();
                treeNode3.Target      = "frmPage";
                treeNode2.ChildNodes.Add(treeNode3);
            }
        }
    }
Exemplo n.º 3
0
    private void addFlowChart_top1()
    {
        int rowNum = 1;

        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
        hashtable.Add("TemplateID", this.TemplateID.ToString());
        hashtable.Add("RowNum", rowNum.ToString());
        hashtable.Add("Column1", SqlStringConstructor.GetQuotedString("1;0;开始"));
        DataRow dataRow = FlowTemplateAction.QueryFlowChart_top1(this.TemplateID, rowNum);

        if (dataRow != null)
        {
            if ((dataRow["TemplateID"].ToString() == "" || dataRow["TemplateID"] == null) && !FlowTemplateAction.AddFlowChart(hashtable))
            {
                this.JS.Text = "alert('添加数据失败!')";
                return;
            }
        }
        else
        {
            if (!FlowTemplateAction.AddFlowChart(hashtable))
            {
                this.JS.Text = "alert('添加数据失败!')";
            }
        }
    }
Exemplo n.º 4
0
    private void setOrderNumber()
    {
        DataRow dataRow = FlowTemplateAction.QueryOrderNumber(this.nodeID);

        if (dataRow == null)
        {
            this.txtOrder.Text = "1";
            this.RbAnd.Enabled = false;
            this.RbOr.Enabled  = false;
            this.RbNo.Enabled  = true;
            this.RbNo.Checked  = true;
            return;
        }
        if (dataRow["OrderNumber"].ToString() != "" && dataRow["OrderNumber"] != null)
        {
            int num = System.Convert.ToInt32(dataRow["OrderNumber"].ToString());
            this.txtOrder.Text = System.Convert.ToString(num + 1);
            this.RbAnd.Enabled = true;
            this.RbOr.Enabled  = true;
            this.RbNo.Enabled  = false;
            this.RbAnd.Checked = true;
            return;
        }
        this.txtOrder.Text = "1";
        this.RbAnd.Enabled = false;
        this.RbOr.Enabled  = false;
        this.RbNo.Enabled  = true;
        this.RbNo.Checked  = true;
    }
Exemplo n.º 5
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        System.Collections.Generic.List <string> @string = this.GetString(this.hfldUserCodes.Value);
        string templateid = base.Request["tid"].ToString();

        try
        {
            FlowTemplateAction.AddTempLimitUser(templateid, @string);
            string str = string.Concat(new string[]
            {
                "TemplateList.aspx?ti=",
                base.Request["code"].ToString(),
                "&class=",
                base.Request["class"].ToString(),
                "&flag=",
                base.Request["flag"].ToString(),
                " "
            });
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.Append("alert('系统提示:\\n\\n更新成功')").Append(System.Environment.NewLine);
            stringBuilder.Append("winclose('flowclass', '" + str + "', true);");
            base.RegisterScript(stringBuilder.ToString());
        }
        catch (System.Exception)
        {
            base.RegisterScript("alert('系统提示:\\n\\n更新失败')");
        }
    }
Exemplo n.º 6
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.TemplateID          = System.Convert.ToInt32(base.Request["tid"]);
         this.businessCode        = base.Request["bncode"];
         this.BusinessClass       = base.Request["class"];
         this.IsGeneral           = base.Request.QueryString["flag"];
         this.hdnTemplateID.Value = this.TemplateID.ToString();
         string str = "WorkFlowChart.aspx?tid=" + this.TemplateID.ToString();
         this.JS.Text = "this.fmNavigation.location.href='" + str + "';";
         this.ImgSingle.Attributes["onclick"] = "openRoleEdit(1,1)";
         this.ImgMulti.Attributes["onclick"]  = "openRoleEdit(1,2)";
         this.ImgGroup.Attributes["onclick"]  = "openRoleEdit(1,3)";
         this.ImgRole.Attributes["onclick"]   = "openRoleEdit(1,4)";
         this.ImgCorp.Attributes["onclick"]   = "openRoleEdit(1,5)";
         this.ImgEdit.Attributes["onclick"]   = "openRoleEdit(2,0)";
         this.ImgDelete.Attributes["onclick"] = "return delnode();";
         bool flag = FlowTemplateAction.IsProjectRelated(this.TemplateID);
         this.hfldIsProjectRelated.Value = (flag ? "1" : "0");
         if (ConfigHelper.ProjectType == "ZdContract")
         {
             this.td_project.Visible = false;
             this.td_group.Visible   = false;
             this.td_corp.Visible    = false;
         }
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     base.Response.Cache.SetNoStore();
     if (!this.Page.IsPostBack)
     {
         this.DataBindDepartment();
         string templateid = base.Request["tid"].ToString();
         System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
         DataTable tempLimitUser = FlowTemplateAction.GetTempLimitUser(templateid);
         if (tempLimitUser.Rows.Count > 0)
         {
             for (int i = 0; i < tempLimitUser.Rows.Count; i++)
             {
                 HiddenField expr_64 = this.hfldUserCodes;
                 expr_64.Value = expr_64.Value + tempLimitUser.Rows[i][0].ToString() + ",";
                 list.Add(tempLimitUser.Rows[i][0].ToString());
             }
             this.DataBindUserName(list);
             return;
         }
     }
     else
     {
         if (this.hfldUserCodes.Value != "")
         {
             System.Collections.Generic.List <string> @string = this.GetString(this.hfldUserCodes.Value);
             this.DataBindUserName(@string);
         }
     }
 }
Exemplo n.º 8
0
 protected void BtnAdd_Click(object sender, System.EventArgs e)
 {
     System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
     hashtable.Add("TemplateID", this.TemplateID.ToString());
     hashtable.Add("MainUser", SqlStringConstructor.GetQuotedString(this.UserCode.ToString()));
     hashtable.Add("SecondUser", SqlStringConstructor.GetQuotedString(this.hdnDbr.Value));
     hashtable.Add("TempNodeId", this.TempNodeID.ToString());
     if (this.NodeID == 0)
     {
         if (FlowTemplateAction.AddAgent(hashtable))
         {
             base.RegisterScript("top.ui.tabSuccess({ parentName: '_dbrinfo'});");
             return;
         }
         base.RegisterScript("top.ui.alert('保存失败');");
         return;
     }
     else
     {
         string where = " where NodeId = '" + this.NodeID + " '";
         if (FlowTemplateAction.UpdAgent(hashtable, where))
         {
             base.RegisterScript("top.ui.tabSuccess({ parentName: '_dbrinfo'});");
             return;
         }
         base.RegisterScript("top.ui.alert('保存失败');");
         return;
     }
 }
Exemplo n.º 9
0
 protected void TVDept_SelectedNodeChanged(object sender, System.EventArgs e)
 {
     if (this.TVDept.SelectedValue != "" && this.TVDept.SelectedValue.Substring(0, 1) != "r")
     {
         this.btnAdd.Disabled     = false;
         this.HdnTemplateID.Value = this.TVDept.SelectedValue;
         this.ViewState["tid"]    = this.TVDept.SelectedValue;
         DataTable dataTable = FlowTemplateAction.QueryOneTemplate(System.Convert.ToInt32(this.TVDept.SelectedValue));
         if (dataTable.Rows.Count > 0)
         {
             this.HdnBusinessClass.Value = dataTable.Rows[0]["BusinessClass"].ToString();
         }
         this.BindView(base.UserCode, System.Convert.ToInt32(this.TVDept.SelectedValue));
         DataTable fistDt = FlowAuditAction.GetFistDt(System.Convert.ToInt32(this.HdnTemplateID.Value.ToString()));
         if (fistDt.Rows.Count > 0 && fistDt.Rows[0][3].ToString() != "1")
         {
             string text = fistDt.Rows[0][2].ToString();
             this.hdflisDuty.Value = "1";
             this.hdflisName.Value = "1";
             if (!string.IsNullOrEmpty(text))
             {
                 if (fistDt.Rows[0][1].ToString() == "2" || fistDt.Rows[0][1].ToString() == "1")
                 {
                     if (!FlowAuditAction.GetUsersis(text))
                     {
                         this.hdflisName.Value = "0";
                     }
                     else
                     {
                         this.hdflisName.Value = "1";
                     }
                 }
                 else
                 {
                     if (fistDt.Rows[0][1].ToString() == "3" || fistDt.Rows[0][1].ToString() == "4" || fistDt.Rows[0][1].ToString() == "5")
                     {
                         DataTable role = FlowAuditAction.GetRole(text);
                         if (role.Rows.Count <= 0)
                         {
                             this.hdflisDuty.Value = "0";
                         }
                         else
                         {
                             this.hdflisDuty.Value = "1";
                         }
                     }
                 }
             }
         }
     }
     else
     {
         this.btnAdd.Disabled = true;
         DataTable dataSource = new DataTable();
         this.GVBook.DataSource = dataSource;
         this.GVBook.DataBind();
     }
     this.hdfNodeValue.Value = this.TVDept.SelectedValue;
 }
Exemplo n.º 10
0
    private void dgFlow_Bind()
    {
        DataTable dataSource = FlowTemplateAction.QueryAgent(this.TemplateID, this.UserCode, 9, this.AspNetPager1.CurrentPageIndex);

        this.AspNetPager1.RecordCount = FlowTemplateAction.GetQueryAgentCount(this.TemplateID, this.UserCode);
        this.dgFlow.DataSource        = dataSource;
        this.dgFlow.DataBind();
    }
Exemplo n.º 11
0
    protected void BtnAdd_Click(object sender, System.EventArgs e)
    {
        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
        hashtable.Add("NodeID", this.nodeID.ToString());
        hashtable.Add("OrderNumber", this.txtOrder.Text.Trim());
        string pStr;

        if (this.RbAnd.Checked)
        {
            pStr = "1";
        }
        else
        {
            if (this.RbOr.Checked)
            {
                pStr = "0";
            }
            else
            {
                pStr = "";
            }
        }
        hashtable.Add("AndOr", SqlStringConstructor.GetQuotedString(pStr));
        hashtable.Add("ConditionField", SqlStringConstructor.GetQuotedString(this.ddltCondition.SelectedValue.ToString()));
        hashtable.Add("FieldType", SqlStringConstructor.GetQuotedString(this.hdnFieldType.Value));
        hashtable.Add("ConditionType", SqlStringConstructor.GetQuotedString(this.ddltConditionType.SelectedValue.ToString()));
        hashtable.Add("ConditionValue", this.txtConditionValue.Text.Trim());
        DataRow dataRow = FlowTemplateAction.QueryOrderNumberList(this.nodeID, System.Convert.ToInt32(this.txtOrder.Text.Trim()));

        if (dataRow != null)
        {
            if (dataRow["NodeID"].ToString() != "" && dataRow["NodeID"] != null)
            {
                string where = "where NodeId = " + this.nodeID.ToString() + " and OrderNumber = " + this.txtOrder.Text.Trim();
                if (FlowTemplateAction.UpdNodeCondition(hashtable, where))
                {
                    this.JS.Text = "alert('更改成功!');window.returnValue=false;window.close();";
                    return;
                }
            }
            else
            {
                if (FlowTemplateAction.AddNodeCondition(hashtable))
                {
                    this.JS.Text = "alert('增加成功!');window.returnValue=false;window.close();";
                    return;
                }
            }
        }
        else
        {
            if (FlowTemplateAction.AddNodeCondition(hashtable))
            {
                this.JS.Text = "alert('增加成功!');window.returnValue=false;window.close();";
            }
        }
    }
Exemplo n.º 12
0
 private void dgFlow_Bind()
 {
     string[] childCorp = new string[]
     {
         this.Session["CorpCode"].ToString()
     };
     this.dgFlow.DataSource = FlowTemplateAction.QueryTemplateList(this.businessCode, this.BusinessClass, childCorp, this.IsGeneral);
     this.dgFlow.DataBind();
 }
Exemplo n.º 13
0
    private void NodeInfoRestore()
    {
        DataTable dataTable = FlowTemplateAction.QueryOneNode(System.Convert.ToInt32(this.hdnNodeID.Value));

        if (dataTable.Rows.Count > 0)
        {
            this.LbAuditMain.Text = dataTable.Rows[0]["AuditMain"].ToString();
        }
    }
Exemplo n.º 14
0
    protected void btnDel_Click(object sender, System.EventArgs e)
    {
        int nodeId = System.Convert.ToInt32(this.hdnNodeId.Value);

        if (FlowTemplateAction.DelAgent(nodeId))
        {
            this.JS.Text = "alert('删除成功!');";
            this.dgFlow_Bind();
        }
    }
Exemplo n.º 15
0
    private void addFlowChart_top1()
    {
        int rowNum = 1;

        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
        hashtable.Add("TemplateID", this.TemplateID.ToString());
        hashtable.Add("RowNum", rowNum.ToString());
        hashtable.Add("Column1", SqlStringConstructor.GetQuotedString("1;0;开始"));
        FlowTemplateAction.QueryFlowChart_top1(this.TemplateID, rowNum);
    }
Exemplo n.º 16
0
    private void btnDel_Click(object sender, System.EventArgs e)
    {
        int templateId = System.Convert.ToInt32(this.hdnTemplateID.Value);

        if (FlowTemplateAction.DelTemplate(templateId))
        {
            this.JS.Text = "alert('删除成功!');window.parent.frames[1].location.href = \"about:blank\"";
            this.dgFlow_Bind();
        }
    }
Exemplo n.º 17
0
    private void btn_Del_Click(object sender, System.EventArgs e)
    {
        int nodeId     = System.Convert.ToInt32(this.hdnNodeID.Value);
        int templateId = System.Convert.ToInt32(this.hdnTemplateID.Value);

        if (FlowTemplateAction.DelNode(nodeId, templateId))
        {
            this.JS.Text = "alert('删除成功!');";
            this.dgFlowChild_Bind();
        }
    }
Exemplo n.º 18
0
    private void MKMCBind()
    {
        DataTable mKMC        = FlowTemplateAction.GetMKMC();
        DataView  defaultView = mKMC.DefaultView;

        defaultView.RowFilter       = "V_MKMC IS NOT NULL";
        this.DDLMKMC.DataTextField  = "V_MKMC";
        this.DDLMKMC.DataValueField = "C_MKDM";
        this.DDLMKMC.DataSource     = defaultView.ToTable();
        this.DDLMKMC.DataBind();
    }
Exemplo n.º 19
0
    protected void ddltCondition_SelectedIndexChanged(object sender, System.EventArgs e)
    {
        string    b         = this.ddltCondition.SelectedValue.ToString();
        DataTable dataTable = FlowTemplateAction.QueryConditionField(this.nodeID);

        foreach (DataRow dataRow in dataTable.Rows)
        {
            if (dataRow["columnName"].ToString() == b)
            {
                this.hdnFieldType.Value = dataRow["type"].ToString();
            }
        }
    }
Exemplo n.º 20
0
    private void setData(int templateId, string userCode)
    {
        object value = FlowTemplateAction.QueryTemplateName(templateId);

        this.txtTemplateName.Text = System.Convert.ToString(value);
        value = FlowTemplateAction.QueryAuditor(userCode);
        this.txtAuditor.Text = System.Convert.ToString(value);
        if (this.NodeID != 0)
        {
            value             = FlowTemplateAction.QueryOneAgent(this.NodeID);
            this.hdnDbr.Value = System.Convert.ToString(value);
            value             = FlowTemplateAction.QueryAuditor(this.hdnDbr.Value);
            this.txtDbr.Text  = System.Convert.ToString(value);
        }
    }
Exemplo n.º 21
0
    protected void SetViewState(string businessCode, string businessClass, System.Guid recordID, string projectCode, string userCode)
    {
        string[]  array     = new string[3];
        DataTable dataTable = FlowTemplateAction.QueryTemplateByClass(businessClass, businessCode, userCode);
        int       count     = dataTable.Rows.Count;

        if (count == 1)
        {
            int num             = System.Convert.ToInt32(dataTable.Rows[0]["TemplateID"].ToString());
            int posPositionNode = FlowChartAction.GetPosPositionNode(0, num);
            if (posPositionNode > 1)
            {
                array = FlowAuditAction.SelectOffSet(num, "0", 0, businessClass, recordID);
                if (array[2].ToString() != "0")
                {
                    this.TemplateCount = count;
                }
                if (this.TemplateCount == 1)
                {
                    this.OffsetCount = posPositionNode;
                    this.NodeID      = System.Convert.ToInt32(array[0]);
                    return;
                }
            }
            else
            {
                if (posPositionNode == 1)
                {
                    DataTable dataTable2 = FlowTemplateAction.QueryOffsetNodeFirst("0", num);
                    this.TemplateCount = count;
                    string a      = dataTable2.Rows[0]["IsSelReceiver"].ToString();
                    int    nodeID = System.Convert.ToInt32(dataTable2.Rows[0]["NodeID"].ToString());
                    if (a != "0")
                    {
                        this.NodeID = nodeID;
                        return;
                    }
                }
            }
        }
        else
        {
            if (count > 1)
            {
                this.TemplateCount = count;
            }
        }
    }
Exemplo n.º 22
0
    private void CreateConditionField()
    {
        DataTable dataTable = FlowTemplateAction.QueryConditionField(this.nodeID);

        this.ddltCondition.Items.Clear();
        foreach (DataRow dataRow in dataTable.Rows)
        {
            string key;
            switch (key = dataRow["type"].ToString())
            {
            case "bigint":
            case "float":
            case "int":
            case "money":
            case "numeric":
            case "smallint":
            case "smallmoney":
            case "tinyint":
            {
                ListItem item = new ListItem(dataRow["Description"].ToString(), dataRow["columnName"].ToString());
                this.ddltCondition.Items.Add(item);
                break;
            }

            case "datetime":
            {
                ListItem item = new ListItem(dataRow["Description"].ToString(), dataRow["columnName"].ToString());
                this.ddltCondition.Items.Add(item);
                break;
            }

            case "decimal":
            {
                ListItem item = new ListItem(dataRow["Description"].ToString(), dataRow["columnName"].ToString());
                this.ddltCondition.Items.Add(item);
                break;
            }
            }
        }
        ListItem listItem = new ListItem("---请选择条件字段---", "0");

        listItem.Selected = true;
        this.ddltCondition.Items.Insert(0, listItem);
    }
Exemplo n.º 23
0
    private void LbAll_Bound(string frontNodeStr)
    {
        bool flag = FlowChartAction.IsPoolNode(this.TemplateID);

        if (flag)
        {
            int num = 0;
            int i   = frontNodeStr.IndexOf(",");
            if (i > 0)
            {
                string value;
                object value2;
                while (i > 0)
                {
                    value  = frontNodeStr.Substring(0, i);
                    value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value));
                    ListItem item = new ListItem(System.Convert.ToString(value2), value);
                    this.LbAll.Items.Insert(num, item);
                    frontNodeStr = frontNodeStr.Substring(i + 1, frontNodeStr.Length - i - 1);
                    i            = frontNodeStr.IndexOf(",");
                    num++;
                }
                value  = frontNodeStr;
                value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value));
                ListItem item2 = new ListItem(System.Convert.ToString(value2), value);
                this.LbAll.Items.Insert(num, item2);
            }
            else
            {
                object   value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(frontNodeStr));
                ListItem item3  = new ListItem(System.Convert.ToString(value2), frontNodeStr);
                this.LbAll.Items.Insert(num, item3);
            }
            this.LoadNoPostPosition(num + 1);
            return;
        }
        if (this.LoadNoPostPosition(0) == 0)
        {
            object   value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(frontNodeStr));
            ListItem item4  = new ListItem(System.Convert.ToString(value2), frontNodeStr);
            this.LbAll.Items.Insert(0, item4);
        }
    }
Exemplo n.º 24
0
    private void TemplateRestore(int templateId)
    {
        DataTable dataTable = FlowTemplateAction.QueryOneTemplate(templateId);

        if (dataTable.Rows.Count == 1)
        {
            this.txtTemplateName.Text   = dataTable.Rows[0]["TemplateName"].ToString();
            this.hdnBusinessCode.Value  = dataTable.Rows[0]["BusinessCode"].ToString();
            this.hdnBusinessClass.Value = dataTable.Rows[0]["BusinessClass"].ToString();
            this.hdnIsComplete.Value    = dataTable.Rows[0]["IsComplete"].ToString();
            this.txtRemark.Text         = dataTable.Rows[0]["remark"].ToString();
            if (dataTable.Rows[0]["IsAbnormality"].ToString() == "1")
            {
                this.ckbIsAbnormality.Checked = true;
            }
            else
            {
                this.ckbIsAbnormality.Checked = false;
            }
            if (dataTable.Rows[0]["IsGeneral"].ToString() == "1")
            {
                this.ckbIsGeneral.Checked = true;
            }
            else
            {
                this.ckbIsGeneral.Checked = false;
            }
            this.IsGeneral = dataTable.Rows[0]["IsGeneral"].ToString();
            string text = dataTable.Rows[0]["RecordID"].ToString();
            if (text != "" && text != null)
            {
                this.ddltRecordID.ClearSelection();
                this.ddltRecordID.Items.FindByValue(text).Selected = true;
            }
            if (this.trCorpCode.Visible)
            {
                this.DDLCorpCode.SelectedValue = dataTable.Rows[0]["CorpCode"].ToString();
            }
        }
    }
Exemplo n.º 25
0
    private void dgFlowChild_Save()
    {
        DataTable dataTable = new DataTable();

        dataTable.Columns.Add(new DataColumn("NodeID"));
        dataTable.Columns.Add(new DataColumn("TheOrder"));
        for (int i = 0; i < this.dgFlowChild.Items.Count; i++)
        {
            DataGridItem dataGridItem = this.dgFlowChild.Items[i];
            int          num          = (int)this.dgFlowChild.DataKeys[i];
            int          num2         = System.Convert.ToInt32(((TextBox)dataGridItem.Cells[3].Controls[1]).Text);
            DataRow      dataRow      = dataTable.NewRow();
            dataRow["NodeID"]   = num.ToString();
            dataRow["TheOrder"] = num2.ToString();
            dataTable.Rows.Add(dataRow);
        }
        DataRow[] array = dataTable.Select("", "TheOrder asc");
        for (int j = 0; j < array.Length; j++)
        {
            FlowTemplateAction.UpdOrder(int.Parse(array[j]["NodeID"].ToString()), j + 1);
        }
    }
Exemplo n.º 26
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        base.Response.Cache.SetNoStore();
        string value = base.Request["tid"];

        if (!this.Page.IsPostBack)
        {
            if (base.Request["type"] != null)
            {
                this.hdfNodeValue.Value = base.Request.QueryString["type"];
                value = this.hdfNodeValue.Value;
            }
            this.Tree_Bind();
            BasicConfigService basicConfigService = new BasicConfigService();
            this.hfldPwd.Value = basicConfigService.GetValue("TheDeletePwd");
            this.KeepTreeViewState();
        }
        if (!string.IsNullOrEmpty(value))
        {
            this.HdnTemplateID.Value = value;
            DataTable dataTable = FlowTemplateAction.QueryOneTemplate(System.Convert.ToInt32(value));
            if (dataTable.Rows.Count > 0)
            {
                this.HdnBusinessClass.Value = dataTable.Rows[0]["Businessclass"].ToString();
            }
            this.BindView(base.UserCode, System.Convert.ToInt32(value));
        }
        if (this.ViewState["tid"] != null)
        {
            this.BindView(base.UserCode, System.Convert.ToInt32(this.ViewState["tid"].ToString()));
        }
        this.btnAdd.Attributes["onclick"]           = "javascript:if(!OpenWin('add')) return false;";
        this.btnEdit.Attributes["onclick"]          = "javascript:if(!OpenWin('upd')) return false;";
        this.btnDel.Attributes["onclick"]           = "javascript:if(!confirm('确定删除该项吗?')) return false;";
        this.btnWFPrint.Attributes["onclick"]       = "OpenPrintWF('999');";
        this.btnStartWFRecord.Attributes["onclick"] = "openAudit('999')";
        this.BtnView.Attributes["onclick"]          = "OpenLock();";
    }
Exemplo n.º 27
0
    private void SetFrontNode(int templateId, string frontNode)
    {
        string text = "";
        int    i    = frontNode.IndexOf(",");

        if (i > 0)
        {
            string value;
            object value2;
            while (i > 0)
            {
                value     = frontNode.Substring(0, i);
                value2    = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value));
                text      = text + System.Convert.ToString(value2) + ",";
                frontNode = frontNode.Substring(i + 1, frontNode.Length - i - 1);
                i         = frontNode.IndexOf(",");
            }
            value  = frontNode;
            value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value));
            text  += System.Convert.ToString(value2);
        }
        else
        {
            if (frontNode == "0")
            {
                text = "开始";
            }
            else
            {
                string value  = frontNode;
                object value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value));
                text = System.Convert.ToString(value2);
            }
        }
        this.txtFrontNode.Text = text;
    }
Exemplo n.º 28
0
    protected int LoadNoPostPosition(int h)
    {
        DataTable dataTable = FlowTemplateAction.QueryFlowChart(this.TemplateID);

        if (dataTable.Rows.Count > 0)
        {
            for (int i = 0; i < dataTable.Rows.Count; i += 2)
            {
                int j = dataTable.Columns.Count - 2;
                while (j > 2)
                {
                    if (dataTable.Rows[i].ItemArray[j] != null && dataTable.Rows[i].ItemArray[j].ToString() != "")
                    {
                        int    num   = 0;
                        string a     = "";
                        string text  = "";
                        string value = "";
                        string text2 = dataTable.Rows[i].ItemArray[j].ToString();
                        int    k     = text2.IndexOf(";");
                        if (k <= 0)
                        {
                            break;
                        }
                        while (k > 0)
                        {
                            switch (num)
                            {
                            case 1:
                                a     = text2.Substring(0, k);
                                value = string.Concat(new string[]
                                {
                                    (j - 1).ToString(),
                                    ";",
                                    (i + 1).ToString(),
                                    ";",
                                    text2.Substring(0, k)
                                });
                                break;

                            case 2:
                                text = text2.Substring(0, k);
                                break;
                            }
                            text2 = text2.Substring(k + 1, text2.Length - k - 1);
                            k     = text2.IndexOf(";");
                            num++;
                        }
                        if (!(a == "00"))
                        {
                            ListItem item = new ListItem(text, value);
                            this.LbAll.Items.Insert(h, item);
                            h++;
                            break;
                        }
                        break;
                    }
                    else
                    {
                        j--;
                    }
                }
            }
        }
        return(h);
    }
Exemplo n.º 29
0
    protected void ImgComplete_Click(object sender, ImageClickEventArgs e)
    {
        if (!FlowChartAction.IsHaveNode(this.TemplateID))
        {
            string         cmdText           = "\r\n\t\t\t\t\tUPDATE WF_FlowChart SET Column2 = '7', Column3 = '2', Column4 = '4;00;结束'\r\n\t\t\t\t\tWHERE TemplateID = @TemplateID";
            string         cmdText2          = "UPDATE WF_Template SET IsComplete = '1' WHERE TemplateID = @TemplateID";
            SqlParameter[] commandParameters = new SqlParameter[]
            {
                new SqlParameter("@TemplateID", this.TemplateID)
            };
            SqlHelper.ExecuteNonQuery(CommandType.Text, cmdText, commandParameters);
            SqlHelper.ExecuteNonQuery(CommandType.Text, cmdText2, commandParameters);
            this.fmNavigation.Attributes["src"] = "WorkFlowChart.aspx?tid=" + this.TemplateID.ToString();
            return;
        }
        object value = FlowTemplateAction.QueryTemplateState(this.TemplateID);

        if (System.Convert.ToString(value) == "1")
        {
            this.JS.Text = "alert('该流程模板已创建结束!')";
            return;
        }
        string text   = "";
        string text2  = "";
        int    nodeID = 0;
        bool   flag   = FlowChartAction.IsPoolNode(this.TemplateID);

        if (flag)
        {
            if (!FlowChartAction.FlowComplete(this.TemplateID))
            {
                this.JS.Text = "alert('创建工作流程失败!');";
            }
        }
        else
        {
            DataTable dataTable = FlowTemplateAction.QueryFlowChart(this.TemplateID);
            if (dataTable.Rows.Count > 0)
            {
                for (int i = 0; i < dataTable.Rows.Count; i += 2)
                {
                    int j = dataTable.Columns.Count - 2;
                    while (j > 2)
                    {
                        if (dataTable.Rows[i].ItemArray[j] != null && dataTable.Rows[i].ItemArray[j].ToString() != "")
                        {
                            int    num   = 0;
                            string str   = "";
                            string text3 = dataTable.Rows[i].ItemArray[j].ToString();
                            int    k     = text3.IndexOf(";");
                            if (k > 0)
                            {
                                while (k > 0)
                                {
                                    int num2 = num;
                                    if (num2 == 1)
                                    {
                                        text2 = text2 + text3.Substring(0, k) + ",";
                                        str   = string.Concat(new string[]
                                        {
                                            (j - 1).ToString(),
                                            ";",
                                            (i + 1).ToString(),
                                            ";",
                                            text3.Substring(0, k)
                                        });
                                    }
                                    text3 = text3.Substring(k + 1, text3.Length - k - 1);
                                    k     = text3.IndexOf(";");
                                    num++;
                                }
                                text = text + str + ",";
                                break;
                            }
                            break;
                        }
                        else
                        {
                            j--;
                        }
                    }
                }
            }
            if (!FlowChartAction.CreatePoolNode(text, text2, nodeID, this.TemplateID, "结束", "", "New", "0"))
            {
                this.JS.Text = "alert('创建工作流程失败!');";
            }
        }
        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
        hashtable.Add("IsComplete", SqlStringConstructor.GetQuotedString("1"));
        string where = "where TemplateID = " + this.TemplateID.ToString();
        if (!FlowTemplateAction.UpdTemplate(hashtable, where))
        {
            this.JS.Text = "alert('创建工作流程失败!');";
        }
        string str2 = string.Concat(new string[]
        {
            "TemplateList.aspx?ti=",
            this.businessCode.ToString(),
            "&class=",
            this.BusinessClass.ToString(),
            "&flag=",
            this.IsGeneral
        });

        this.JS.Text = "parent.fraTemplate.location.href= '" + str2 + "';";
    }
Exemplo n.º 30
0
    private void BtnAdd_Click(object sender, System.EventArgs e)
    {
        string text     = StringHelper.FilterSpecial(this.txtNodeName.Text.Trim());
        string arg_21_0 = this.hdnOperater.Value;
        string pStr     = "";

        if (this.rbSingle.Checked)
        {
            pStr = "1";
        }
        if (this.rbMilti.Checked)
        {
            pStr = "2";
        }
        if (this.rbGroup.Checked)
        {
            pStr = "3";
        }
        if (this.rbItem.Checked)
        {
            pStr = "4";
        }
        if (this.rbDept.Checked)
        {
            pStr = "5";
        }
        string pStr2 = "1";
        string pStr3;

        if (this.rbIsAllPass1.Checked)
        {
            pStr3 = "1";
        }
        else
        {
            pStr3 = "0";
        }
        string pStr4;

        if (this.CkbIsSec.Checked)
        {
            pStr4 = "1";
            userManageDb userManageDb = new userManageDb();
            string[]     array        = this.hdnOperater.Value.Split(new char[44]);
            if (array.Length > 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    DataTable auditPwd = userManageDb.GetAuditPwd(array[i]);
                    if (auditPwd.Rows.Count > 0)
                    {
                        auditPwd.Rows[0]["AuditPwd"].ToString();
                        if (string.IsNullOrEmpty(auditPwd.Rows[0]["AuditPwd"].ToString()))
                        {
                            userManageDb.updateUserAuditPwd(array[i], "easy");
                        }
                    }
                }
            }
        }
        else
        {
            pStr4 = "0";
        }
        string pStr5;

        if (this.CkbIsSelReceiver.Checked)
        {
            pStr5 = "1";
        }
        else
        {
            pStr5 = "0";
        }
        string text2 = this.txtRemark.Text;
        string value = this.hdnFrontNode.Value;

        System.Collections.Hashtable hashtable = new System.Collections.Hashtable();
        hashtable.Add("TemplateID", this.TemplateID.ToString());
        hashtable.Add("NodeName", SqlStringConstructor.GetQuotedString(text));
        hashtable.Add("Operater", SqlStringConstructor.GetQuotedString(this.hdnOperater.Value));
        hashtable.Add("AuditorType", SqlStringConstructor.GetQuotedString(pStr));
        hashtable.Add("IsSendMsg", SqlStringConstructor.GetQuotedString(pStr2));
        hashtable.Add("IsAllPass", SqlStringConstructor.GetQuotedString(pStr3));
        hashtable.Add("ConditionDescription", SqlStringConstructor.GetQuotedString(text2));
        hashtable.Add("During", this.txtDuring.Text.Trim());
        hashtable.Add("FrontNode", SqlStringConstructor.GetQuotedString(value));
        hashtable.Add("IsSecValidate", SqlStringConstructor.GetQuotedString(pStr4));
        hashtable.Add("IsSelReceiver", SqlStringConstructor.GetQuotedString(pStr5));
        hashtable.Add("AuditMain", SqlStringConstructor.GetQuotedString(this.txtAuditMain.Text));
        hashtable.Add("DueMode", SqlStringConstructor.GetQuotedString(this.RbDueMode.SelectedValue));
        hashtable.Add("DepCode", SqlStringConstructor.GetQuotedString(this.hfldDep.Value));
        hashtable.Add("Id", SqlStringConstructor.GetQuotedString(System.Guid.NewGuid().ToString()));
        string pos = this.hdnPos.Value.ToString();

        if (!this.CkbIsSelReceiver.Checked)
        {
            if (text != "" && this.hdnOperater.Value.ToString().Trim() != "" && this.txtDuring.Text.ToString().Trim() != "")
            {
                if (this.NodeID != 0)
                {
                    string where = " Where NodeID = " + this.NodeID.ToString();
                    if (FlowTemplateAction.UpdNode(hashtable, where) && FlowChartAction.UpdateFlowChart(this.xpos, this.ypos, pos, this.FrontNodeOld, value, this.NodeID, this.TemplateID, text, text2, this.types))
                    {
                        base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                        return;
                    }
                }
                else
                {
                    object obj = FlowTemplateAction.AddNode(hashtable);
                    if (obj != null)
                    {
                        int    num       = System.Convert.ToInt32(obj);
                        string sqlString = string.Concat(new object[]
                        {
                            "SELECT * FROM WF_TemplateNode WHERE FrontNode='",
                            value,
                            "' AND TemplateID=",
                            this.TemplateID,
                            " AND NodeID !=",
                            num,
                            " "
                        });
                        DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString);
                        if (dataTable.Rows.Count > 0)
                        {
                            string sqlString2 = string.Concat(new object[]
                            {
                                " UPDATE WF_TemplateNode SET FrontNode=",
                                num,
                                " WHERE FrontNode='",
                                value,
                                "' AND TemplateID=",
                                this.TemplateID,
                                " AND NodeID !=",
                                num,
                                " "
                            });
                            bool flag = publicDbOpClass.NonQuerySqlString(sqlString2);
                            if (flag && FlowChartAction.CreateNewFlowChart(this.xpos, this.ypos, this.FrontNode.ToString(), num, this.TemplateID, text, this.types))
                            {
                                base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                                return;
                            }
                        }
                        else
                        {
                            if (FlowChartAction.CreateNewFlowChart(this.xpos, this.ypos, this.FrontNode.ToString(), num, this.TemplateID, text, this.types))
                            {
                                base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                                return;
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (text != "" && this.txtDuring.Text.ToString().Trim() != "")
            {
                if (this.NodeID != 0)
                {
                    string where2 = " Where NodeID = " + this.NodeID.ToString();
                    if (FlowTemplateAction.UpdNode(hashtable, where2) && FlowChartAction.UpdateFlowChart(this.xpos, this.ypos, pos, this.FrontNodeOld, value, this.NodeID, this.TemplateID, text, text2, this.types))
                    {
                        base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                        return;
                    }
                }
                else
                {
                    object obj2 = FlowTemplateAction.AddNode(hashtable);
                    if (obj2 != null)
                    {
                        int num2 = System.Convert.ToInt32(obj2);
                        value.IndexOf(",");
                        string sqlString3 = string.Concat(new object[]
                        {
                            "SELECT * FROM WF_TemplateNode WHERE FrontNode='",
                            value,
                            "' AND TemplateID=",
                            this.TemplateID,
                            " AND NodeID !=",
                            num2,
                            " "
                        });
                        DataTable dataTable2 = publicDbOpClass.DataTableQuary(sqlString3);
                        if (dataTable2.Rows.Count > 0)
                        {
                            string sqlString4 = string.Concat(new object[]
                            {
                                " UPDATE WF_TemplateNode SET FrontNode=",
                                num2,
                                " WHERE FrontNode='",
                                value,
                                "' AND TemplateID=",
                                this.TemplateID,
                                " AND NodeID !=",
                                num2,
                                " "
                            });
                            bool flag2 = publicDbOpClass.NonQuerySqlString(sqlString4);
                            if (flag2 && FlowChartAction.CreateNewFlowChart(this.xpos, this.ypos, this.FrontNode.ToString(), num2, this.TemplateID, text, this.types))
                            {
                                base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                                return;
                            }
                        }
                        else
                        {
                            if (FlowChartAction.CreateNewFlowChart(this.xpos, this.ypos, this.FrontNode.ToString(), num2, this.TemplateID, text, this.types))
                            {
                                base.RegisterScript("top.ui.winSuccess({ parentName: '_flowchart' });");
                            }
                        }
                    }
                }
            }
        }
    }