/// <summary> /// 绑定数据 /// </summary> private void Bind() { //当前登录用户账号 string strUserName = CurrentUserInfo.UserName; //得到检索条件 M_ProcessSearch mSearchCond = GetSearchCondition(); B_ProcessInstance bCompleteFile = new B_ProcessInstance(); //得到已办文件任务列表数据总数 //外部分页 //int iStart = 0; //int iEnd = 0; //int iCount = bCompleteFile.GetTableCount(mSearchCond, gvProcessStep.PageIndex + 1, gvProcessStep.PageSize, ref iStart, ref iEnd,false); ////得到已办文件任务列表数据 //DataTable dtList = bCompleteFile.GetTableForOneProcess(mSearchCond, iStart, iEnd,false); DataTable dtList = bCompleteFile.GetTableForOneProcess(mSearchCond); this.gvProcessStep.PageType = PageType.NotPage; this.gvProcessStep.RecordCount = dtList.Rows.Count; gvProcessStep.ShowPagerRow = true; //绑定数据 this.gvProcessStep.DataSource = dtList; this.gvProcessStep.DataBind(); }
/// <summary> /// 在流程归档之后执行,写入以归档的流程表 /// </summary> /// <param name="str_ProcessID">流程ID</param> /// <param name="str_ProcessTemp">流程模板名称</param> protected void Devolved(string str_ProcessID, string str_ProcessTemp) { if (!base.IsDevolve) { B_ProcessInstance.ProcessDevolve(str_ProcessID, str_ProcessTemp); } base.IsDevolve = true; this.SetControlStatus(); }
protected void btnQuery_Click(object sender, EventArgs e) { List <EntityBase> ls = B_FormsData.GetEntities(ddlProc.Text, ddlStep.Text, DateTime.Parse(string.IsNullOrEmpty(CaleStart.Text) ? DateTime.MinValue.ToString() : CaleStart.Text), DateTime.Parse(string.IsNullOrEmpty(CaleEnd.Text) ? DateTime.MinValue.ToString() : CaleEnd.Text), true); //ls[0].ID INT //ls[0].ProcessID STR //ls[0].WorkItemID STR DataTable dt = new DataTable(); dt.Columns.Add("IsDevolved"); dt.Columns.Add("ID"); dt.Columns.Add("Title"); dt.Columns.Add("ProcessID"); dt.Columns.Add("WorkItemID"); for (int i = 0; i < ls.Count; i++) { DataRow row = dt.NewRow(); if (B_ProcessInstance.Is_Devolve(ls[i].ProcessID, ddlProc.Text).ToString().ToUpper() == "TRUE") { row["IsDevolved"] = "已归档"; } else { row["IsDevolved"] = "未归档"; } row["ID"] = ls[i].ID.ToString(); row["Title"] = ls[i].DocumentTitle; row["ProcessID"] = ls[i].ProcessID; row["WorkItemID"] = ls[i].WorkItemID; dt.Rows.Add(row); } this.FSGridView1.DataSource = dt; this.FSGridView1.DataBind(); }
/// <summary> /// 绑定数据 /// </summary> private void LoadProcessList() { //当前登录用户账号 String l_strUserName = CurrentUserInfo.UserName; //得到检索条件 M_ProcessSearch l_entityProcess = GetSearchCondition(); B_ProcessInstance l_busProcessList = new B_ProcessInstance(); l_entityProcess.Start = gvProcessList.PageIndex * gvProcessList.PageSize; l_entityProcess.End = gvProcessList.PageIndex * gvProcessList.PageSize + gvProcessList.PageSize; l_entityProcess.Sort = SortExpression; DataTable l_dtbDataTable = l_busProcessList.GetProcessList(l_entityProcess); SetEachProcessColumns(this.ddlProcessTemplate.SelectedValue); //绑定数据 this.gvProcessList.RecordCount = l_entityProcess.RowCount; this.gvProcessList.DataSource = l_dtbDataTable; this.gvProcessList.DataBind(); }
/// <summary> /// 得到检索条件数据实体 /// </summary> /// <returns>检索条件数据实体</returns> private M_ProcessSearch GetSearchCondition() { B_ProcessInstance l_busProcessList = new B_ProcessInstance(); M_ProcessSearch l_entQueryCondition = new M_ProcessSearch(); String l_strValue = String.Empty; String[] l_strAryUserRoleNames = CurrentUserInfo.RoleName.ToArray(); String[] l_strAryUserPositions = null; String[] l_strAryUserSingles = new String[] { CurrentUserInfo.DisplayName }; DataTable l_dtbPosition = CurrentUserInfo.DeptPost; DataSet l_dstDataSet = OAConfig.GetRankConfig(); String l_strAllSubDeptID = String.Empty; l_entQueryCondition.PositionName = "普通员工"; l_entQueryCondition.PositionValue = CurrentUserInfo.UserName; if (l_dtbPosition != null && l_dtbPosition.Rows.Count > 0) { l_strAryUserPositions = new String[l_dtbPosition.Rows.Count]; for (int i = 0; i < l_dtbPosition.Rows.Count; i++) { l_strAryUserPositions[i] = l_dtbPosition.Rows[i]["PostName"].ToString(); l_strValue += l_dtbPosition.Rows[i]["FK_DeptID"].ToString() + ","; } } foreach (DataTable l_dtbDataTable in l_dstDataSet.Tables) { if (l_dtbDataTable.TableName == "公司收文" || l_dtbDataTable.TableName == "函件收文" || l_dtbDataTable.TableName == "党纪工团收文") { continue; } String[] l_strAryRoleName = l_dtbDataTable.Rows[0]["角色"].ToString().Split(new char[] { ';' }); String[] l_strAryPositionName = l_dtbDataTable.Rows[0]["职位"].ToString().Split(new char[] { ';' }); String[] l_strArySingle = l_dtbDataTable.Rows[0]["人员"].ToString().Split(new char[] { ';' }); if (l_dtbDataTable.TableName == "处室权限" || l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strValue)) { DataTable l_dtbSubDept = l_busProcessList.GetAllSubDeptID(l_strValue.Substring(0, l_strValue.Length - 1)); l_strAllSubDeptID = String.Empty; if (l_dtbSubDept.Rows.Count != 0) { l_strAllSubDeptID = l_dtbSubDept.Rows[0][0].ToString().Replace("<U ID=\"", "").Replace("\"/>", ","); if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } if (l_strAryUserRoleNames != null && l_strAryUserRoleNames.Count() > 0) { IEnumerable <String> l_enumRole = l_strAryUserRoleNames.Intersect(l_strAryRoleName); if (l_enumRole.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } if (l_strAryUserPositions != null && l_strAryUserPositions.Count() > 0) { IEnumerable <String> l_enumPosition = l_strAryUserPositions.Intersect(l_strAryPositionName); if (l_enumPosition.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } IEnumerable <String> l_enumSingle = l_strAryUserSingles.Intersect(l_strArySingle); if (l_enumSingle.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } //是否备份查询 l_entQueryCondition.IsHistorySearch = this.chbHistorySearch.Checked; //流程模版名称 l_entQueryCondition.TemplateName = ddlProcessTemplate.SelectedValue; //流程实例名 l_entQueryCondition.ProcInstName = FormsMethod.Filter(txtProcInstName.Text); ////当前步骤 //l_entQueryCondition.StepName = ddlStepName.SelectedValue; //文号 l_entQueryCondition.DocumentNo = FormsMethod.Filter(txtDocumentNo.Text); //文件标题 l_entQueryCondition.DocumentTitle = FormsMethod.Filter(txtDocumentTitle.Text); //发起人 l_entQueryCondition.Initiator = FormsMethod.Filter(txtSponsor.Text); //发起日期-开始 l_entQueryCondition.StartTime = txtStartDate.ValDate; //发起日期-结束 l_entQueryCondition.EndTime = txtEndDate.ValDate; //状态 l_entQueryCondition.Status = ddlProcessStatus.SelectedValue; //接受人 l_entQueryCondition.ReceiveUser = FormsMethod.Filter(this.txtChuLiRen.Text); switch (this.ddlProcessTemplate.SelectedValue) { //公司发文 case ProcessConstString.TemplateName.COMPANY_SEND: case ProcessConstString.TemplateName.DJGT_Send: //renjinquan+ l_entQueryCondition.GFHostDept = drpGFDept.SelectedValue; l_entQueryCondition.GFHostDeptName = drpGFDept.SelectedItem.Text; l_entQueryCondition.GFMainSenders = FormsMethod.Filter(txtGFZhuSongDanWei.Text); break; //公司收文 case ProcessConstString.TemplateName.COMPANY_RECEIVE: case ProcessConstString.TemplateName.MERGED_RECEIVE: //renjinquan+ l_entQueryCondition.GSReceiveUnit = FormsMethod.Filter(txtGSReceiveUnit.Text); break; //函件收文 case ProcessConstString.TemplateName.LETTER_RECEIVE: l_entQueryCondition.HSLetterType = ddlHSLetterType.SelectedValue; if (this.ddlHSLetterType.SelectedItem != null) { l_entQueryCondition.HSLetterTypeName = this.ddlHSLetterType.SelectedItem.Text; } l_entQueryCondition.HSReceiveUnit = FormsMethod.Filter(txtHSReceiveUnit.Text); l_entQueryCondition.HSFileEncoding = FormsMethod.Filter(txtHSFileEncoding.Text); break; //函件发文 case ProcessConstString.TemplateName.LETTER_SEND: l_entQueryCondition.HFCompany = FormsMethod.Filter(txtHFCompany.Text); l_entQueryCondition.HFHanJianID = ddlHFLetterType.SelectedValue; l_entQueryCondition.HFSendDept = FormsMethod.Filter(ddlHFDept.SelectedValue); if (this.ddlHFLetterType.SelectedItem != null) { l_entQueryCondition.HFHanJianType = this.ddlHFLetterType.SelectedItem.Text; } if (this.ddlHFDept.SelectedItem != null) { l_entQueryCondition.HFSendDeptName = this.ddlHFDept.SelectedItem.Text; } break; //程序文件 case ProcessConstString.TemplateName.PROGRAM_FILE: l_entQueryCondition.PFHostDept = FormsMethod.Filter(this.ddlPFDept.SelectedValue); break; //工作联系单 case ProcessConstString.TemplateName.AFFILIATION: //编制部门 if (this.ddlWRHostDept.SelectedItem != null) { l_entQueryCondition.WRHostDept = FormsMethod.Filter(this.ddlWRHostDept.SelectedItem.Text); } //主送部门 if (this.ddlWRMainSendDept.SelectedItem != null) { l_entQueryCondition.WRMainSend = FormsMethod.Filter(this.ddlWRMainSendDept.SelectedItem.Text); } break; //请示报告 case ProcessConstString.TemplateName.INSTUCTION_REPORT: //主送领导 if (this.ddlMainSendleader.SelectedItem != null) { l_entQueryCondition.RRMainLeader = this.ddlMainSendleader.SelectedItem.Text; } //承办处室 l_entQueryCondition.RRUnderTakeDept = FormsMethod.Filter(this.ddlUnderTakeDept.SelectedValue); //承办处室name if (this.ddlUnderTakeDept.SelectedItem != null) { l_entQueryCondition.RRUnderTakeDeptName = this.ddlUnderTakeDept.SelectedItem.Text; } //编制部门 if (this.ddlHostDept.SelectedItem != null) { l_entQueryCondition.RRHostDept = this.ddlHostDept.SelectedItem.Text; } break; } return(l_entQueryCondition); }
/// <summary> /// 得到检索条件数据实体 /// </summary> /// <returns>检索条件数据实体</returns> private M_ProcessSearch GetSearchCondition() { B_ProcessInstance l_busProcessList = new B_ProcessInstance(); M_ProcessSearch l_entQueryCondition = new M_ProcessSearch(); String l_strValue = String.Empty; String[] l_strAryUserRoleNames = CurrentUserInfo.RoleName.ToArray(); String[] l_strAryUserPositions = null; String[] l_strAryUserSingles = new String[] { CurrentUserInfo.DisplayName }; DataTable l_dtbPosition = CurrentUserInfo.DeptPost; DataSet l_dstDataSet = OAConfig.GetRankConfig(); String l_strAllSubDeptID = String.Empty; l_entQueryCondition.PositionName = "普通员工"; l_entQueryCondition.PositionValue = CurrentUserInfo.UserName; if (l_dtbPosition != null && l_dtbPosition.Rows.Count > 0) { l_strAryUserPositions = new String[l_dtbPosition.Rows.Count]; for (int i = 0; i < l_dtbPosition.Rows.Count; i++) { l_strAryUserPositions[i] = l_dtbPosition.Rows[i]["PostName"].ToString(); l_strValue += l_dtbPosition.Rows[i]["FK_DeptID"].ToString() + ","; } } foreach (DataTable l_dtbDataTable in l_dstDataSet.Tables) { if (l_dtbDataTable.TableName == "公司收文" || l_dtbDataTable.TableName == "函件收文" || l_dtbDataTable.TableName == "党纪工团收文") { continue; } String[] l_strAryRoleName = l_dtbDataTable.Rows[0]["角色"].ToString().Split(new char[] { ';' }); String[] l_strAryPositionName = l_dtbDataTable.Rows[0]["职位"].ToString().Split(new char[] { ';' }); String[] l_strArySingle = l_dtbDataTable.Rows[0]["人员"].ToString().Split(new char[] { ';' }); if (l_dtbDataTable.TableName == "处室权限" || l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strValue)) { DataTable l_dtbSubDept = l_busProcessList.GetAllSubDeptID(l_strValue.Substring(0, l_strValue.Length - 1)); l_strAllSubDeptID = String.Empty; if (l_dtbSubDept.Rows.Count != 0) { l_strAllSubDeptID = l_dtbSubDept.Rows[0][0].ToString().Replace("<U ID=\"", "").Replace("\"/>", ","); if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } if (l_strAryUserRoleNames != null && l_strAryUserRoleNames.Count() > 0) { IEnumerable<String> l_enumRole = l_strAryUserRoleNames.Intersect(l_strAryRoleName); if (l_enumRole.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } if (l_strAryUserPositions != null && l_strAryUserPositions.Count() > 0) { IEnumerable<String> l_enumPosition = l_strAryUserPositions.Intersect(l_strAryPositionName); if (l_enumPosition.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } IEnumerable<String> l_enumSingle = l_strAryUserSingles.Intersect(l_strArySingle); if (l_enumSingle.Count() > 0) { if (l_dtbDataTable.TableName == "领导权限") { l_entQueryCondition.PositionName = ConstString.RoleName.COMPANY_LEADER; l_entQueryCondition.PositionValue = null; break; } else if (l_dtbDataTable.TableName == "处室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "处长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } break; } else if (l_dtbDataTable.TableName == "科室权限") { if (!String.IsNullOrEmpty(l_strAllSubDeptID)) { l_entQueryCondition.PositionName = "科长"; l_entQueryCondition.PositionValue = l_strAllSubDeptID.Substring(0, l_strAllSubDeptID.Length - 1); } } } } //是否备份查询 l_entQueryCondition.IsHistorySearch = this.chbHistorySearch.Checked; //流程模版名称 l_entQueryCondition.TemplateName = ddlProcessTemplate.SelectedValue; //流程实例名 l_entQueryCondition.ProcInstName = FormsMethod.Filter(txtProcInstName.Text); ////当前步骤 //l_entQueryCondition.StepName = ddlStepName.SelectedValue; //文号 l_entQueryCondition.DocumentNo = FormsMethod.Filter(txtDocumentNo.Text); //文件标题 l_entQueryCondition.DocumentTitle = FormsMethod.Filter(txtDocumentTitle.Text); //发起人 l_entQueryCondition.Initiator = FormsMethod.Filter(txtSponsor.Text); //发起日期-开始 l_entQueryCondition.StartTime = txtStartDate.ValDate; //发起日期-结束 l_entQueryCondition.EndTime = txtEndDate.ValDate; //状态 l_entQueryCondition.Status = ddlProcessStatus.SelectedValue; //接受人 l_entQueryCondition.ReceiveUser = FormsMethod.Filter(this.txtChuLiRen.Text); switch (this.ddlProcessTemplate.SelectedValue) { //公司发文 case ProcessConstString.TemplateName.COMPANY_SEND: case ProcessConstString.TemplateName.DJGT_Send://renjinquan+ l_entQueryCondition.GFHostDept = drpGFDept.SelectedValue; l_entQueryCondition.GFHostDeptName = drpGFDept.SelectedItem.Text; l_entQueryCondition.GFMainSenders = FormsMethod.Filter(txtGFZhuSongDanWei.Text); break; //公司收文 case ProcessConstString.TemplateName.COMPANY_RECEIVE: case ProcessConstString.TemplateName.MERGED_RECEIVE://renjinquan+ l_entQueryCondition.GSReceiveUnit = FormsMethod.Filter(txtGSReceiveUnit.Text); break; //函件收文 case ProcessConstString.TemplateName.LETTER_RECEIVE: l_entQueryCondition.HSLetterType = ddlHSLetterType.SelectedValue; if (this.ddlHSLetterType.SelectedItem != null) { l_entQueryCondition.HSLetterTypeName = this.ddlHSLetterType.SelectedItem.Text; } l_entQueryCondition.HSReceiveUnit = FormsMethod.Filter(txtHSReceiveUnit.Text); l_entQueryCondition.HSFileEncoding = FormsMethod.Filter(txtHSFileEncoding.Text); break; //函件发文 case ProcessConstString.TemplateName.LETTER_SEND: l_entQueryCondition.HFCompany = FormsMethod.Filter(txtHFCompany.Text); l_entQueryCondition.HFHanJianID = ddlHFLetterType.SelectedValue; l_entQueryCondition.HFSendDept = FormsMethod.Filter(ddlHFDept.SelectedValue); if (this.ddlHFLetterType.SelectedItem != null) { l_entQueryCondition.HFHanJianType = this.ddlHFLetterType.SelectedItem.Text; } if (this.ddlHFDept.SelectedItem != null) { l_entQueryCondition.HFSendDeptName = this.ddlHFDept.SelectedItem.Text; } break; //程序文件 case ProcessConstString.TemplateName.PROGRAM_FILE: l_entQueryCondition.PFHostDept = FormsMethod.Filter(this.ddlPFDept.SelectedValue); break; //工作联系单 case ProcessConstString.TemplateName.AFFILIATION: //编制部门 if (this.ddlWRHostDept.SelectedItem != null) { l_entQueryCondition.WRHostDept = FormsMethod.Filter(this.ddlWRHostDept.SelectedItem.Text); } //主送部门 if (this.ddlWRMainSendDept.SelectedItem != null) { l_entQueryCondition.WRMainSend = FormsMethod.Filter(this.ddlWRMainSendDept.SelectedItem.Text); } break; //请示报告 case ProcessConstString.TemplateName.INSTUCTION_REPORT: //主送领导 if (this.ddlMainSendleader.SelectedItem != null) { l_entQueryCondition.RRMainLeader = this.ddlMainSendleader.SelectedItem.Text; } //承办处室 l_entQueryCondition.RRUnderTakeDept = FormsMethod.Filter(this.ddlUnderTakeDept.SelectedValue); //承办处室name if (this.ddlUnderTakeDept.SelectedItem != null) { l_entQueryCondition.RRUnderTakeDeptName = this.ddlUnderTakeDept.SelectedItem.Text; } //编制部门 if (this.ddlHostDept.SelectedItem != null) { l_entQueryCondition.RRHostDept = this.ddlHostDept.SelectedItem.Text; } break; } return l_entQueryCondition; }
/// <summary> /// 重写OnLoad事件 /// 初始化或加载表单数据 /// </summary> protected override void OnInit(EventArgs e) { DataTable l_dtbDataTable = null; DataRow l_dtrDataRow = null; B_ProcessInstance l_busProcessInstance = null; if (!Page.IsPostBack) { //是否为预览状态 if (!String.IsNullOrEmpty(Request.QueryString[ConstString.QueryString.IS_PREVIEW])) { this.IsPreview = true; } //表单TableID this.IdentityID = Convert.ToInt32(Request.QueryString[ConstString.QueryString.IdentityID]); //哪个菜单进入的 1.待办 2.公办 3.待阅 4.已阅 this.EntryAction = Request.QueryString[ConstString.QueryString.ENTRY_ACTION]; //流程实例号 this.ProcessID = Request.QueryString[ConstString.QueryString.PROCESS_ID]; //流程名称 this.TemplateName = Request.QueryString[ConstString.QueryString.TEMPLATE_NAME]; //步骤节点名称 this.StepName = Request.QueryString[ConstString.QueryString.STEP_NAME]; //步骤节点ID this.WorkItemID = Request.QueryString[ConstString.QueryString.WORKITEM_ID]; if (!String.IsNullOrEmpty(this.WorkItemID)) { l_busProcessInstance = new B_ProcessInstance(); //根据WorkItemID获取流程信息 l_dtbDataTable = l_busProcessInstance.GetProcessByWorkItemID(this.WorkItemID); //验证WorkItemID是否有效 if (l_dtbDataTable == null || l_dtbDataTable.Rows.Count == 0) { //无效的WorkItemID,请确保WorkItemID的正确性 //return; } else { l_dtrDataRow = l_dtbDataTable.Rows[0]; //流程实例号 this.ProcessID = l_dtrDataRow["PROC_INST_ID"].ToString(); //子流程实例号 this.SubProcessID = l_dtrDataRow["SUB_PROC_INST_ID"].ToString(); //流程步骤名称 this.StepName = l_dtrDataRow["STEP_NAME"].ToString(); //流程模版名称 this.TemplateName = l_dtrDataRow["PDEF_NAME"].ToString(); //流程相关WorkObjectID this.WorkObjectID = l_dtrDataRow["WORK_OBJECT_ID"].ToString(); //公办组ID this.CommonID = l_dtrDataRow["POOL_ID"].ToString(); } } //待阅 if (this.EntryAction == "3") { this.StepName = ProcessConstString.StepName.STEP_CIRCULATE; } if (String.IsNullOrEmpty(this.StepName) || this.StepName == "1") { if (this.TemplateName == ProcessConstString.TemplateName.COMPANY_RECEIVE || this.TemplateName == ProcessConstString.TemplateName.LETTER_RECEIVE) { base.IsFromDraft = true; } switch (this.TemplateName) { case ProcessConstString.TemplateName.COMPANY_RECEIVE: //公司收文 case ProcessConstString.TemplateName.MERGED_RECEIVE: this.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL; break; case ProcessConstString.TemplateName.LETTER_RECEIVE: //函件收文 this.StepName = ProcessConstString.StepName.LetterReceiveStepName.STEP_INITIAL; break; case ProcessConstString.TemplateName.AFFILIATION: //工作联系单 case ProcessConstString.TemplateName.DJGT_Send: //党纪工团发文 case ProcessConstString.TemplateName.COMPANY_SEND: //公司发文 case ProcessConstString.TemplateName.FINANCE_TRIPAPPLY: //出差申请 //this.StepName = ProcessConstString.StepName.FinanceStepName.STEP_APPLY; //break; case ProcessConstString.TemplateName.INSTUCTION_REPORT: //请示报告 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.LETTER_SEND: //函件发文 this.StepName = ProcessConstString.StepName.LetterSend.发起函件; break; case ProcessConstString.TemplateName.PROGRAM_FILE: //程序文件 this.StepName = ProcessConstString.StepName.ProgramFile.STEP_WRITE; break; case ProcessConstString.TemplateName.FinanceCCBX_APPLY: //出差培训报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceZDBX_APPLY: //招待费报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceHWBX_APPLY: //会务费用报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceJK_APPLY: //借款申请单 this.StepName = ProcessConstString.StepName.FinanceJKStepName.STEP_NiGao; break; } } } if (String.IsNullOrEmpty(this.ProcessID)) { //发起流程,产生流程实例号 this.ProcessID = Guid.NewGuid().ToString("N").ToUpper(); } base.OnInit(e); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { this.gvProcessList.DataSource = B_ProcessInstance.GetRelationProcess(this.ProcessType, this.ProcessID); this.gvProcessList.DataBind(); }
protected void btnSecFF_Click(object sender, EventArgs e) { try { if (this.txtProcessID.Text == string.Empty) { JScript.Alert("只有已经启动的流程才能二次分发!"); return; } List <EntityBase> bworkitems = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true); B_LetterReceive NewEntity = new B_LetterReceive(); B_LetterReceive bworkitem = bworkitems != null && bworkitems.Count > 0 ? bworkitems[0] as B_LetterReceive : new B_LetterReceive(); NewEntity.ProcessID = this.txtProcessID.Text; NewEntity.WorkItemID = Guid.NewGuid().ToString("N"); bworkitem.WorkItemID = NewEntity.WorkItemID; bworkitem.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2; NewEntity.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2; bworkitem.SubmitDate = System.DateTime.Now; NewEntity.SubmitDate = System.DateTime.Now; bworkitem.CommentList.Clear(); bworkitem.UrgentDegree = this.ddlUrgentDegree.SelectedValue; NewEntity.UrgentDegree = this.ddlUrgentDegree.SelectedValue; bworkitem.DocumentNo = this.txtDocumentNo.Text; NewEntity.DocumentNo = this.txtDocumentNo.Text; bworkitem.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue; NewEntity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue; bworkitem.FileEncoding = this.txtDocumentEncoding.Text; NewEntity.FileEncoding = this.txtDocumentEncoding.Text; bworkitem.CommunicationUnit = this.txtReceiveUnit.Text; NewEntity.CommunicationUnit = this.txtReceiveUnit.Text; bworkitem.DocumentTitle = this.txtDocumentTitle.Text; NewEntity.DocumentTitle = this.txtDocumentTitle.Text; bworkitem.Remarks = this.txtRemark.Text; NewEntity.Remarks = this.txtRemark.Text; bworkitem.FileList = this.ucAttachment.UCDataList; NewEntity.FileList = this.ucAttachment.UCDataList; bworkitem.ReceiveDateTime = DateTime.Now; NewEntity.ReceiveDateTime = DateTime.Now; bworkitem.ReceiveUserID = CurrentUserInfo.UserName; NewEntity.ReceiveUserID = CurrentUserInfo.UserName; bworkitem.ReceiveUserName = CurrentUserInfo.DisplayName; NewEntity.ReceiveUserName = CurrentUserInfo.DisplayName; NewEntity.D_StepStatus = bworkitem.D_StepStatus; NewEntity.ReceiptDate = bworkitem.ReceiptDate; NewEntity.Pages = bworkitem.Pages; NewEntity.ChuanYueLeader = bworkitem.ChuanYueLeader; NewEntity.AssistDept = bworkitem.AssistDept; NewEntity.AssistDeptName = bworkitem.AssistDeptName; NewEntity.ChuanYueLeader = bworkitem.ChuanYueLeader; NewEntity.ChuanYueDept = bworkitem.ChuanYueDept; NewEntity.LeaderShip = bworkitem.LeaderShip; NewEntity.LeaderShipName = bworkitem.LeaderShipName; NewEntity.LS_Comment = bworkitem.LS_Comment; NewEntity.UnderTakeID = bworkitem.UnderTakeID; NewEntity.UnderTake = bworkitem.UnderTake; NewEntity.UnderTake_Comment = bworkitem.UnderTake_Comment; NewEntity.UnderTakeLeaders = bworkitem.UnderTakeLeaders; NewEntity.NiBanRen = bworkitem.NiBanRen; NewEntity.NiBanRenName = bworkitem.NiBanRenName; NewEntity.NiBanComment = bworkitem.NiBanComment; NewEntity.Drafter = bworkitem.Drafter; NewEntity.DraftDate = bworkitem.DraftDate; NewEntity.RegisterID = bworkitem.RegisterID; NewEntity.Prompt = bworkitem.Prompt; NewEntity.ChuanYueDeptID = bworkitem.ChuanYueDeptID; NewEntity.HJPrompt = bworkitem.HJPrompt; NewEntity.ChuanYueLeaderID = bworkitem.ChuanYueLeaderID; NewEntity.AgentUserName = bworkitem.AgentUserName; NewEntity.AgentUserID = bworkitem.AgentUserID; NewEntity.FormsData = XmlUtility.SerializeXml(bworkitem as EntityBase); FormSave.SaveEntity(NewEntity, false); if (B_ProcessInstance.IsCompletedOrCancel(NewEntity.ProcessID)) { B_ProcessInstance.MoveToBakTable(NewEntity.WorkItemID, "T_OA_HS_WorkItems", "T_OA_HS_WorkItems_BAK"); //在备份库中插入数据 B_ProcessInstance.UpdateRecordStatus(NewEntity.WorkItemID, 2); //将现行库数据更新为不可用。 } btnModify_Click(null, null); //string filedata = "<FileList />"; //if (this.ucAttachment.UCDataList.Count > 0) //{ // string formdata = XmlUtility.SerializeXml<B_LetterReceive>(bworkitem); // int iStartIndex = formdata.IndexOf("<FileList>"); // int iEndIndex = formdata.IndexOf("</FileList>"); // if (iEndIndex > iStartIndex) // { // filedata = formdata.Substring(iStartIndex, iEndIndex - iStartIndex); // filedata += "</FileList>"; // } //} //FormsMethod.UpdateAssignFileData(bworkitem.ProcessID,ProcessConstString.TemplateName.LETTER_RECEIVE, "", filedata); List <EntityBase> bworkitemsAssign = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true, "'New','Assigned'"); string strUpdatePeople = string.Empty; foreach (EntityBase entity in bworkitemsAssign) { B_LetterReceive lentity = entity as B_LetterReceive; lentity.SubmitDate = System.DateTime.Now; lentity.UrgentDegree = this.ddlUrgentDegree.SelectedValue; lentity.DocumentNo = this.txtDocumentNo.Text; lentity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue; lentity.FileEncoding = this.txtDocumentEncoding.Text; lentity.CommunicationUnit = this.txtReceiveUnit.Text; lentity.DocumentTitle = this.txtDocumentTitle.Text; lentity.Remarks = this.txtRemark.Text; lentity.FileList = this.ucAttachment.UCDataList; FormSave.SaveEntity(lentity as EntityBase, true); strUpdatePeople += lentity.ReceiveUserName + ","; } B_ToCirculate l_busCirculate = new B_ToCirculate(); l_busCirculate.IsAgain = true; l_busCirculate.ToProcessType = ProcessConstString.TemplateName.LETTER_RECEIVE; l_busCirculate.ToProcessID = bworkitem.ProcessID; l_busCirculate.ToWorkItemID = bworkitem.WorkItemID; l_busCirculate.ToUserIDS = B_FormsData.GetProcessPeople("'Completed','Removed'", this.txtProcessID.Text, ";", true); string strInfo = string.Empty; if (l_busCirculate.ToUserIDS != string.Empty) { strInfo = l_busCirculate.ChuanYueToDB(); } strUpdatePeople = strUpdatePeople.Length > 0?strUpdatePeople.Substring(0, strUpdatePeople.Length - 1):""; strInfo = strInfo.Replace("传阅成功", "二次分发成功"); strInfo += string.IsNullOrEmpty(strInfo) ? "" : "\\n"; strInfo += string.IsNullOrEmpty(strUpdatePeople) ? "" : ("(" + strUpdatePeople + ")更新成功!"); if (strInfo != string.Empty) { JScript.Alert(strInfo); } else { JScript.Alert("二次分发成功!无人员传阅和数据更新!"); } } catch { JScript.Alert("二次分发失败!"); } }
/// <summary> /// 重写OnLoad事件 /// 初始化或加载表单数据 /// </summary> protected override void OnInit(EventArgs e) { DataTable l_dtbDataTable = null; DataRow l_dtrDataRow = null; B_ProcessInstance l_busProcessInstance = null; if (!Page.IsPostBack) { //是否为预览状态 if (!String.IsNullOrEmpty(Request.QueryString[ConstString.QueryString.IS_PREVIEW])) { this.IsPreview = true; } //表单TableID this.IdentityID = Convert.ToInt32(Request.QueryString[ConstString.QueryString.IdentityID]); //哪个菜单进入的 1.待办 2.公办 3.待阅 4.已阅 this.EntryAction = Request.QueryString[ConstString.QueryString.ENTRY_ACTION]; //流程实例号 this.ProcessID = Request.QueryString[ConstString.QueryString.PROCESS_ID]; //流程名称 this.TemplateName = Request.QueryString[ConstString.QueryString.TEMPLATE_NAME]; //步骤节点名称 this.StepName = Request.QueryString[ConstString.QueryString.STEP_NAME]; //步骤节点ID this.WorkItemID = Request.QueryString[ConstString.QueryString.WORKITEM_ID]; if (!String.IsNullOrEmpty(this.WorkItemID)) { l_busProcessInstance = new B_ProcessInstance(); //根据WorkItemID获取流程信息 l_dtbDataTable = l_busProcessInstance.GetProcessByWorkItemID(this.WorkItemID); //验证WorkItemID是否有效 if (l_dtbDataTable == null || l_dtbDataTable.Rows.Count == 0) { //无效的WorkItemID,请确保WorkItemID的正确性 //return; } else { l_dtrDataRow = l_dtbDataTable.Rows[0]; //流程实例号 this.ProcessID = l_dtrDataRow["PROC_INST_ID"].ToString(); //子流程实例号 this.SubProcessID = l_dtrDataRow["SUB_PROC_INST_ID"].ToString(); //流程步骤名称 this.StepName = l_dtrDataRow["STEP_NAME"].ToString(); //流程模版名称 this.TemplateName = l_dtrDataRow["PDEF_NAME"].ToString(); //流程相关WorkObjectID this.WorkObjectID = l_dtrDataRow["WORK_OBJECT_ID"].ToString(); //公办组ID this.CommonID = l_dtrDataRow["POOL_ID"].ToString(); } } //待阅 if (this.EntryAction == "3") { this.StepName = ProcessConstString.StepName.STEP_CIRCULATE; } if (String.IsNullOrEmpty(this.StepName) || this.StepName == "1") { if (this.TemplateName == ProcessConstString.TemplateName.COMPANY_RECEIVE || this.TemplateName == ProcessConstString.TemplateName.LETTER_RECEIVE) { base.IsFromDraft = true; } switch (this.TemplateName) { case ProcessConstString.TemplateName.COMPANY_RECEIVE://公司收文 case ProcessConstString.TemplateName.MERGED_RECEIVE: this.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL; break; case ProcessConstString.TemplateName.LETTER_RECEIVE://函件收文 this.StepName = ProcessConstString.StepName.LetterReceiveStepName.STEP_INITIAL; break; case ProcessConstString.TemplateName.AFFILIATION://工作联系单 case ProcessConstString.TemplateName.DJGT_Send: //党纪工团发文 case ProcessConstString.TemplateName.COMPANY_SEND://公司发文 case ProcessConstString.TemplateName.FINANCE_TRIPAPPLY://出差申请 //this.StepName = ProcessConstString.StepName.FinanceStepName.STEP_APPLY; //break; case ProcessConstString.TemplateName.INSTUCTION_REPORT://请示报告 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.LETTER_SEND://函件发文 this.StepName = ProcessConstString.StepName.LetterSend.发起函件; break; case ProcessConstString.TemplateName.PROGRAM_FILE: //程序文件 this.StepName = ProcessConstString.StepName.ProgramFile.STEP_WRITE; break; case ProcessConstString.TemplateName.FinanceCCBX_APPLY: //出差培训报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceZDBX_APPLY: //招待费报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceHWBX_APPLY: //会务费用报销单 this.StepName = ProcessConstString.StepName.STEP_DRAFT; break; case ProcessConstString.TemplateName.FinanceJK_APPLY: //借款申请单 this.StepName = ProcessConstString.StepName.FinanceJKStepName.STEP_NiGao; break; } } } if (String.IsNullOrEmpty(this.ProcessID)) { //发起流程,产生流程实例号 this.ProcessID = Guid.NewGuid().ToString("N").ToUpper(); } base.OnInit(e); }
public void Devolve(EntityBase entity, string sProcessType, out string sResult, out string sPlatForm) { sResult = ""; string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml")); FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath); FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath); // 开始发送归档 /* * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中 * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档 */ string xml = ""; string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/Object"); string s = ""; sPlatForm = objDevolve.ToUpper(); entity.FormsData = XmlUtility.SerializeXml(entity); if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC") { FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC(); xml = Devolve2DC2(entity, dcDev, sProcessType); s = oa2dc.SendDevolve(xml, entity.FormsData, sProcessType); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } B_ProcessInstance.ProcessDevolve(entity.ProcessID, sProcessType); } if (objDevolve.ToUpper() == "DP") { FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP(); string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/DPID"); // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档 string[] arrDPID = sOADPIDs.Split(new char[] { ',', ';' }); for (int i = 0; i < arrDPID.Length; i++) { try { Convert.ToInt32(arrDPID[i]); } catch { continue; } xml = Devovle2DP2(entity, dpDev, arrDPID[i], sProcessType); s = oa2dp.SendDevolve(xml, entity.FormsData, sProcessType); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } } string sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/OptionDPID"); string[] arrOpDPID = sOptionDPID.Split(new char[] { ',' }); for (int i = 0; i < arrOpDPID.Length; i++) { if (entity.GetVal(arrOpDPID[i]) == null) { continue; } string sDPID = entity.GetVal(arrOpDPID[i]).ToString(); string[] IDs = sDPID.Split(new char[] { ';', ',' }); for (int j = 0; j < IDs.Length; j++) { try { Convert.ToInt32(IDs[j]); } catch { continue; } xml = Devovle2DP2(entity, dpDev, IDs[j], sProcessType); s = oa2dp.SendDevolve(xml, entity.FormsData, sProcessType); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } } } B_ProcessInstance.ProcessDevolve(entity.ProcessID, sProcessType); } }