예제 #1
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_APP_HANDLE> GetWFAppStepHandle(string wfappID, string wftStepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            IList <WF_APP_HANDLE>   list       = _wfService.GetWFAppStepHandle(wfappID, wftStepID);

            return(list);
        }
예제 #2
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        /// <summary>
        ///
        /// </summary>
        /// <param name="wftID"></param>
        /// <returns></returns>
        public IList <WF_TEMPLATES_STEP> GetWFStepListByWFID(string wftID)
        {
            IWFTemplatesStepService   _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            IList <WF_TEMPLATES_STEP> list       = _wfService.GetWFStepListByWFID(wftID);

            return(list);
        }
예제 #3
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_TEMPLATES GetWFTemplatesInfoByWFID(string wftID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            WF_TEMPLATES            wf         = _wfService.GetWFTemplatesInfoByWFID(wftID);

            return(wf);
        }
예제 #4
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_TEMPLATES_STEP> GetGreaterWFStepListByStepID(string stepID, string wftID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            DataTable                 dtTemp   = _wfService.GetGreaterWFStepListByStepID(stepID, wftID);
            WF_TEMPLATES_STEP         step     = null;
            IList <WF_TEMPLATES_STEP> List     = new List <WF_TEMPLATES_STEP>();

            foreach (DataRow dr in dtTemp.Rows)
            {
                step = new WF_TEMPLATES_STEP();
                step.WFT_CURRENT_STEP_ID = dr["WFT_CURRENT_STEP_ID"].ToString();
                step.WFT_STEP_ID         = dr["WFT_STEP_ID"].ToString();
                step.WFT_ID                    = dr["WFT_ID"].ToString();
                step.WFT_STEP_DESC             = dr["WFT_STEP_DESC"].ToString();
                step.WFT_CURRENT_STEP_USERTYPE = dr["WFT_CURRENT_STEP_USERTYPE"].ToString();
                step.WFT_CURRENT_STEP_USERID   = dr["WFT_CURRENT_STEP_USERID"].ToString();
                step.CREATEDATE                = dr["CREATEDATE"].ToString();
                step.CREATEUSER                = dr["CREATEUSER"].ToString();
                step.LASTUPDATEDATE            = dr["LASTUPDATEDATE"].ToString();
                step.LASTUPDATEUSER            = dr["LASTUPDATEUSER"].ToString();
                step.IS_ALLOW_DELETE           = dr["IS_ALLOW_DELETE"].ToString();
                step.IS_ALLOW_EDIT             = dr["IS_ALLOW_EDIT"].ToString();
                step.IS_END_STEP               = dr["IS_END_STEP"].ToString();
                step.IS_NOTE_STARTUSER         = dr["IS_NOTE_STARTUSER"].ToString();
                step.IS_START_STEP             = dr["IS_START_STEP"].ToString();
                List.Add(step);
            }
            return(List);
        }
예제 #5
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        /// <summary>
        ///
        /// </summary>
        /// <param name="stepID"></param>
        /// <returns></returns>
        public WF_TEMPLATES_STEP GetWFStepInfoByStepID(string stepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            WF_TEMPLATES_STEP       step       = _wfService.GetWFStepInfoByStepID(stepID);

            return(step);
        }
예제 #6
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_APP_USER> GetWFAppStepUser(string wfappID, string wftStepID)
        {
            DataEntityQuery <WF_APP_USER> query = DataEntityQuery <WF_APP_USER> .Create();

            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            IList <WF_APP_USER>     list       = _wfService.GetWFAppStepUser(wfappID, wftStepID);

            return(list);
        }
