Пример #1
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.TemplateID = System.Convert.ToInt32(base.Request["tid"]);
         this.addFlowChart_top1();
         FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID);
     }
 }
Пример #2
0
    protected void btnDeal_Click(object sender, System.EventArgs e)
    {
        string a = FlowChartAction.FlowChartDeal();

        if (a == "true")
        {
            base.RegisterScript("alert('系统提示:\\n执行成功')");
            return;
        }
        base.RegisterScript("alert('系统提示:\\n执行失败')");
    }
Пример #3
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;
            }
        }
    }
Пример #4
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);
        }
    }
Пример #5
0
    protected void ImgDelete_Click(object sender, ImageClickEventArgs e)
    {
        string text  = this.hdnNodeID.Value.Trim();
        string text2 = this.hdnPos.Value.Trim();

        if (text != "" && text != null)
        {
            int nodeID          = System.Convert.ToInt32(text);
            int num             = text2.IndexOf(",");
            int xpos            = System.Convert.ToInt32(text2.Substring(0, num));
            int ypos            = System.Convert.ToInt32(text2.Substring(num + 1, text2.Length - num - 1));
            int posPositionNode = FlowChartAction.GetPosPositionNode(nodeID, this.TemplateID);
            if (posPositionNode > 1)
            {
                this.JS.Text = "alert('此节点不能删除!');";
            }
            else
            {
                if ((posPositionNode == 1 || posPositionNode == 0) && !FlowChartAction.DelNode(xpos, ypos, nodeID, this.TemplateID))
                {
                    this.JS.Text = "alert('节点删除失败!');";
                }
            }
        }
        this.hdnNodeID.Value = "";
        string.Concat(new string[]
        {
            "TemplateList.aspx?ti=",
            this.businessCode.ToString(),
            "&class=",
            this.BusinessClass.ToString(),
            "&flg=",
            this.IsGeneral
        });
        this.fmNavigation.Attributes["src"] = "WorkFlowChart.aspx?tid=" + this.TemplateID.ToString();
    }
Пример #6
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 + "';";
    }
Пример #7
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' });");
                            }
                        }
                    }
                }
            }
        }
    }
