/// <summary> /// 重启工作流,不需要传gridview控件 /// </summary> /// <param name="wfaID">工作流实例主键ID</param> /// <param name="loginID">登录账号</param> ///<param name="wftID">工作流模板ID</param> public void RestartWorkFlow(string wfaID, string loginID, string wftID) { // string loginID = CommonFuns.NewInstance.LoginInfo.LoginID; //登录账号 WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService <WFTemplatesStepService>().GetWFappByWFID(wfaID); if (wfaID != null) { if (!t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.Return.ToString())) { MessageBox.Show("该流程状态不为Return,不能重新发起,目前状态为:" + "\n" + t_wfapp.STATUS.ToString(), "确认", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; } if (loginID == t_wfapp.CREATEUSER) { //t_wfapp.STATUS = DataType.WFDetailSTATUS.Activated.ToString(); } else { MessageBox.Show("工作流只有发起人才可以重新启动!,本工作流的发起人为:" + "\n" + t_wfapp.CREATEUSER, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { MessageBox.Show("获取工作流实例信息失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { //t_wfapp.Update(); HYPDM.WinUI.WorkFlow.Flow.StandardFlow flow = new Flow.StandardFlow(wftID, wfaID); // new StandardFlow(this.dgv_ProRecord.CurrentRow.Cells["WFT_ID"].Value.ToString(), dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString()); flow.ShowDialog(); //MessageBox.Show("工作流重启成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show("更新状态失败,异常信息:" + "\n" + ex.Message.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
/// <summary> /// 重启工作流,不需要传gridview控件 /// </summary> /// <param name="wfaID">工作流实例主键ID</param> /// <param name="loginID">登录账号</param> ///<param name="wftID">工作流模板ID</param> public void RestartWorkFlow(string wfaID, string loginID, string wftID) { // string loginID = CommonFuns.NewInstance.LoginInfo.LoginID; //登录账号 WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService<WFTemplatesStepService>().GetWFappByWFID(wfaID); if (wfaID != null) { if (!t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.Return.ToString())) { MessageBox.Show("该流程状态不为Return,不能重新发起,目前状态为:" + "\n" + t_wfapp.STATUS.ToString(), "确认", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; } if (loginID == t_wfapp.CREATEUSER) { //t_wfapp.STATUS = DataType.WFDetailSTATUS.Activated.ToString(); } else { MessageBox.Show("工作流只有发起人才可以重新启动!,本工作流的发起人为:" + "\n" + t_wfapp.CREATEUSER, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { MessageBox.Show("获取工作流实例信息失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { //t_wfapp.Update(); HYPDM.WinUI.WorkFlow.Flow.StandardFlow flow = new Flow.StandardFlow(wftID, wfaID); // new StandardFlow(this.dgv_ProRecord.CurrentRow.Cells["WFT_ID"].Value.ToString(), dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString()); flow.ShowDialog(); //MessageBox.Show("工作流重启成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show("更新状态失败,异常信息:" + "\n" + ex.Message.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
/// <summary> /// 重启工作流,直接传如grid,wfappid为dgv.CurrentRow.Cells["WFA_ID"].Value.ToString() /// </summary> /// <param name="dgv"></param> public void RestartWorkFlow(DataGridView dgv) { //dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString(), LoginInfo.LoginID if (dgv.CurrentRow == null) { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (dgv.RowCount <= 0) { // MessageBox.Show("请选择一条记录"); MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int rowIndex = dgv.CurrentCell.RowIndex; if (rowIndex < 0) { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } // string status = dgv.CurrentRow.Cells["STATUS"].Value.ToString(); //if (!status.Equals(DataType.WFDetailSTATUS.Return.ToString())) //{ // MessageBox.Show("该流程已经启动", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; //} //WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService<WFTemplatesStepService>().GetWFappByWFID(dgv.CurrentRow.Cells["WFA_ID"].Value.ToString()); string wfaID = dgv.CurrentRow.Cells["WFA_ID"].Value.ToString(); string loginID = CommonFuns.NewInstance.LoginInfo.LoginID; //登录账号 WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService<WFTemplatesStepService>().GetWFappByWFID(wfaID);//工作流实例ID if (wfaID != null) { if (!t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.Return.ToString()) && !t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.UNActivate.ToString())) { MessageBox.Show("该流程状态不为Return/UNActivate,不能重新发起,目前状态为:" + "\n" + t_wfapp.STATUS.ToString(), "确认", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; } if (loginID == t_wfapp.CREATEUSER) { // t_wfapp.STATUS = DataType.WFDetailSTATUS.Activated.ToString(); } else { MessageBox.Show("工作流只有发起人才可以重新启动!,本工作流的发起人为:" + "\n" + t_wfapp.CREATEUSER, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { MessageBox.Show("获取工作流实例信息失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { // t_wfapp.Update(); //t_wfapp.Update(); string wftID= dgv.CurrentRow.Cells["WFT_ID"].Value.ToString(); //模板ID HYPDM.WinUI.WorkFlow.Flow.StandardFlow flow = new Flow.StandardFlow(wftID, wfaID); // new StandardFlow(this.dgv_ProRecord.CurrentRow.Cells["WFT_ID"].Value.ToString(), dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString()); flow.ShowDialog(); // MessageBox.Show("工作流重启成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show("更新状态失败,异常信息:" + "\n" + ex.Message.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
/// <summary> /// 重启工作流,直接传如grid,wfappid为dgv.CurrentRow.Cells["WFA_ID"].Value.ToString() /// </summary> /// <param name="dgv"></param> public void RestartWorkFlow(DataGridView dgv) { //dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString(), LoginInfo.LoginID if (dgv.CurrentRow == null) { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (dgv.RowCount <= 0) { // MessageBox.Show("请选择一条记录"); MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int rowIndex = dgv.CurrentCell.RowIndex; if (rowIndex < 0) { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } // string status = dgv.CurrentRow.Cells["STATUS"].Value.ToString(); //if (!status.Equals(DataType.WFDetailSTATUS.Return.ToString())) //{ // MessageBox.Show("该流程已经启动", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; //} //WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService<WFTemplatesStepService>().GetWFappByWFID(dgv.CurrentRow.Cells["WFA_ID"].Value.ToString()); string wfaID = dgv.CurrentRow.Cells["WFA_ID"].Value.ToString(); string loginID = CommonFuns.NewInstance.LoginInfo.LoginID; //登录账号 WF_APP t_wfapp = EAS.Services.ServiceContainer.GetService <WFTemplatesStepService>().GetWFappByWFID(wfaID); //工作流实例ID if (wfaID != null) { if (!t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.Return.ToString()) && !t_wfapp.STATUS.Equals(DataType.WFDetailSTATUS.UNActivate.ToString())) { MessageBox.Show("该流程状态不为Return/UNActivate,不能重新发起,目前状态为:" + "\n" + t_wfapp.STATUS.ToString(), "确认", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); return; } if (loginID == t_wfapp.CREATEUSER) { // t_wfapp.STATUS = DataType.WFDetailSTATUS.Activated.ToString(); } else { MessageBox.Show("工作流只有发起人才可以重新启动!,本工作流的发起人为:" + "\n" + t_wfapp.CREATEUSER, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { MessageBox.Show("获取工作流实例信息失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { // t_wfapp.Update(); //t_wfapp.Update(); string wftID = dgv.CurrentRow.Cells["WFT_ID"].Value.ToString(); //模板ID HYPDM.WinUI.WorkFlow.Flow.StandardFlow flow = new Flow.StandardFlow(wftID, wfaID); // new StandardFlow(this.dgv_ProRecord.CurrentRow.Cells["WFT_ID"].Value.ToString(), dgv_ProRecord.CurrentRow.Cells["WFA_ID"].Value.ToString()); flow.ShowDialog(); // MessageBox.Show("工作流重启成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show("更新状态失败,异常信息:" + "\n" + ex.Message.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }