protected void btnSend_Click(object sender, EventArgs e) { //提交前先保存 btnSave_Click(null, null); if (tdMessage.InnerText != "") { return; } string returnString = ""; //发送前条件判断 returnString = WebWorkFlow.TacheSendCondition(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); if (returnString.Length > 0) { JScript.Alert(returnString); tdMessage.InnerText = returnString; return; } string sMainer = ""; object obj; obj = DBOpt.dbHelper.ExecuteScalar("select F_RECEIVER from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]); if (obj != null) { sMainer = obj.ToString(); } if (sMainer == Session["MemberName"].ToString()) //主办人发送 { int iCat = -1; obj = DBOpt.dbHelper.ExecuteScalar("SELECT F_FLOWCAT FROM DMIS_SYS_FLOWLINK WHERE F_NO=" + ViewState["CurLinkNo"]); if (obj != null) { iCat = Convert.ToInt16(obj); } if (iCat == 2) { int iFno = WebWorkFlow.EndFlow(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString()); if (iFno == -1) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkFinishFailMessage").ToString());//此业务归档失败,请联系统管理员! return; } else { //JScript.Alert("此业务归档成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } } else { string paras; //发送岗位时,派工环节,弹出发送窗口 if (WebWorkFlow.IsAssignTache(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["CurLinkNo"]))) { paras = "PackTypeNo=" + ViewState["PackTypeNo"] + "&CurLinkNo=" + ViewState["CurLinkNo"] + "&PackNo=" + ViewState["PackNo"] + "&CurWorkFlowNo=" + ViewState["CurWorkFlowNo"] + "&TableName=" + ViewState["TableName"].ToString() + "&RecNo=" + ViewState["RecNo"].ToString(); Session["sended"] = 0; JScript.OpenWindow("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=670,height=500,top=20,left=100"); //Response.Write(webfun.OpenWin("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=700,height=480,top=20,left=100")); } else //非派工环节,直接发送即可 { int curTaskID = Convert.ToInt16(ViewState["CurWorkFlowNo"]); if (WebWorkFlow.DirectCreateFlow(Convert.ToInt16(ViewState["PackNo"]), ref curTaskID, Session["MemberName"].ToString())) { //两种统计时间的方法,看用户用何种 //1、根据工作流的相关表DMIS_SYS_WORKFLOW DMIS_SYS_MEMBERSTATUS来统计实际工作时间 //WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), // ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); //2、根据业务表保存的人名来统计实际工作时间 string[] members = new string[4]; if (!txtXT_JDR.ReadOnly) //统计系统人员工作时间 { members[0] = txtXT_JDR.Text; members[1] = txtXT_JDR2.Text; members[2] = txtXT_JDR3.Text; members[3] = txtXT_JDR4.Text; WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["PackNo"].ToString(), "24", ViewState["TableName"].ToString(), ViewState["RecNo"].ToString(), "否", members); } else if (!txtYD_JDR.ReadOnly) //统计远动人员工作时间 { members[0] = txtYD_JDR.Text; members[1] = txtYD_JDR2.Text; members[2] = txtYD_JDR3.Text; members[3] = txtYD_JDR4.Text; WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["PackNo"].ToString(), "25", ViewState["TableName"].ToString(), ViewState["RecNo"].ToString(), "是", members); } Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString());//"此任务发送失败,请联系统管理员!" return; } } } } else { //从办人员提交,只是结束其办理状态 if (WebWorkFlow.EndMemberStatus(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString())) { //JScript.Alert("提交成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString()); //更新状态失败! } } }
protected void btnSend_Click(object sender, EventArgs e) { //提交前先保存 btnSave_Click(null, null); if (tdMessage.InnerText != "") { return; } string returnString = ""; object obj; //发送前判断汇集环节的所有分支是否都到达此节点 obj = DBOpt.dbHelper.ExecuteScalar("select f_nodetype from dmis_sys_flowlink where f_no=" + ViewState["CurLinkNo"].ToString()); if (obj != null && Convert.ToInt16(obj) == 2) { returnString = WebWorkFlow.InfluxTacheSendCondition(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurLinkNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"])); if (returnString.Length > 0) { JScript.Alert(returnString); tdMessage.InnerText = returnString; return; } } //发送前条件判断 returnString = WebWorkFlow.TacheSendCondition(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); if (returnString.Length > 0) { JScript.Alert(returnString); tdMessage.InnerText = returnString; return; } string sMainer = ""; obj = DBOpt.dbHelper.ExecuteScalar("select F_RECEIVER from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]); if (obj != null) { sMainer = obj.ToString(); } if (sMainer == Session["MemberName"].ToString()) { int iCat = -1; obj = DBOpt.dbHelper.ExecuteScalar("SELECT F_FLOWCAT FROM DMIS_SYS_FLOWLINK WHERE F_NO=" + ViewState["CurLinkNo"]); if (obj != null) { iCat = Convert.ToInt16(obj); } if (iCat == 2) { int iFno = WebWorkFlow.EndFlow(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString()); if (iFno == -1) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkFinishFailMessage").ToString());//此业务归档失败,请联系统管理员! return; } //2010-04-26,出现分支节点有退回的情况时,一个任务退回到分支节点,另一任务到了验收环节, //在任务没有结束时,也可以原先的程序也可以归档,故修改WebWorkFlow.EndFlow()的代码,提示一下 //还有任务没有完成,不允许归档 else if (iFno == -2) { JScript.Alert("-2");//此业务还有未完成的任务,请在流程图中查询未完成的任务! return; } else { //JScript.Alert("此业务归档成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } } else { string paras; //发送岗位时,派工环节,弹出发送窗口 if (WebWorkFlow.IsAssignTache(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["CurLinkNo"]))) { paras = "PackTypeNo=" + ViewState["PackTypeNo"] + "&CurLinkNo=" + ViewState["CurLinkNo"] + "&PackNo=" + ViewState["PackNo"] + "&CurWorkFlowNo=" + ViewState["CurWorkFlowNo"] + "&TableName=" + ViewState["TableName"].ToString() + "&RecNo=" + ViewState["RecNo"].ToString(); Session["sended"] = 0; JScript.OpenWindow("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=700,height=500,top=20,left=100"); //Response.Write(webfun.OpenWin("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=700,height=480,top=20,left=100")); } else //非派工环节,直接发送即可 { int curTaskID = Convert.ToInt16(ViewState["CurWorkFlowNo"]); if (WebWorkFlow.DirectCreateFlow(Convert.ToInt16(ViewState["PackNo"]), ref curTaskID, Session["MemberName"].ToString())) { //统计实际工作时间 //1、根据工作流的相关表DMIS_SYS_WORKFLOW DMIS_SYS_MEMBERSTATUS来统计实际工作时间 //WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), // ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); //2、根据业务表保存的人名来统计实际工作时间 string[] members = new string[4]; members[0] = txtFZR.Text; members[1] = txtJDR1.Text; members[2] = txtJDR2.Text; members[3] = txtJDR3.Text; if (ViewState["CurLinkNo"].ToString() == "49" || ViewState["CurLinkNo"].ToString() == "50") { WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString(), "否", members); } else if (ViewState["CurLinkNo"].ToString() == "47" || ViewState["CurLinkNo"].ToString() == "48") //远动的才统计下站补助 { WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString(), "是", members); } Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString());//"此任务发送失败,请联系统管理员!" return; } } } } else { //结束从办人员的办理状态 if (WebWorkFlow.EndMemberStatus(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString())) { //JScript.Alert("提交成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString()); //更新状态失败! } } }
protected void btnSend_Click(object sender, EventArgs e) { //提交前先保存 btnSave_Click(null, null); if (tdMessage.InnerText != "") { return; } string returnString = ""; object obj; //发送前判断汇集环节的所有分支是否都到达此节点 obj = DBOpt.dbHelper.ExecuteScalar("select f_nodetype from dmis_sys_flowlink where f_no=" + ViewState["CurLinkNo"].ToString()); if (obj != null && Convert.ToInt16(obj) == 2) { returnString = WebWorkFlow.InfluxTacheSendCondition(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurLinkNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"])); if (returnString.Length > 0) { JScript.Alert(returnString); tdMessage.InnerText = returnString; return; } } //发送前条件判断 returnString = WebWorkFlow.TacheSendCondition(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); if (returnString.Length > 0) { JScript.Alert(returnString); tdMessage.InnerText = returnString; return; } string sMainer = ""; obj = DBOpt.dbHelper.ExecuteScalar("select F_RECEIVER from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]); if (obj != null) { sMainer = obj.ToString(); } if (sMainer == Session["MemberName"].ToString()) { int iCat = -1; obj = DBOpt.dbHelper.ExecuteScalar("SELECT F_FLOWCAT FROM DMIS_SYS_FLOWLINK WHERE F_NO=" + ViewState["CurLinkNo"]); if (obj != null) { iCat = Convert.ToInt16(obj); } if (iCat == 2) { int iFno = WebWorkFlow.EndFlow(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString()); if (iFno == -1) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkFinishFailMessage").ToString());//此业务归档失败,请联系统管理员! return; } else { //JScript.Alert("此业务归档成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } } else { string paras; //发送岗位时,派工环节,弹出发送窗口 if (WebWorkFlow.IsAssignTache(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["CurLinkNo"]))) { paras = "PackTypeNo=" + ViewState["PackTypeNo"] + "&CurLinkNo=" + ViewState["CurLinkNo"] + "&PackNo=" + ViewState["PackNo"] + "&CurWorkFlowNo=" + ViewState["CurWorkFlowNo"] + "&TableName=" + ViewState["TableName"].ToString() + "&RecNo=" + ViewState["RecNo"].ToString(); Session["sended"] = 0; JScript.OpenWindow("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=700,height=500,top=20,left=100"); //Response.Write(webfun.OpenWin("../SYS_WorkFlow/AssignTaskWindow.aspx?" + paras, "发送窗", "scrollbars=yes,width=700,height=480,top=20,left=100")); } else //非派工环节,直接发送即可 { int curTaskID = Convert.ToInt16(ViewState["CurWorkFlowNo"]); if (WebWorkFlow.DirectCreateFlow(Convert.ToInt16(ViewState["PackNo"]), ref curTaskID, Session["MemberName"].ToString())) { //统计实际工作时间 //1、根据工作流的相关表DMIS_SYS_WORKFLOW DMIS_SYS_MEMBERSTATUS来统计实际工作时间 WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString());//"此任务发送失败,请联系统管理员!" return; } } } } else { //结束从办人员的办理状态 if (WebWorkFlow.EndMemberStatus(Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]), Session["MemberName"].ToString())) { //JScript.Alert("提交成功!"); Response.Redirect(ViewState["BackUrl"].ToString()); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkSubmitFailMessage").ToString()); //更新状态失败! } } }