Пример #8
0
    protected void BtnAdd_ClickWX(object sender, System.EventArgs e)
    {
        if (this.ddltTemplate.SelectedValue == "-1")
        {
            base.RegisterScript("alert('请选择流程模板')");
            return;
        }
        WFInstanceMainService wFInstanceMainService = new WFInstanceMainService();
        WFTemplateNodeService wFTemplateNodeService = new WFTemplateNodeService();

        if (wFTemplateNodeService.GetNodes(this.TemplateID).Count == 0)
        {
            wFInstanceMainService.UpdateBusinessData(this.RecordID.ToString(), this.BusinessCode, 1);
            WFBusinessCodeService wFBusinessCodeService = new WFBusinessCodeService();
            WFBusinessCode        byId = wFBusinessCodeService.GetById(this.BusinessCode);
            string path     = base.Server.MapPath("~/SelfEventInfo.xml");
            string typeName = SelfEventAction.GetTypeName(path, byId.LinkTable, byId.StateField);
            if (!string.IsNullOrEmpty(typeName))
            {
                ISelfEvent selfEvent = (ISelfEvent)System.Reflection.Assembly.Load("PmBusinessLogic").CreateInstance(typeName);
                if (selfEvent != null)
                {
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(selfEvent.CommitEvent), this.RecordID.ToString());
                }
            }
            if (this.BusinessCode == "089")
            {
                PTPrjInfoZTB byId2 = this.ptInfoZTbSer.GetById(this.RecordID);
                this.ptInfoZTbSer.UpdatePrjState(byId2, new int?(2));
            }
            else
            {
                if (this.BusinessCode == "100")
                {
                    PrjMember.AddLimit(this.RecordID);
                }
                else
                {
                    if (this.BusinessCode == "107")
                    {
                        Progress.UpdateLatest(this.RecordID.ToString());
                    }
                    else
                    {
                        if (this.BusinessCode == "108")
                        {
                            cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(this.RecordID.ToString());
                        }
                    }
                }
            }

            stringBuilder.Append("alert('审核通过');");
            stringBuilder.Append(" page_close();");
            stringBuilder.Append("window.parent.location.reload();");
            base.RegisterScript(stringBuilder.ToString());
            base.RegisterScript(stringBuilder.ToString());
            //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('审核通过'); ");

            return;
        }
        if (wFInstanceMainService.IsReSubmit(this.RecordID.ToString(), this.BusinessCode))
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('当前数据已经被提交,禁止二次提交');", true);
            return;
        }
        if (this.ddltTemplate.SelectedValue != "-1")
        {
            FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID);
            if (this.txtReceiver.Text != "")
            {
                if (this.TemplateID == 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('请选择流程模板');", true);
                    return;
                }
                string[] array = new string[3];
                this.TemplateID = System.Convert.ToInt32(this.hdnTemplateID.Value);
                if (this.TemplateCount > 1)
                {
                    array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
                    this.hdnNodeId.Value      = array[0].ToString();
                    this.hdnOrderNumber.Value = array[1].ToString();
                }
                else
                {
                    if (this.TemplateCount == 1)
                    {
                        if (this.OffsetCount > 1)
                        {
                            this.hdnNodeId.Value      = this.NodeID.ToString();
                            this.hdnOrderNumber.Value = "1";
                        }
                        else
                        {
                            array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
                            this.hdnNodeId.Value      = array[0].ToString();
                            this.hdnOrderNumber.Value = array[1].ToString();
                        }
                    }
                }
                int offsetorder = System.Convert.ToInt32(this.hdnOrderNumber.Value.ToString().Trim());
                this.NodeID = System.Convert.ToInt32(this.hdnNodeId.Value.ToString().Trim());
                if (this.hdnNodeId.Value.Trim() == "0")
                {
                    this.JS.Text = "alert('工作流程多分支模板未设置分支条件!');";
                    return;
                }
                if (this.Type.Value != "")
                {
                    FlowAuditAction.UpdateNode(this.hdnReceiver.Value, this.TemplateID);
                }
                if (FlowAuditAction.BeginFlow(this.BusinessClass, this.BusinessCode, this.RecordID, this.TemplateID, this.NodeID, offsetorder, this.ProjectCode, this.UserCode))
                {
                    try
                    {
                        if (ConfigHelper.Get("SMS") != "")
                        {
                            DataTable dataTable  = publicDbOpClass.DataTableQuary("select * from wf_templatenode where templateid=" + this.TemplateID + " and frontnode=0");
                            DataTable dataTable2 = publicDbOpClass.DataTableQuary(string.Concat(new string[]
                            {
                                "select businessclassname from wf_business_class where businesscode='",
                                this.BusinessCode,
                                "' and businessclass='",
                                this.BusinessClass,
                                "'"
                            }));
                            if (dataTable.Rows.Count > 0)
                            {
                                string text = dataTable2.Rows[0][0].ToString();
                                if (dataTable.Rows[0]["isselreceiver"].ToString() == "1")
                                {
                                    SMS    sMS  = new SMS();
                                    string mbNo = new PhoozyanHelpAction().RePhoneCode(this.hdnReceiver.Value);
                                    string msg  = string.Concat(new string[]
                                    {
                                        "公司短信:",
                                        this.txtReceiver.Text,
                                        "您好!",
                                        new CommunicationAction().BackUserName(this.UserCode),
                                        "已发起",
                                        text,
                                        "流程,请您查看审核!"
                                    });
                                    if (!(bool)sMS.Send("", mbNo, msg, "", "", "")[0])
                                    {
                                    }
                                }
                                else
                                {
                                    string arg = "";
                                    System.Collections.ArrayList arrayList  = new System.Collections.ArrayList();
                                    System.Collections.ArrayList arrayList2 = new System.Collections.ArrayList();
                                    string text2 = dataTable.Rows[0]["Operater"].ToString();
                                    if (text2.Contains(","))
                                    {
                                        string[] array2 = text2.Split(new char[]
                                        {
                                            ','
                                        });
                                        for (int i = 0; i < array2.Length - 1; i++)
                                        {
                                            new userManageDb().GetUserName(array2[i]);
                                            arrayList.Add(arrayList);
                                            string value = new PhoozyanHelpAction().RePhoneCode(array2[i]);
                                            arrayList2.Add(value);
                                        }
                                        for (int j = 0; j < arrayList.Count; j++)
                                        {
                                            if (!string.IsNullOrEmpty(arrayList2[j].ToString()))
                                            {
                                                string msg2 = string.Concat(new object[]
                                                {
                                                    "公司短信:",
                                                    arrayList[j],
                                                    "您好!",
                                                    new CommunicationAction().BackUserName(this.UserCode),
                                                    "已发起",
                                                    text,
                                                    "流程,请您查看审核!"
                                                });
                                                SMS sMS2 = new SMS();
                                                if (!(bool)sMS2.Send("", arrayList2[j].ToString(), msg2, "", "", "")[0])
                                                {
                                                    arg += arrayList[j];
                                                }
                                            }
                                            else
                                            {
                                                arg = arg + arrayList[j] + " ";
                                            }
                                        }
                                    }
                                    else
                                    {
                                        string    text3      = new CommunicationAction().BackUserName(dataTable.Rows[0][0].ToString());
                                        DataTable dataTable3 = publicDbOpClass.DataTableQuary("select mobilephonecode from pt_yhmc where v_yhdm='" + dataTable.Rows[0]["Operater"].ToString() + "'");
                                        if (dataTable3.Rows.Count > 0)
                                        {
                                            string mbNo2 = dataTable3.Rows[0][0].ToString();
                                            if (dataTable2.Rows.Count > 0)
                                            {
                                                string msg3 = string.Concat(new string[]
                                                {
                                                    "公司短信:",
                                                    text3,
                                                    "您好!",
                                                    new CommunicationAction().BackUserName(this.UserCode),
                                                    "已发起",
                                                    text,
                                                    "流程,请您查看审核!"
                                                });
                                                SMS  sMS3      = new SMS();
                                                bool arg_85F_0 = (bool)sMS3.Send("", mbNo2, msg3, "", "", "")[0];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch
                    {
                    }

                    if (!string.IsNullOrEmpty(base.Request["purl"]))
                    {
                        //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); ");
                        return;
                    }

                    stringBuilder.Append("alert('工作流程已成功启动');");
                    stringBuilder.Append(" page_close();");
                    stringBuilder.Append("window.parent.location.reload();");
                    base.RegisterScript(stringBuilder.ToString());
                    //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); ");
                    return;
                }
                else
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), "myalert", "<script type='text/javascript'>alert('请找管理员设置 " + this.ddltTemplate.SelectedItem.Text.ToString() + " 流程的负责人。')</script>", false);
                }
            }
        }
    }
Пример #9
0
 protected void ddltTemplate_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (this.ddltTemplate.SelectedValue != "-1")
     {
         this.TemplateID = System.Convert.ToInt32(this.ddltTemplate.SelectedItem.Value.ToString());
         DataTable dataTable = FlowTemplateAction.QueryOneTemplate(this.TemplateID);
         string    text      = dataTable.Rows[0]["Remark"].ToString();
         if (text.Length > 30)
         {
             this.lbltishi.Text    = text.Substring(0, 30) + "...";
             this.lbltishi.ToolTip = text;
         }
         else
         {
             this.lbltishi.Text = text;
         }
         if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID))
         {
             this.txtReceiver.Enabled          = true;
             this.txtReceiver.Text             = "";
             this.IBPick.Attributes["onclick"] = "return pickPerson();";
             this.IBPick.Attributes["Style"]   = "cursor: hand";
             DataTable dataTable2 = FlowTemplateAction.QueryOffsetNodeFirst("0", this.TemplateID);
             this.Type.Value = dataTable2.Rows[0]["AuditorType"].ToString();
             if (this.Type.Value == "2")
             {
                 this.Message.Visible = true;
                 this.lblMessage.Text = "此节点类型为多人";
             }
             else
             {
                 this.Message.Visible = false;
             }
             DataTable fistDt = FlowAuditAction.GetFistDt(this.TemplateID);
             if (fistDt.Rows.Count > 0)
             {
                 this.hfldNextAuditDepCode.Value = fistDt.Rows[0]["DepCode"].ToString();
             }
         }
         else
         {
             this.Message.Visible = false;
             this.IBPick.Attributes["onclick"] = "return false";
             this.IBPick.Attributes["Style"]   = "cursor: default";
             this.txtReceiver.Enabled          = false;
             DataTable fistDt2 = FlowAuditAction.GetFistDt(this.TemplateID);
             if (fistDt2.Rows.Count != 0)
             {
                 if (fistDt2.Rows[0][3].ToString() != "1")
                 {
                     string text2 = fistDt2.Rows[0][2].ToString();
                     if (fistDt2.Rows[0][1].ToString() == "2" || fistDt2.Rows[0][1].ToString() == "1")
                     {
                         if (!FlowAuditAction.GetUsersis(text2))
                         {
                             this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "top.ui.alert('此审核流程中的接收人在系统中已离职或不存在,请重新选择流程模板');", true);
                             this.ddltTemplate.SelectedValue = "-1";
                             return;
                         }
                         this.txtReceiver.Text = FlowAuditAction.GetUsers(text2);
                     }
                     else
                     {
                         if (fistDt2.Rows[0][1].ToString() == "3" || fistDt2.Rows[0][1].ToString() == "4" || fistDt2.Rows[0][1].ToString() == "5")
                         {
                             DataTable role = FlowAuditAction.GetRole(text2);
                             this.txtReceiver.Text = role.Rows[0][0].ToString();
                         }
                     }
                 }
                 else
                 {
                     this.txtReceiver.Text = "";
                 }
             }
             if (this.TemplateID == -1)
             {
                 this.txtReceiver.Text  = "";
                 this.hdnReceiver.Value = "";
             }
         }
         FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID);
         return;
     }
     this.txtReceiver.Text             = "";
     this.hdnReceiver.Value            = "";
     this.lblMessage.Text              = "";
     this.lbltishi.Text                = "";
     this.IBPick.Attributes["onclick"] = "";
 }
