protected void btnSend_Click(object sender, EventArgs e) { if (((DataTable)ViewState["result"]).Rows.Count < 1) { tdErrorMessage.InnerText = GetGlobalResourceObject("WebGlobalResource", "WkMustSelectOneTache").ToString();//至少要选择一个发送的环节! return; } string sReceive = ""; bool bCreated = false; int iWorkFlowNo = Convert.ToInt32(ViewState["CurWorkFlowNo"]); DataTable result = (DataTable)ViewState["result"]; for (int i = 0; i < result.Rows.Count; i++) { if (result.Rows[i]["CJRY"] != null && result.Rows[i]["CJRY"].ToString().Trim() != "") { sReceive = result.Rows[i]["CJRY"].ToString(); } iWorkFlowNo = Convert.ToInt32(ViewState["CurWorkFlowNo"]); bCreated = WebWorkFlow.CreateFlow(Convert.ToInt32(ViewState["PackNo"]), ref iWorkFlowNo, Session["MemberName"].ToString(), Convert.ToInt32(result.Rows[i]["FlowID"]), sReceive, result.Rows[i]["FZR"].ToString(), txtMessage.Text, ViewState["RecNo"].ToString()); if (!bCreated) { tdErrorMessage.InnerText = "发送到环节:" + result.Rows[i]["FlowName"].ToString() + " 出错!"; return; } sReceive = ""; //统计实际工作时间 WebWorkFlow.StatisicFactuslTimes(ViewState["PackTypeNo"].ToString(), ViewState["CurLinkNo"].ToString(), ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), ViewState["TableName"].ToString(), ViewState["RecNo"].ToString()); } Session["sended"] = 1; ViewState["CurWorkFlowNo"] = iWorkFlowNo; Response.Write(webfun.CloseWin("refreshPage")); }
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 = ""; //发送前条件判断 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; } 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()); //更新状态失败! } } }