예제 #7
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public void CreateWF(string wftID, System.Windows.Forms.Control ctl)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            //IList<WF_TEMPLATES_STEP> list = _wfService.GetWFStepListByWFID(wftID);
            IList <WF_TEMPLATES_STEP> list = this.GetWFStepListByWFID(wftID);
            int x = 41;
            int y = 21;

            if (list == null || list.Count == 0)
            {
            }
            else
            {
                Panel pnl = null;
                foreach (WF_TEMPLATES_STEP step in list)
                {
                    Button btnStep = new Button();
                    btnStep.BackColor = System.Drawing.SystemColors.InactiveBorder;
                    btnStep.FlatAppearance.BorderColor        = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
                    btnStep.FlatAppearance.BorderSize         = 5;
                    btnStep.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Yellow;
                    btnStep.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
                    btnStep.Location  = new System.Drawing.Point(x, y);
                    btnStep.Name      = step.WFT_STEP_ID;
                    btnStep.Size      = new System.Drawing.Size(200, 50);
                    btnStep.TabIndex  = 0;
                    if (step.IS_START_STEP == "Y")
                    {
                        btnStep.Text = "(Start)" + _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT;
                    }
                    else if (step.IS_END_STEP == "Y")
                    {
                        btnStep.Text = "(END)" + _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT;
                    }
                    else
                    {
                        btnStep.Text = _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT;
                    }
                    pnl                             = new Panel();
                    pnl.BackColor                   = System.Drawing.Color.Transparent;
                    pnl.BackgroundImage             = global::HYPDM.WinUI.Properties.Resources.line;
                    pnl.Location                    = new System.Drawing.Point(80 + x, y + 45);
                    pnl.Name                        = "pnl";
                    pnl.Size                        = new System.Drawing.Size(32, 30);
                    pnl.TabIndex                    = 0;
                    btnStep.UseVisualStyleBackColor = false;
                    ctl.Controls.Add(btnStep);
                    ctl.Controls.Add(pnl);
                    y += 55 + 22;
                }
                ctl.Controls.Remove(pnl);
            }
            //this.btnTest.BackColor = System.Drawing.SystemColors.InactiveBorder;
            //this.btnTest.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
            //this.btnTest.FlatAppearance.BorderSize = 5;
            //this.btnTest.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Yellow;
            //this.btnTest.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            //this.btnTest.Location = new System.Drawing.Point(41, 21);
            //this.btnTest.Name = "btnTest";
            //this.btnTest.Size = new System.Drawing.Size(326, 50);
            //this.btnTest.TabIndex = 0;
            //this.btnTest.Text = "测试";
            //this.btnTest.UseVisualStyleBackColor = false;
        }
예제 #8
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_DETAIL> GetWfDetailList(string wfaID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWfDetailList(wfaID));
        }
예제 #9
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_TEMPLATES_OBJECT GetWfTemplatesObject(string objectValue)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWfTemplatesObject(objectValue));
        }
예제 #10
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        /// <summary>
        /// 获取工作节点的名称如审批、拟制等信息
        /// </summary>
        /// <param name="wftCurrentStepID"></param>
        /// <returns></returns>
        public ComboBoxValue GetWFStep(string wftCurrentStepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWFStep(wftCurrentStepID));
        }
예제 #11
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_TEMPLATES_STEP GetStepInfoByWftIDAndCurrentStepID(string wftID, string CurrentStepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetStepInfoByWftIDAndCurrentStepID(wftID, CurrentStepID));
        }
예제 #12
0
        private void CreateWF(IList <HYPDM.Entities.WF_TEMPLATES_STEP> list, System.Windows.Forms.Control ctl)
        {
            int x = 5;
            int y = 18;

            if (list == null || list.Count == 0)
            {
                MessageBox.Show("该工作流【" + flowName + "】不没有设置任何节点", "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                return;
            }
            else
            {
                IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
                Panel pnl = null;  //放箭头
                foreach (WF_TEMPLATES_STEP step in list)
                {
                    Button btnStep = new Button();

                    btnStep.BackgroundImage       = global::HYPDM.WinUI.Properties.Resources.banner;
                    btnStep.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
                    // btnStep.Location = new System.Drawing.Point(5, 18);
                    btnStep.Location = new System.Drawing.Point(x, y);
                    // btnStep.Name = "btnName";
                    btnStep.Size = new System.Drawing.Size(113, 161);
                    // btnStep.TabIndex = 0;
                    // btnStep.Text = "btnText";
                    btnStep.UseVisualStyleBackColor = true;
                    btnStep.Tag       = step; //节点信息放在button的tag中
                    btnStep.BackColor = System.Drawing.SystemColors.InactiveBorder;
                    // btnStep.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
                    // btnStep.FlatAppearance.BorderSize = 5;
                    // btnStep.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Yellow;
                    //  btnStep.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
                    //  btnStep.Location = new System.Drawing.Point(x, y);
                    btnStep.Name = step.WFT_STEP_ID;
                    // btnStep.Size = new System.Drawing.Size(200, 50);
                    // btnStep.TabIndex = 0;
                    string strUser = getCurrentStepHandle(WfAppID, step.WFT_STEP_ID);
                    if (step.IS_START_STEP == "Y")
                    {
                        btnStep.Text = "(Start)" + _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT + "\n" + "发起人:【" + CommonFuns.NewInstance.LoginInfo.LoginID + "】";
                    }
                    else if (step.IS_END_STEP == "Y")
                    {
                        btnStep.Text = "(END)" + _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT + strUser;
                    }
                    else
                    {
                        btnStep.Text = "当前步骤:" + _wfService.GetWFStep(step.WFT_CURRENT_STEP_ID).COMBTEXT + strUser;
                    }
                    btnStep.TextAlign = ContentAlignment.MiddleLeft;
                    pnl                             = new Panel();
                    pnl.BackColor                   = System.Drawing.Color.Transparent;
                    pnl.BackgroundImage             = global::HYPDM.WinUI.Properties.Resources.line2;
                    pnl.Location                    = new System.Drawing.Point(113 + x, (161 / 2 + 18));
                    pnl.Name                        = "pnl";
                    pnl.Size                        = new System.Drawing.Size(32, 30);
                    pnl.TabIndex                    = 0;
                    btnStep.UseVisualStyleBackColor = false;
                    ctl.Controls.Add(btnStep);
                    ctl.Controls.Add(pnl);
                    x += 113 + 32;
                }
                ctl.Controls.Remove(pnl);
            }
        }
예제 #13
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        /// <summary>
        /// 根据工作流实例APPID与目前工作节点获取WF_APP_HANDLE信息集合
        /// </summary>
        /// <param name="wfaID"></param>
        /// <param name="CurrentStepID"></param>
        /// <returns></returns>
        public IList <WF_APP_HANDLE> GetWfAppStepHandleList(string wfaID, string CurrentStepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWfAppStepHandleList(wfaID, CurrentStepID));
        }