Пример #10
0
    protected void CreateTemplateInfo()
    {
        DataTable dataSource = FlowTemplateAction.QueryTempByClass(this.BusinessClass, this.BusinessCode, this.UserCode);

        this.ddltTemplate.Items.Clear();
        this.ddltTemplate.DataSource     = dataSource;
        this.ddltTemplate.DataTextField  = "TemplateName";
        this.ddltTemplate.DataValueField = "TemplateID";
        this.ddltTemplate.DataBind();
        ListItem listItem = new ListItem("---请选择流程模板---", "-1");

        listItem.Selected = true;
        this.ddltTemplate.Items.Insert(0, listItem);
        if (!string.IsNullOrEmpty(base.Request["templateid"]))
        {
            this.TemplateID                 = System.Convert.ToInt32(base.Request["templateid"]);
            this.hdnTemplateID.Value        = base.Request["templateid"];
            this.ddltTemplate.Enabled       = false;
            this.ddltTemplate.SelectedValue = base.Request["templateid"];
            FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID);
            if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID))
            {
                this.txtReceiver.Enabled          = true;
                this.IBPick.Attributes["onclick"] = "return pickPerson();";
                this.IBPick.Attributes["Style"]   = "cursor: hand";
                DataTable dataTable = FlowTemplateAction.QueryOffsetNodeFirst("0", this.TemplateID);
                this.Type.Value = dataTable.Rows[0]["AuditorType"].ToString();
                if (this.Type.Value == "2")
                {
                    this.Message.Visible = true;
                    this.lblMessage.Text = "此节点类型为多人,必须选择多个人";
                }
                else
                {
                    this.Message.Visible = false;
                }
                this.hfldNextAuditDepCode.Value = dataTable.Rows[0]["DepCode"].ToString();
                return;
            }
            this.Message.Visible = false;
            DataTable fistDt = FlowAuditAction.GetFistDt(this.TemplateID);
            if (fistDt.Rows.Count > 0)
            {
                if (fistDt.Rows[0][3].ToString() != "1")
                {
                    string text = fistDt.Rows[0][2].ToString();
                    if (fistDt.Rows[0][1].ToString() == "2" || fistDt.Rows[0][1].ToString() == "1")
                    {
                        this.txtReceiver.Text = FlowAuditAction.GetUsers(text);
                    }
                    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);
                            this.txtReceiver.Text = role.Rows[0][0].ToString();
                        }
                    }
                    this.txtReceiver.Enabled = false;
                }
                else
                {
                    this.txtReceiver.Text = "";
                }
            }
            this.IBPick.Attributes["onclick"] = "return false";
            this.IBPick.Attributes["Style"]   = "cursor: default";
            if (this.TemplateID == -1)
            {
                this.txtReceiver.Text  = "";
                this.hdnReceiver.Value = "";
            }
        }
    }