public void SetPrintBeginExport(UC_Print ucPrint, B_MergeReceiveBase cEntity) { switch (ucPrint.FileName) { case "党纪工团收文表单": ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>文件名称:|right</col> ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>收文编号:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DocumentReceiveDate.ToShortDateString())); //<col>收文日期:|right</col> ucPrint.ExportData.Add(cEntity.SendNo); //<col>原文号:|right</col> //ucPrint.ExportData.Add(cEntity.VolumeNo); //<col>卷号:|right</col> //ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.Officer)); //<col>党群工作处处长|right</col> ucPrint.ExportData.Add(cEntity.Officer_Comment); //<col>党群工作处处长意见意见:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.LeaderShip)); //<col>公司领导:|right</col> ucPrint.ExportData.Add(cEntity.LS_Comment); //<col>领导批示:|right</col> ucPrint.ExportData.Add(GetValueByColName("DeptName", cEntity.UnderTakeList)); //ucPrint.ExportData.Add(sDept);//<col>承办部门:|right</col> ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList)); //<col>承办意见:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("ReceiveUserName", cEntity.CirculateList)); //<col>传阅人员:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("Comment", cEntity.CirculateList)); //<col>传阅意见:|right</col> ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col> //ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "提示信息:";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Down; break; } }
public void SetPrintBeginExport(UC_Print ucPrint, B_MergeReceiveBase cEntity) { switch (ucPrint.FileName) { case "党纪工团收文表单": ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>文件名称:|right</col> ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>收文编号:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DocumentReceiveDate.ToShortDateString()));//<col>收文日期:|right</col> ucPrint.ExportData.Add(cEntity.SendNo); //<col>原文号:|right</col> //ucPrint.ExportData.Add(cEntity.VolumeNo); //<col>卷号:|right</col> //ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.Officer)); //<col>党群工作处处长|right</col> ucPrint.ExportData.Add(cEntity.Officer_Comment); //<col>党群工作处处长意见意见:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.LeaderShip)); //<col>公司领导:|right</col> ucPrint.ExportData.Add(cEntity.LS_Comment); //<col>领导批示:|right</col> ucPrint.ExportData.Add(GetValueByColName("DeptName", cEntity.UnderTakeList));//ucPrint.ExportData.Add(sDept);//<col>承办部门:|right</col> ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList));//<col>承办意见:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("ReceiveUserName", cEntity.CirculateList)); //<col>传阅人员:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("Comment", cEntity.CirculateList)); //<col>传阅意见:|right</col> ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList));//<col>附件:|down</col> //ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "提示信息:";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Down; break; } }
private void ucPrint_OnBeginExport(object sender, EventArgs e) { Recv_Print print = new Recv_Print(); B_MergeReceiveBase cEntity = null; if (base.IsPreview) { cEntity = base.EntityData != null ? base.EntityData as B_MergeReceiveBase : new B_MergeReceiveBase(); } else { cEntity = this.ControlToEntity(false) as B_MergeReceiveBase; } print.SetPrintBeginExport(ucPrint, cEntity); }
public void SetPrintAttachExport(UC_Print ucPrint, B_MergeReceiveBase cEntity) { switch (ucPrint.FileName) { case "公文处理单": //ucPrint.WriteContent("日期 ", WriteMode.Down, 1); ucPrint.WriteAttach(); break; case "公司收文表单": //ucPrint.WriteContent("传阅意见:", WriteMode.Down, 1); //ucPrint.WriteAttach(); break; } }
/*公文处理单中的 传阅签名 日期*/ private void ucPrint_OnExtraExport(object sender, EventArgs e) { Recv_Print print = new Recv_Print(); B_MergeReceiveBase cEntity = null; if (base.IsPreview) { cEntity = base.EntityData != null ? base.EntityData as B_MergeReceiveBase : new B_MergeReceiveBase(); } else { cEntity = this.ControlToEntity(false) as B_MergeReceiveBase; } for (int i = 0; i < cEntity.CirculateList.Rows.Count; i++) { if (i + 1 < 14) { ucPrint.Write("传阅签名", cEntity.CirculateList.Rows[i]["ReceiveUserName"].ToString(), WordMgr.WriteMode.Right, i + 1); ucPrint.Write("日期", cEntity.CirculateList.Rows[i]["EditDate"].ToString(), WordMgr.WriteMode.Right, i + 1); } else { ucPrint.Write("传阅签名 ", cEntity.CirculateList.Rows[i]["ReceiveUserName"].ToString(), WordMgr.WriteMode.Right, i - 12); DateTime oDt = new DateTime(); try { oDt = Convert.ToDateTime(cEntity.CirculateList.Rows[i]["EditDate"].ToString()); } catch { return; } ucPrint.Write("日期 ", ucPrint.CheckDateTime(oDt.ToShortDateString()), WordMgr.WriteMode.Right, i - 12); } } switch (ucPrint.FileName) { case "党纪工团收文表单": ucPrint.BatchAddPicture(base.TemplateName, "党纪工团收文表单", cEntity); break; } }
protected void Page_Load(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; B_Circulate l_BusCirculate = null; DataTable l_dtbCirculate = null; DataTable l_dtbProcessSteps = null; String l_strRegisterID = null; M_ReceiveBase l_objWorkItem = null; //WFBaseProcessInstance l_objProcessInstance = null; if (!Page.IsPostBack) { this.ucAttachment.UCIsEditable = false; PreviousPageUrl = Request.UrlReferrer.ToString(); l_strRegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID]; l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID); if (l_BusReceiveEdit == null) { JScript.Alert("当前的ID或者无效,或者已经被删除!"); return; } this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName; PopulateReceiveField(l_BusReceiveEdit); if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID)) { divPrompt.Visible = true; return; } WFBaseProcessInstance fp = null; fp = WFFactory.GetWF(WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID); //l_objProcessInstance = AgilePointWF.GetAPI().GetProcInst(); if (fp != null) { ProcessTemplate = fp.DefName; String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(fp.DefName); l_BusCirculate = new B_Circulate(l_strCirculateTableName); l_dtbCirculate = l_BusCirculate.GetCirculatesByID(l_strCirculateTableName, l_BusReceiveEdit.ProcessID, 0); gdvCirculate.DataSource = l_dtbCirculate; gdvCirculate.DataBind(); string strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems; switch (fp.DefName) { case ProcessConstString.TemplateName.COMPANY_RECEIVE: l_objWorkItem = new B_GS_WorkItems(); strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems; break; default: strTableName = TableName.WorkItemsTableName.T_OA_MS_WorkItems; l_objWorkItem = new B_MergeReceiveBase(); break; } strTableName += ((fp.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || fp.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED)?"_BAK":""); l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, strTableName, l_objWorkItem); DataView l_dtvDataView = new DataView(l_dtbProcessSteps); l_dtvDataView.RowFilter = "D_StepStatus = 'Completed'"; rptProcessDetail.DataSource = l_dtvDataView; rptProcessDetail.DataBind(); } } }
/// <summary> /// 实体填充控件 /// </summary> protected override void EntityToControl() { B_MergeReceiveBase l_objReceiveBase = null; //收文登记号 this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID]; if (!String.IsNullOrEmpty(this.RegisterID)) { B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID); if (l_BusReceiveEdit == null) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle"); return; } //附件列表 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData); //收文号 this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo; //收文日期 this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal); //原文号 this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo; //来文单位 this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit; //卷号 this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo; //文件名称 this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle; //紧急程度 this.txtUrgentDegree.Text = l_BusReceiveEdit.UrgentDegree; //步骤名称 base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL; this.SubTemplateName = l_BusReceiveEdit.ProcessName; //党群工作处处长 OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR); } else { l_objReceiveBase = base.EntityData as B_MergeReceiveBase; this.SubTemplateName = l_objReceiveBase.TemplateName; this.RegisterID = l_objReceiveBase.RegisterID; //党群工作处处长 OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR); ddlPoliticalOfficer.SelectedValue = l_objReceiveBase.Officer; txtPoliticalOfficerComment.Text = l_objReceiveBase.Officer_Comment; //附件列表 this.ucAttachment.UCDataList = l_objReceiveBase.FileList; //收文号 this.txtReceiveNo.Text = l_objReceiveBase.DocumentNo; //收文日期 this.txtReceiveDate.Text = l_objReceiveBase.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal); //原文号 this.txtSendLetterNo.Text = l_objReceiveBase.SendNo; //来文单位 this.txtCommunicationUnit.Text = l_objReceiveBase.CommunicationUnit; //卷号 this.txtPreVolumeNo.Text = l_objReceiveBase.VolumeNo; //文件名称 this.txtDocumentTitle.Text = l_objReceiveBase.DocumentTitle; //紧急程度 this.txtUrgentDegree.Text = l_objReceiveBase.UrgentDegree; //发起人ID this.txtDrafter.Text = l_objReceiveBase.DrafterID; //发起日期 this.txtDraftDate.Text = l_objReceiveBase.DraftDate.ToString(); //公司领导 this.ddlLeadShip.SelectedValue = l_objReceiveBase.LeaderShip; //公司批示意见 this.txtLeadCommentView.Text = l_objReceiveBase.LS_Comment; if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { this.txtLeadCommentEdit.Text = l_objReceiveBase.LS_Comment; } switch (base.StepName) { case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR: //获取处室下属科室 OADept.GetChildDept(this.ddlUnderTakeSection, l_objReceiveBase.UnderTakeDept, 2); //获取处室下属人员 OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeDept, -1); break; case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF: //获取科室下属人员 OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeChief, -1); break; case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER: break; } //承办部门 this.txtUnderTakeDeptID.Text = l_objReceiveBase.UnderTakeDept; this.txtUnderTakeDeptName.Text = l_objReceiveBase.UnderTakeDeptName; //承办科室 this.ddlUnderTakeSection.SelectedValue = l_objReceiveBase.UnderTakeChief; //承办人员 this.ddlUnderTakePeople.SelectedValue = l_objReceiveBase.UnderTakePeople; //承办意见 this.txtUnderTakeCommentEdit.Text = l_objReceiveBase.UnderTake_Comment; this.txtCirculatePeopleName.Text = l_objReceiveBase.CPeopleName; this.txtCirculatePeopleID.Text = l_objReceiveBase.CPeopleID; this.txtCirculateDeptName.Text = l_objReceiveBase.CDeptName; this.txtCirculateDeptID.Text = l_objReceiveBase.CDeptID; //党群工作处处长处理后显示label形式的处长姓名与时间 if (l_objReceiveBase.DraftDate == DateTime.MinValue) { this.ddlPoliticalOfficer.Visible = false; this.lbParty.Visible = true; this.lbParty.Text = l_objReceiveBase.Officer + strNewLine + l_objReceiveBase.Officer_Date; } //领导;批示处理后显示label形式的领导人姓名与时间 if (l_objReceiveBase.LS_Date != "" && l_objReceiveBase.LS_Date != null) { this.ddlLeadShip.Visible = false; this.lbLeadShip.Visible = true; this.lbLeadShip.Text = l_objReceiveBase.LeaderShipName + strNewLine + l_objReceiveBase.LS_Date; } //提示信息 this.txtPrompt.Text = l_objReceiveBase.Prompt; if (l_objReceiveBase.IsFormSave) { this.txtPromptEdit.Text = l_objReceiveBase.PromptEdit; } } }
/// <summary> /// 控件填充实体 /// </summary> /// <param name="IsSave">是否保存</param> /// <returns>EntityBase</returns> protected override EntityBase ControlToEntity(Boolean p_blnIsSaveDraft) { B_MergeReceiveBase l_objReceiveBase = base.EntityData != null ? base.EntityData as B_MergeReceiveBase : new B_MergeReceiveBase(); l_objReceiveBase.TemplateName = this.SubTemplateName; l_objReceiveBase.RegisterID = base.RegisterID; l_objReceiveBase.Officer = ddlPoliticalOfficer.SelectedValue; if (!String.IsNullOrEmpty(l_objReceiveBase.Officer)) { l_objReceiveBase.OfficerName = ddlPoliticalOfficer.SelectedItem.Text; } l_objReceiveBase.Officer_Comment = txtPoliticalOfficerComment.Text.TrimEnd(); //附件信息 l_objReceiveBase.FileList = this.ucAttachment.UCDataList; //意见列表 l_objReceiveBase.CommentList = base.Comments; //收文号 l_objReceiveBase.DocumentNo = this.txtReceiveNo.Text; //收文日期 l_objReceiveBase.DocumentReceiveDate = this.txtReceiveDate.ValDate; //文件名称 l_objReceiveBase.DocumentTitle = this.txtDocumentTitle.Text; //原文号 l_objReceiveBase.SendNo = this.txtSendLetterNo.Text; //来文单位 l_objReceiveBase.CommunicationUnit = this.txtCommunicationUnit.Text; //预立卷号 l_objReceiveBase.VolumeNo = this.txtPreVolumeNo.Text; //紧急程度 l_objReceiveBase.UrgentDegree = this.txtUrgentDegree.Text; //提交时间 l_objReceiveBase.SubmitDate = DateTime.Now; if (String.IsNullOrEmpty(l_objReceiveBase.Drafter)) { //发起人ID l_objReceiveBase.DrafterID = CurrentUserInfo.UserName; //发起人姓名 l_objReceiveBase.Drafter = CurrentUserInfo.DisplayName; //发起日期 l_objReceiveBase.DraftDate = DateTime.Now; } else { //发起人ID l_objReceiveBase.DrafterID = l_objReceiveBase.ReceiveUserID; //发起人姓名 l_objReceiveBase.Drafter = l_objReceiveBase.ReceiveUserName; //发起日期 l_objReceiveBase.DraftDate = txtDraftDate.ValDate; } //公司领导批示 l_objReceiveBase.LeaderShip = this.ddlLeadShip.SelectedValue; if (!String.IsNullOrEmpty(this.ddlLeadShip.SelectedValue)) { l_objReceiveBase.LeaderShipName = this.ddlLeadShip.SelectedItem.Text; } if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { l_objReceiveBase.LS_Comment = this.txtLeadCommentEdit.Text.TrimEnd(); l_objReceiveBase.LS_Date = System.DateTime.Now.ToString(); } else { l_objReceiveBase.LS_Comment = this.txtLeadCommentView.Text.TrimEnd(); } //承办部门 if (!String.IsNullOrEmpty(this.txtUnderTakeDeptID.Text.TrimEnd())) { l_objReceiveBase.UnderTakeDept = this.txtUnderTakeDeptID.Text; l_objReceiveBase.UnderTakeDeptName = this.txtUnderTakeDeptName.Text; l_objReceiveBase.UnderTakeDeptLeaderID = OAUser.GetUserByDeptPostArray(this.txtUnderTakeDeptID.Text, null, true, true)[0]; } //承办科室 if (!String.IsNullOrEmpty(this.ddlUnderTakeSection.SelectedValue)) { l_objReceiveBase.UnderTakeChief = this.ddlUnderTakeSection.SelectedValue; l_objReceiveBase.UnderTakeChiefName = this.ddlUnderTakeSection.SelectedItem.Text; l_objReceiveBase.UnderTakeChiefLeaderID = FormsMethod.GetUserIDByViewBase(OAUser.GetDeptManager(this.ddlUnderTakeSection.SelectedValue, 0)); } //承办人员 if (!String.IsNullOrEmpty(this.ddlUnderTakePeople.SelectedValue)) { l_objReceiveBase.UnderTakePeople = this.ddlUnderTakePeople.SelectedValue; l_objReceiveBase.UnderTakePeopleName = this.ddlUnderTakePeople.SelectedItem.Text; } if (p_blnIsSaveDraft) { l_objReceiveBase.UnderTake_Comment = this.txtUnderTakeCommentEdit.Text; } //传阅 l_objReceiveBase.CPeopleName = this.txtCirculatePeopleName.Text; l_objReceiveBase.CPeopleID = this.txtCirculatePeopleID.Text; l_objReceiveBase.CDeptName = this.txtCirculateDeptName.Text; l_objReceiveBase.CDeptID = this.txtCirculateDeptID.Text; if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtUnderTakeCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PLOT) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtPoliticalOfficerComment.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION) { if (!p_blnIsSaveDraft) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtLeadCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } else if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PROCESS_CENTER) { if (!p_blnIsSaveDraft && m_strSubmitAction == ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_UNDERTAKE) { CYiJian l_objComment = new CYiJian(); l_objComment.Content = this.txtUnderTakeCommentEdit.Text; l_objComment.FinishTime = DateTime.Now.ToString(); l_objComment.UserID = l_objReceiveBase.ReceiveUserID; l_objComment.UserName = l_objReceiveBase.ReceiveUserName; l_objComment.ViewName = base.StepName; l_objComment.Action = m_strSubmitAction; l_objReceiveBase.CommentList.Add(l_objComment); } } l_objReceiveBase.IsFormSave = p_blnIsSaveDraft; if (p_blnIsSaveDraft) { l_objReceiveBase.Prompt = this.txtPrompt.Text; l_objReceiveBase.PromptEdit = this.txtPromptEdit.Text; } else { if (!String.IsNullOrEmpty(this.txtPromptEdit.Text.TrimEnd())) { l_objReceiveBase.Prompt = this.txtPrompt.Text + "[" + (l_objReceiveBase.ReceiveUserName == string.Empty ? CurrentUserInfo.DisplayName : l_objReceiveBase.ReceiveUserName) + "][" + System.DateTime.Now.ToString(ConstString.DateFormat.Long) + "]:" + this.txtPromptEdit.Text + ConstString.Miscellaneous.NEW_LINE; } } return(l_objReceiveBase); }
private string Devovle2DP2(HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); List <FounderSoftware.ADIM.OA.OA2DP.DevKVItem> ls = hn_oa2dp.MapFunction("DP", base.TemplateName); B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase; entity.FormsData = XmlUtility.SerializeXml(entity); B_ReceiveEdit RecvEditEntity = new B_ReceiveEdit(); RecvEditEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); //ar.SetAttribute("FormationTime"/*配置文件中的归档字段*/, "2009-12-12"/*cEntity.GetValue(配置文件中的实体属性名)*/); //string sValue = ar.GetAttribute("FormationTime"); #region 生成Archive节点 ar.System = "OA_" + base.IdentityID.ToString(); #region 根据DevolveConfig.xml配置参数设置Archive归档节点 for (int i = 0; i < ls.Count; i++) { string skey = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sKey; string sName = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sValue; string sType = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sType; string value = hn_oa2dp.PreHandel(entity, sName, sType); if (string.IsNullOrEmpty(value)) { value = hn_oa2dp.PreHandel(RecvEditEntity, sName, sType); } ar.SetAttribute(skey, value /*hn_oa2dp.PreHandel(entity, sName, sType, true)*//*(entity.GetVal(sName) as string)*/); } ar.SetOAArchiveNode(); // 其他节点处理应放置在SetOAArchiveNode方法之后 ar.FK_DPID = sDPID; //return Devolve2DP(oaDev, sDPID, ar); #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点 ar.ElectronicDocumentCount = ucAttachment.UCDataList.Count.ToString(); #endregion sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateName); FounderSoftware.ADIM.OA.OA2DP.HNDP_CFileNode fl = new HNDP_CFileNode(); /****开始生成File节点************************************************************************/ #region 开始生成File节点 fl.AuthorizeTime = ar.AuthorizeTime; fl.Code = ar.Code; fl.Code19 = ar.Code19; fl.D_FileStatus = ar.D_FileStatus; fl.DocCodesExplain = ""; fl.DocPages = ar.DocPages; fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime; fl.Ext_1 = ""; fl.Ext_2 = ar.Ext_2; fl.Ext_3 = ar.Ext_3; fl.Ext_4 = ar.Ext_4; fl.Ext_5 = ar.Ext_5; fl.Title = ar.Title; //fl.FK_ArchiveID = ar.FK_Archive; fl.FK_CategoryID = ar.FK_CategoryID; fl.FormationDept = ar.FormationDept; fl.FormationTime = ar.FormationTime; fl.Importer = ar.Importer; fl.ImporterTime = ar.ImporterTime; fl.OriginalID = ar.OriginalID; fl.OtherTitle = ar.OtherTitle; fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime; fl.RelatedCode = ar.RelatedCode; fl.Revision = ar.Revision; #endregion sXml = hn_oa2dp.GenOAFileNode(fl); /****完成生成File节点************************************************************************/ #region 始生成Attachment节点 /****开始生成Attachment节点******************************************************************/ string sServerWeb = hn_oa2dp.GetCfgNodeValues("/Devolve/Other/ServerWeb"); //"http://172.29.128.239"; //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName"); for (int i = 0; i < ucAttachment.UCDataList.Count; i++) { FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode(); CFuJian file = ucAttachment.UCDataList[i]; at.DocumentName = base.TemplateName; at.FK_FileID = ""; at.MakeDate = ""; at.MakeUnit = ""; at.PublishedTime = ""; at.Remark = ""; at.ServerWeb = sServerWeb; Double iSize = 0; string sSize = file.Size.ToUpper(); if (sSize.Contains("K")) { sSize = sSize.Replace("K", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024; } if (sSize.Contains("M")) { sSize = sSize.Replace("M", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024 * 1024; } at.Size = ((int)iSize).ToString(); at.TimeSize = ""; at.Title = file.Alias; at.Type = file.Type; at.Url = file.URL; sXml = hn_oa2dp.GenOAAttachmentNode(fl.FK_ArchiveID, at); } #endregion /****完成生成Attachment节点******************************************************************/ return(sXml); }
private void Devolve(out string sResult) { 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='" + base.TemplateName + "']/Object"); string s = ""; //EntityLetterSend entity = new EntityLetterSend(base.tableName); //SetEntity(entity, true); B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase; //entity.UnderTakeDept 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 = Devolve2DC(dcDev); s = oa2dc.SendDevolve(xml, entity.FormsData, base.TemplateName); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } //JScript.ShowMsgBox(Page, MsgType.VbCritical, s); } if (objDevolve.ToUpper() == "DP") { FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP(); string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/DPID"); // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档 if (!string.IsNullOrEmpty(sOADPIDs)) { string[] sDPID1 = sOADPIDs.Split(new char[] { ',', ';' }); if (sDPID1 != null) { for (int i = 0; i < sDPID1.Length; i++) { if (string.IsNullOrEmpty(sDPID1[i])) { continue; } xml = Devovle2DP2(dpDev, sDPID1[i]); s = oa2dp.SendDevolve(xml, entity.FormsData, base.TemplateName); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } ///JScript.ShowMsgBox(Page, MsgType.VbCritical, s); } } } string sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/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(dpDev, IDs[j]); s = oa2dp.SendDevolve(xml, entity.FormsData, base.TemplateName); sResult += (s + @"\r\n"); try { Convert.ToInt32(s); } catch { throw new Exception(s); } } //JScript.ShowMsgBox(Page, MsgType.VbCritical, s); } //else //// 根据配置文件的处室ID归档 //{ // string[] arrDPID = sOADPIDs.Split(new char[] { ',' }); // for (int i = 0; i < arrDPID.Length; i++) // { // xml = Devovle2DP2(dpDev, arrDPID[i]); // s = oa2dp.SendDevolve(xml, entity.FormsData, base.TemplateName); // JScript.ShowMsgBox(Page, MsgType.VbCritical, s); // } //} } //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s); //string rest = CDevolve.CallBack(Convert.ToInt32(s), true, s, doc.InnerXml); //IMessage ms = new WebFormMessage(Page, s); //ms.Show(); }
private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase; B_ReceiveEdit cEntity = new B_ReceiveEdit(); cEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, entity.DocumentNo)); #region ArchiveNode FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); ar.System = "OA_" + base.IdentityID.ToString(); ar.FK_DPID = sDPID; ar.Title = entity.DocumentTitle; ar.ReceiveCode = entity.DocumentNo; ar.Code = entity.SendNo; ar.PaperDocumentTransceiverTime = entity.DocumentReceiveDate.ToShortDateString(); ar.DocCode = entity.VolumeNo; ar.Proposer = entity.OfficerName; ar.Instructioner = entity.LeaderShipName; ar.FormationDept = cEntity.ReceiveUnit; ar.D_DocStorageLife = cEntity.KeepTime; ar.ThemeWord = cEntity.SubjectWord; ar.DocPages = cEntity.PageCount.ToString(); ar.ReceiveCode = cEntity.ReceiveNo; ar.ElectronicDocumentCount = ucAttachment.UCDataList.Count.ToString(); #endregion sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateName); FounderSoftware.ADIM.OA.OA2DP.HNDP_CFileNode fl = new HNDP_CFileNode(); /****开始生成File节点************************************************************************/ #region 开始生成File节点 fl.AuthorizeTime = ar.AuthorizeTime; fl.Code = ar.Code; fl.Code19 = ar.Code19; fl.D_FileStatus = ar.D_FileStatus; fl.DocCodesExplain = ""; fl.DocPages = ar.DocPages; fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime; fl.Ext_1 = ""; fl.Ext_2 = ar.Ext_2; fl.Ext_3 = ar.Ext_3; fl.Ext_4 = ar.Ext_4; fl.Ext_5 = ar.Ext_5; fl.Title = ar.Title; //fl.FK_ArchiveID = ar.FK_Archive; fl.FK_CategoryID = ar.FK_CategoryID; fl.FormationDept = ar.FormationDept; fl.FormationTime = ar.FormationTime; fl.Importer = ar.Importer; fl.ImporterTime = ar.ImporterTime; fl.OriginalID = ar.OriginalID; fl.OtherTitle = ar.OtherTitle; fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime; fl.RelatedCode = ar.RelatedCode; fl.Revision = ar.Revision; #endregion sXml = hn_oa2dp.GenOAFileNode(fl); /****完成生成File节点************************************************************************/ #region 始生成Attachment节点 /****开始生成Attachment节点******************************************************************/ string sServerWeb = hn_oa2dp.GetCfgNodeValues("/Devolve/Other/ServerWeb"); //"http://172.29.128.239"; //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName"); for (int i = 0; i < ucAttachment.UCDataList.Count; i++) { FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode(); CFuJian file = ucAttachment.UCDataList[i]; at.DocumentName = base.TemplateName; at.FK_FileID = ""; at.MakeDate = ""; at.MakeUnit = ""; at.PublishedTime = ""; at.Remark = ""; at.ServerWeb = sServerWeb; Double iSize = 0; string sSize = file.Size.ToUpper(); if (sSize.Contains("K")) { sSize = sSize.Replace("K", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024; } if (sSize.Contains("M")) { sSize = sSize.Replace("M", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024 * 1024; } at.Size = ((int)iSize).ToString(); at.TimeSize = ""; at.Title = file.Alias; at.Type = file.Type; at.Url = file.URL; sXml = hn_oa2dp.GenOAAttachmentNode(fl.FK_ArchiveID, at); } #endregion /****完成生成Attachment节点******************************************************************/ return(sXml); }
private string Devolve2DC(HN_OA2DC oaDev) { string sXml = ""; List <FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", base.TemplateName); B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase; entity.FormsData = XmlUtility.SerializeXml(entity); B_ReceiveEdit pEntity = new B_ReceiveEdit(); pEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); //string sPath = @"E:\QWDMS\Non Baseline Library\Development\03 Code\FounderSoftware.ADIM\FounderSoftware.ADIM.OA\OADevolveLib\DevolveConfig.xml"; #region 开始生成Archive节点 ar.System = "OA_" + base.IdentityID.ToString(); string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/Object"); switch (ObjPlatForm) { case "DC": ar.SysFlag = "1"; break; case "FC": ar.SysFlag = "2"; break; default: ar.SysFlag = "1"; break; } #region 根据DevolveConfig.xml配置参数设置Archive归档节点 for (int i = 0; i < ls.Count; i++) { string skey = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sKey; string sName = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sValue; string sType = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sType; string value = oaDev.PreHandel(entity, sName, sType); if (string.IsNullOrEmpty(value)) { value = oaDev.PreHandel(pEntity, sName, sType); } ar.SetAttribute(skey, oaDev.PreHandel(entity, sName, sType) /*(entity.GetVal(sName) as string)*/); } ar.SetOAArchiveNode(); // 其他节点处理应放置在SetOAArchiveNode方法之后 //return Devolve2DP(oaDev, sDPID, ar); #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点 ar.ElectronicDocumentCount = ucAttachment.UCDataList.Count.ToString(); #endregion sXml = oaDev.GenOAArchiveNode(ar, base.TemplateName); /****开始生成File节点************************************************************************/ #region 开始生成File节点 fl.AuthorizeTime = ar.AuthorizeTime; fl.Code = ar.Code; fl.Code19 = ar.Code19; fl.D_FileStatus = ar.D_FileStatus; fl.DocCodesExplain = ""; fl.DocPages = ar.DocPages; fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime; fl.Ext_1 = ar.Ext_1; fl.Ext_2 = ar.Ext_2; fl.Ext_3 = ar.Ext_3; fl.Ext_4 = ar.Ext_4; fl.Ext_5 = ar.Ext_5; fl.Title = ar.Title; fl.FK_ArchiveID = ar.FK_Archive; fl.FK_CategoryID = ar.FK_CategoryID; fl.FormationDept = ar.FormationDept; fl.FormationTime = ar.FormationTime; fl.Importer = ar.Importer; fl.ImporterTime = ar.ImporterTime; fl.OriginalID = ar.OriginalID; fl.OtherTitle = ar.OtherTitle; fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime; fl.RelatedCode = ar.RelatedCode; fl.Revision = ar.Revision; #endregion sXml = oaDev.GenOAFileNode(fl); /****完成生成File节点************************************************************************/ #region 始生成Attachment节点 /****开始生成Attachment节点******************************************************************/ string sServerWeb = oaDev.GetCfgNodeValues("/Devolve/Other/ServerWeb"); //"http://172.29.128.239"; //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName"); for (int i = 0; i < ucAttachment.UCDataList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = ucAttachment.UCDataList[i]; at.DocumentName = base.TemplateName; at.FK_FileID = ""; at.MakeDate = ""; at.MakeUnit = ""; at.PublishedTime = ""; at.Remark = ""; at.ServerWeb = sServerWeb; Double iSize = 0; string sSize = file.Size.ToUpper(); if (sSize.Contains("K")) { sSize = sSize.Replace("K", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024; } if (sSize.Contains("M")) { sSize = sSize.Replace("M", ""); iSize = Convert.ToDouble(sSize); iSize = iSize * 1024 * 1024; } at.Size = ((int)iSize).ToString(); at.TimeSize = ""; at.Title = file.Alias; at.Type = file.Type; at.Url = file.URL; sXml = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at); } #endregion /****完成生成Attachment节点******************************************************************/ return(sXml); }
protected void Page_Load(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; B_Circulate l_BusCirculate = null; DataTable l_dtbCirculate = null; DataTable l_dtbProcessSteps = null; String l_strRegisterID = null; M_ReceiveBase l_objWorkItem = null; //WFBaseProcessInstance l_objProcessInstance = null; if (!Page.IsPostBack) { this.ucAttachment.UCIsEditable = false; PreviousPageUrl = Request.UrlReferrer.ToString(); l_strRegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID]; l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID); if (l_BusReceiveEdit == null) { JScript.Alert("当前的ID或者无效,或者已经被删除!"); return; } this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName; PopulateReceiveField(l_BusReceiveEdit); if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID)) { divPrompt.Visible = true; return; } WFBaseProcessInstance fp = null; fp = WFFactory.GetWF(WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID); //l_objProcessInstance = AgilePointWF.GetAPI().GetProcInst(); if (fp != null) { ProcessTemplate = fp.DefName; String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(fp.DefName); l_BusCirculate = new B_Circulate(l_strCirculateTableName); l_dtbCirculate = l_BusCirculate.GetCirculatesByID(l_strCirculateTableName, l_BusReceiveEdit.ProcessID, 0); gdvCirculate.DataSource = l_dtbCirculate; gdvCirculate.DataBind(); string strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems; switch (fp.DefName) { case ProcessConstString.TemplateName.COMPANY_RECEIVE: l_objWorkItem = new B_GS_WorkItems(); strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems; break; default: strTableName = TableName.WorkItemsTableName.T_OA_MS_WorkItems; l_objWorkItem = new B_MergeReceiveBase(); break; } strTableName+=((fp.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || fp.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED)?"_BAK":""); l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, strTableName, l_objWorkItem); DataView l_dtvDataView = new DataView(l_dtbProcessSteps); l_dtvDataView.RowFilter = "D_StepStatus = 'Completed'"; rptProcessDetail.DataSource = l_dtvDataView; rptProcessDetail.DataBind(); } } }