예제 #14
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_APP GetWFappByWFID(string wfappID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWFappByWFID(wfappID));
        }
예제 #15
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_TEMPLATES_STEP GetWFEndStepByWFID(string wftID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWFEndStepByWFID(wftID));
        }
예제 #16
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_APP_HANDLE> GetAllHandleList(string wfaID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetAllHandleList(wfaID));
        }
예제 #17
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public IList <WF_APP_USER> GetAllUserList(string wfaID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetAllUserList(wfaID));
        }
예제 #18
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        /// <summary>
        /// 根据工作流实例APPID与目前工作节点、用户ID获取WF_APP_HANDLE信息
        /// </summary>
        /// <param name="wfaID"></param>
        /// <param name="CurrentStepID"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public WF_APP_HANDLE GetWfAppHandleItem(string wfaID, string CurrentStepID, string userID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetWfAppHandleItem(wfaID, CurrentStepID, userID));
        }
예제 #19
0
        private void tspStart_Click(object sender, EventArgs e)
        {
            ///判定每个节点是否选择了签批用户
            ///步骤:1.找到该工作流实例对应工作模板中的所有节点,在handle表中判定是否有对应签批用户信息,有的话进行下一步check,否则提示直接返回

            StringBuilder stbMain = new StringBuilder();

            stbMain.Append(" ComboBoxValue  WHERE COMBVALUE IN( ");
            stbMain.Append(" SELECT WFT_CURRENT_STEP_ID  FROM WF_TEMPLATES_STEP ");
            stbMain.AppendFormat(" WHERE  WFT_ID='{0}' ", this.WfTemplatesID);
            stbMain.Append(" AND DEL_FLAG='N' AND  WFT_CURRENT_STEP_ID NOT  IN  (SELECT Current_STEP_ID  FROM WF_APP_HANDLE ");
            stbMain.AppendFormat(" WHERE  WFA_ID='{0}' AND DEL_FLAG='N'))", this.WfAppID);

            DataTable dt = CommonFuns.getDataTableBySql(" COMBID,COMBTEXT", "", stbMain.ToString());

            if (dt == null || dt.Rows.Count == 0)
            {
                //说明每个节点都设定了签批人员
            }
            else
            {
                StringBuilder stb = new StringBuilder("以下步骤:");
                foreach (DataRow dr in dt.Rows)
                {
                    stb.Append("【" + dr["COMBTEXT"].ToString() + "】");
                }
                stb.Append(",没有设定签批人员,请设定完毕后再进行工作流的启用动作!");
                MessageBox.Show(stb.ToString(), "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                return;
            }

            string contentMsg;
            string nowDate = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string loginID = CommonFuns.NewInstance.LoginInfo.LoginID;
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();
            WF_APP         app      = WorkFlow.NewInstance.GetWFappByWFID(this.WfAppID);
            FlowStepHandle flowstep = new FlowStepHandle();

            if (flowstep.ShowDialog() == DialogResult.OK)
            {
                contentMsg = flowstep.ContentMsg;
                if (app == null)
                {
                    MessageBox.Show("获取流程实例异常", "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                    return;
                }
                else
                {
                    if (app.STATUS == DataType.WFDetailSTATUS.Activated.ToString())
                    {
                        MessageBox.Show("当前工作流已经启用,无需再一次启用!", "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                        return;
                    }
                    else
                    {
                        app.LASTUPDATEUSER = loginID;
                        app.LASTUPDATEDATE = nowDate;
                        app.START_DATE     = nowDate;
                        app.STATUS         = DataType.WFDetailSTATUS.Activated.ToString();
                        try
                        {
                            app.Update();

                            this.txtStatus.Text = "已激活";

                            ///新增拟制节点完成信息
                            WF_DETAIL         detail = new HYPDM.Entities.WF_DETAIL();
                            WF_TEMPLATES_STEP step   = WorkFlow.NewInstance.GetWFStartStepByWFID(app.WFT_ID);
                            detail.Current_STEP_ID = step.WFT_CURRENT_STEP_ID;
                            // detail.CURRENT_STEP_NAME = _wfService.GetWFStep(WorkFlow.NewInstance.GetWFStepInfoByStepID(detail.CURRENT_STEP_ID).WFT_CURRENT_STEP_ID).COMBTEXT;

                            detail.MSG            = contentMsg;
                            detail.DEL_FLAG       = "N";
                            detail.IS_Through     = "Y";
                            detail.COMPLEMENTDATE = nowDate;
                            detail.RECIVEDATE     = nowDate;
                            detail.WFD_ID         = Guid.NewGuid().ToString();
                            detail.WFA_ID         = app.WFA_ID;
                            detail.WFT_STEP_ID    = step.WFT_STEP_ID;
                            try
                            {
                                detail.Save();

                                ///新增WF_DETAIL记录,指向下一工作流信息
                                // wfah.Current_STEP_ID = WorkFlow.NewInstance.GetWFStepInfoByStepID(wftStepID).WFT_CURRENT_STEP_ID;
                                WF_DETAIL detailNew = new HYPDM.Entities.WF_DETAIL();
                                detailNew.Current_STEP_ID = WorkFlow.NewInstance.GetWFStartStepByWFID(app.WFT_ID).WFT_NEXT_STEP_ID;
                                //_wfService.GetWFStep(detailNew.Current_STEP_ID).COMBTEXT;
                                // WorkFlow.NewInstance.GetWFStepInfoByStepID(detail.Current_STEP_ID).WFT_NEXT_STEP_ID;
                                // detailNew.CURRENT_STEP_NAME = _wfService.GetWFStep(detailNew.CURRENT_STEP_ID).COMBTEXT;
                                detailNew.MSG = "";
                                //  detailNew.Current_STEP_ID = WorkFlow.NewInstance.GetWFStepInfoByStepID(wftStepID).WFT_CURRENT_STEP_ID;
                                detailNew.IS_Through     = "";
                                detailNew.DEL_FLAG       = "N";
                                detailNew.COMPLEMENTDATE = "";
                                detailNew.RECIVEDATE     = detail.COMPLEMENTDATE;
                                detailNew.WFD_ID         = Guid.NewGuid().ToString();
                                detailNew.WFA_ID         = detail.WFA_ID;
                                detailNew.WFT_STEP_ID    = WorkFlow.NewInstance.GetWftStepIDByStepIDAndAppID(detailNew.WFA_ID, detailNew.Current_STEP_ID);
                                detailNew.Save();


                                ///更新表WF_APP_HANDLE
                                WF_APP_HANDLE item = WorkFlow.NewInstance.GetWfAppHandleItem(detail.WFA_ID, detail.Current_STEP_ID, loginID);
                                item.DEL_FLAG       = "N";
                                item.LASTUPDATEDATE = nowDate;
                                item.LASTUPDATEUSER = loginID;
                                item.IS_THROUGH     = "Y";
                                item.MSG            = contentMsg;
                                item.Update();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("信息存储异常,错误信息如下:" + "\n" + ex.Message.ToString(), "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                                return;
                            }

                            MessageBox.Show("当前工作流启用成功!", "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                            this.tspStart.Enabled     = false;
                            this.btnModify.Enabled    = false;
                            this.txtSubject.ReadOnly  = true;
                            this.btnSubmit.Enabled    = false;
                            this.gpFlowDetail.Enabled = false;
                            this.tspDelete.Enabled    = false;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("当前工作流启用失败,错误信息如下:" + "\n" + ex.Message.ToString(), "工作流实例建立向导提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                            return;
                        }
                    }
                }
            }
        }
예제 #20
0
파일: WorkFlow.cs 프로젝트: leedaga/HYPDM
        public WF_DETAIL GetDetailByWFAppidAndStepID(string wfaID, string CurrentStepID)
        {
            IWFTemplatesStepService _wfService = ServiceContainer.GetService <WFTemplatesStepService>();

            return(_wfService.GetDetailByWFAppidAndStepID(wfaID, CurrentStepID));
        }