protected void grvList_RowCommand(object sender, GridViewCommandEventArgs e) { int row; if (!int.TryParse(e.CommandArgument.ToString(), out row)) { return; } object obj; int PackNo; //业务编号 int RecNo; //记录编号 int DocTypeNo; //文档类型号 int PackTypeNo; //业务类型编号 int CurLinkNo; //当前环节号 string sRight = ""; //文档权限编码 int CurWorkFlowNo; //工作流编号 dmis_sys_workflow表中的f_no值 PackNo = Convert.ToInt16(grvList.DataKeys[row].Values[0]); PackTypeNo = Convert.ToInt16(grvList.DataKeys[row].Values[2]); CurLinkNo = Convert.ToInt16(grvList.DataKeys[row].Values[1]); CurWorkFlowNo = Convert.ToInt16(grvList.DataKeys[row].Values[3]); _sql = "select f_recno from DMIS_SYS_DOC where F_PACKNO=" + PackNo + " and F_LINKNO=" + CurLinkNo; obj = DBOpt.dbHelper.ExecuteScalar(_sql); if (obj == null) { RecNo = -1; } else { RecNo = Convert.ToInt16(obj); } DataTable docType = DBOpt.dbHelper.GetDataTable("select a.f_no,a.f_formfile,a.f_tablename,a.f_target from dmis_sys_doctype a,DMIS_SYS_WK_LINK_DOCTYPE b where a.f_no=b.F_DOCTYPENO and b.f_packtypeno=" + PackTypeNo + " and b.F_LINKNO=" + CurLinkNo); if (docType == null || docType.Rows.Count < 1) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkNoDoc").ToString()); return; } DocTypeNo = Convert.ToInt16(docType.Rows[0][0]); if (e.CommandName == "FlowTable") //流程 { Session["Oper"] = 0; Session["sended"] = "0"; Response.Redirect("FlowTable.aspx?InstanceID=" + PackNo + @"&BackUrl=" + Page.Request.RawUrl); } else if (e.CommandName == "Deal") //详细 { Session["Oper"] = 0; Session["sended"] = "0"; Response.Redirect(docType.Rows[0][1].ToString() + "?RecNo=" + RecNo + @"&BackUrl=" + Page.Request.RawUrl + "&PackTypeNo=" + PackTypeNo + "&CurLinkNo=" + CurLinkNo + "&PackNo=" + PackNo + "&CurWorkFlowNo=" + CurWorkFlowNo); } else if (e.CommandName == "Retake") //抽回 { //找回自己刚完成任务时的工作流编号 dmis_sys_workflow表中的f_no值 obj = DBOpt.dbHelper.ExecuteScalar("SELECT F_PREFLOWNO FROM DMIS_SYS_WORKFLOW WHERE F_PACKNO=" + PackNo + " AND F_STATUS='1' AND F_WORKING=0 AND F_SENDER='" + Session["MemberName"] + "'"); if (obj == null) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkNoFindWorkFlow").ToString()); //无法找到工作流编号! return; } string preWorkFlowNo = Convert.ToString(obj); if (WebWorkFlow.Retake(preWorkFlowNo, Session["MemberName"].ToString())) { GridViewBind(); } else { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkFailToWithdrawTaskMessage").ToString()); //抽回任务失败,请联系管理员! return; } } }