/// <summary> /// 修改按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModify_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbExclamation, "请先选择一条收文记录!"); return; } if (!VerifyEditField()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败"); return; } l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (l_BusReceiveEdit.CreateDate == DateTime.MinValue) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "当前收文登记信息已经被删除,不能做修改动作!"); return; } PopulateEntity(l_BusReceiveEdit); if (l_BusReceiveEdit.Save()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbInformation, "保存成功"); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }
protected void Page_Load(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; B_Circulate l_BusCirculate = null; DataTable l_dtbCirculate = null; DataTable l_dtbProcessSteps = null; String l_strRegisterID = null; B_LetterReceive 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_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID); if (l_BusReceiveEdit == null) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "当前的ID或者无效,或者已经被删除!"); return; } this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName; PopulateField(l_BusReceiveEdit); if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID)) { divPrompt.Visible = true; return; } l_objProcessInstance = FS.OA.Framework.WorkFlow.WFFactory.GetWF(FS.OA.Framework.WorkFlow.WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID); if (l_objProcessInstance != null) { m_strProcessTemplate = l_objProcessInstance.DefName; String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(l_objProcessInstance.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(); l_objWorkItem = new B_LetterReceive(); l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, TableName.WorkItemsTableName.T_OA_HS_WorkItems + ((l_objProcessInstance.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || l_objProcessInstance.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED) ? "_BAK" : "")); DataView l_dtvDataView = new DataView(l_dtbProcessSteps); l_dtvDataView.RowFilter = "D_StepStatus = 'Completed'"; rptProcessDetail.DataSource = l_dtvDataView; rptProcessDetail.DataBind(); } } }
/// <summary> /// 根据传递的值绑定表单 /// </summary> /// <param name="ID">页面的传值</param> public void SetFormByID(string ID) { B_HSEdit l_BusReceiveEdit = new B_HSEdit(); if (m_ID != null) { l_BusReceiveEdit.ID = Convert.ToInt32(m_ID); PopulateEditField(l_BusReceiveEdit); } }
// public string GetCallbackResult() // { // // 返回服务器端处理结果给receiveServerResult方法 // return m_strResult; // } // public void RaiseCallbackEvent(string eventArgument) // { // // eventArgument是客户端传来的变量,对应arg变量 // // 在这里添加服务器端处理逻辑... // m_strResult = eventArgument; // if (m_strResult != "") // { // string strsql = "SELECT FileEncoding FROM T_OA_HS_Edit where fileencoding= '" + m_strResult + "'"; // DataTable dt = SQLHelper.GetDataTable1(strsql); // m_strResult = dt.Rows.Count.ToString(); // } // } // #endregion //} public void RaiseCallbackEvent(string eventArgument) { System.Text.RegularExpressions.Regex rex = new System.Text.RegularExpressions.Regex(@"^\d+$"); if (rex.IsMatch(eventArgument)) { B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(eventArgument); if (B_HSEdit.GetLastWorkItem(l_BusReceiveEdit.ProcessID) == ProcessConstString.SubmitAction.ACTION_CANCEL)//renjinquan修改 可以重新发起撤销的流程 { l_BusReceiveEdit.ProcessID = ""; B_HSEdit.CandelProcess(eventArgument); } //附件信息 if (!String.IsNullOrEmpty(l_BusReceiveEdit.FileData)) { List <CFuJian> l_objAttach = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData); l_BusReceiveEdit.FileData = SysString.FuJianList2Xml(l_objAttach); } StringWriter l_strWriter = new StringWriter(CultureInfo.InvariantCulture); JsonSerializer jsonSerializer = new JsonSerializer(); jsonSerializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; using (JsonWriter jsonWriter = new JsonWriter(l_strWriter)) { jsonSerializer.Serialize(jsonWriter, l_BusReceiveEdit); } Session["附件ListTemp"] = l_BusReceiveEdit.FileData; m_strCallBack = l_strWriter.ToString(); } else { string strsql = "SELECT FileEncoding FROM T_OA_HS_Edit where fileencoding= '" + eventArgument + "'"; DataTable dt = SQLHelper.GetDataTable1(strsql); m_strCallBack = dt.Rows.Count.ToString(); } }
/// <summary> /// 新增按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddNew_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; //表单的合法性验证 if (!VerifyEditField()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败"); return; } l_BusReceiveEdit = new B_HSEdit(); PopulateEntity(l_BusReceiveEdit); l_BusReceiveEdit.DocumentNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName); if (l_BusReceiveEdit.Save()) { JScript.ShowMsgBox(Page, "新增成功", false); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }
private void LoadRegisterList() { B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ProcessName = TemplateName; //收文号-从 l_BusReceiveEdit.ReceiveNoFrom = FormsMethod.Filter(txtQueryDocNoFrom.Text.TrimEnd()); //收文号-到 l_BusReceiveEdit.ReceiveNoTo = FormsMethod.Filter(txtQueryDocNoTo.Text.TrimEnd()); //文件标题 l_BusReceiveEdit.DocumentTitle = FormsMethod.Filter(txtQueryDocTitle.Text.TrimEnd()); //收文日期-从 if (ValidateUtility.IsDateTime(txtQueryRecDateFrom.Text.TrimEnd())) { l_BusReceiveEdit.ReceiveDateFrom = txtQueryRecDateFrom.ValDate; } //收文日期-到 if (ValidateUtility.IsDateTime(txtQueryRecDateTo.Text.TrimEnd())) { l_BusReceiveEdit.ReceiveDateTo = txtQueryRecDateTo.ValDate; } //来文单位 l_BusReceiveEdit.CommunicationUnit = FormsMethod.Filter(txtQueryRecUnit.Text.TrimEnd()); l_BusReceiveEdit.Start = gvRegisterList.PageIndex * gvRegisterList.PageSize; l_BusReceiveEdit.End = gvRegisterList.PageIndex * gvRegisterList.PageSize + gvRegisterList.PageSize; l_BusReceiveEdit.Sort = SortExpression; this.gvRegisterList.DataSource = l_BusReceiveEdit.QueryRegisterInfo(l_BusReceiveEdit); this.gvRegisterList.RecordCount = l_BusReceiveEdit.RowCount; this.gvRegisterList.DataBind(); }
/// <summary> /// 启动流程按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnLaunch_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbExclamation, "请先选择一条收文记录!"); return; } l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (!String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID)) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbExclamation, "当前选择的收文登记记录已经启动!"); return; } String l_strSuffix = ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text); Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_LetterReceived&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.LETTER_RECEIVE) + "&" + l_strSuffix, true); }
/// <summary> /// 用表单元素内容填充实体内容 /// </summary> /// <param name="l_BusReceiveEdit"></param> private void PopulateEntity(B_HSEdit l_BusReceiveEdit) { //单位 l_BusReceiveEdit.CommunicationUnit = txtReceiveUnit.Text.TrimEnd(); //文件编码 l_BusReceiveEdit.FileEncoding = txtDocumentEncoding.Text.TrimEnd(); //收文日期 if (ValidateUtility.IsDateTime(txtReceiveDate.Text.TrimEnd())) { l_BusReceiveEdit.ReceiptDate = Convert.ToDateTime(txtReceiveDate.Text.TrimEnd()); } //答复文号 l_BusReceiveEdit.ReplyDocumentNo = txtReplyDocumentNo.Text.TrimEnd(); //其他编码 l_BusReceiveEdit.OtherEncoding = txtOtherEncoding.Text.TrimEnd(); //行文日期 if (txtXingWenDate.Text == "" || !ValidateUtility.IsDateTime(txtXingWenDate.Text.TrimEnd())) { l_BusReceiveEdit.XingWenDate = DateTime.MinValue; } else { l_BusReceiveEdit.XingWenDate = Convert.ToDateTime(txtXingWenDate.Text.TrimEnd()); } //文件标题 l_BusReceiveEdit.DocumentTitle = txtDocumentTitle.Text.TrimEnd(); //函件类型 l_BusReceiveEdit.LetterType = ddlDocumentType.Text; //形成日期 if (ValidateUtility.IsDateTime(txtFormationDate.Text.TrimEnd())) { l_BusReceiveEdit.FormationDate = Convert.ToDateTime(txtFormationDate.Text.TrimEnd()); } //紧急程度 l_BusReceiveEdit.UrgentDegree = ddlUrgentDegree.Text.TrimEnd(); //页数 if (ValidateUtility.IsInt(txtPageCount.Text.TrimEnd())) { l_BusReceiveEdit.Pages = Convert.ToInt32(txtPageCount.Text.TrimEnd()); } //保管期限 l_BusReceiveEdit.KeepTime = ddlKeepTime.Text.TrimEnd(); //对应合同号 l_BusReceiveEdit.ContractNumber = txtContractNumber.Text.TrimEnd(); //设备代码 l_BusReceiveEdit.EquipmentCode = txtEquipmentCode.Text.TrimEnd(); //HN编码 l_BusReceiveEdit.HNCode = txtHNCode.Text.TrimEnd(); //流程名称 l_BusReceiveEdit.ProcessName = TemplateName; ////附件信息 l_BusReceiveEdit.FileData = XmlUtility.SerializeXml(this.ucAttachment.UCDataList); //备注 l_BusReceiveEdit.Remarks = this.txtRemark.Text;//renjinquan+ }
/// <summary> /// 用实体中的内容填充表单上编辑区域的内容 /// </summary> /// <param name="p_BusReceiveEdit"></param> private void PopulateEditField(B_HSEdit p_BusReceiveEdit) { //单位 txtReceiveUnit.Text = p_BusReceiveEdit.CommunicationUnit; //流程ID this.txtProcessID.Text = p_BusReceiveEdit.ProcessID; this.btnDetail.Enabled = !string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); this.btnLaunch.Enabled = string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); this.btnSecFF.Enabled = !string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); //收文号 txtDocumentNo.Text = p_BusReceiveEdit.DocumentNo; //文件编码 txtDocumentEncoding.Text = p_BusReceiveEdit.FileEncoding; //收文日期 txtReceiveDate.Text = p_BusReceiveEdit.ReceiptDate.ToString("yyyy-MM-dd"); //答复文号 txtReplyDocumentNo.Text = p_BusReceiveEdit.ReplyDocumentNo; //其他编码 txtOtherEncoding.Text = p_BusReceiveEdit.OtherEncoding; //行文日期 if (!ValidateUtility.IsDateTime(p_BusReceiveEdit.XingWenDate.ToString()) || p_BusReceiveEdit.XingWenDate == DateTime.MinValue)//任金权修改,为了实现为空 { txtXingWenDate.Text = ""; } else { txtXingWenDate.Text = p_BusReceiveEdit.XingWenDate.ToString("yyyy-MM-dd"); } //文件标题 txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle; //函件类型 ddlDocumentType.Text = p_BusReceiveEdit.LetterType; //形成日期 txtFormationDate.Text = p_BusReceiveEdit.FormationDate.ToString("yyyy-MM-dd"); //紧急程度 ddlUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree; //页数 if (p_BusReceiveEdit.Pages == int.MinValue) { txtPageCount.Text = String.Empty; } else { txtPageCount.Text = p_BusReceiveEdit.Pages.ToString(); } //保管期限 ddlKeepTime.Text = p_BusReceiveEdit.KeepTime; //对应合同号 txtContractNumber.Text = p_BusReceiveEdit.ContractNumber; //设备代码 txtEquipmentCode.Text = p_BusReceiveEdit.EquipmentCode; //HN编码 txtHNCode.Text = p_BusReceiveEdit.HNCode; ////附件信息 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(p_BusReceiveEdit.FileData); // txtRegisterID.Text = p_BusReceiveEdit.ID.ToString(); //备注信息 this.txtRemark.Text = p_BusReceiveEdit.Remarks;//renjinquan+ }
private string Devovle2DP2(HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; List<FounderSoftware.ADIM.OA.OA2DP.DevKVItem> ls = hn_oa2dp.MapFunction("DP", base.TemplateName); FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.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; ar.SetAttribute(skey, hn_oa2dp.PreHandel(l_BusReceiveEdit, 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 = "函件收文";//file.FileName; 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; }
/// <summary> /// 用实体中的内容填充表单上编辑区域的内容 /// </summary> /// <param name="p_BusReceiveEdit"></param> private void PopulateField(B_HSEdit p_BusReceiveEdit) { //单位 txtReceiveUnit.Text = p_BusReceiveEdit.CommunicationUnit; //收文号 txtDocumentNo.Text = p_BusReceiveEdit.DocumentNo; //文件编码 txtDocumentEncoding.Text = p_BusReceiveEdit.FileEncoding; //收文日期 txtReceiveDate.Text = p_BusReceiveEdit.ReceiptDate.ToString("yyyy-MM-dd"); //答复文号 txtReplyDocumentNo.Text = p_BusReceiveEdit.ReplyDocumentNo; //其他编码 txtOtherEncoding.Text = p_BusReceiveEdit.OtherEncoding; //行文日期 txtXingWenDate.Text = p_BusReceiveEdit.XingWenDate != DateTime.MinValue ? p_BusReceiveEdit.XingWenDate.ToString("yyyy-MM-dd") : ""; //文件标题 txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle; //函件类型 txtDocumentType.Text = OAList.GetHJName(p_BusReceiveEdit.LetterType);//任金权修改2009115 只显示编号不能显示名称 //形成日期 txtFormationDate.Text = p_BusReceiveEdit.FormationDate != DateTime.MinValue ? p_BusReceiveEdit.FormationDate.ToString("yyyy-MM-dd") : ""; //紧急程度 txtUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree; //页数 if (p_BusReceiveEdit.Pages == int.MinValue) { txtPageCount.Text = String.Empty; } else { txtPageCount.Text = p_BusReceiveEdit.Pages.ToString(); } //保管期限 txtKeepTime.Text = p_BusReceiveEdit.KeepTime; //对应合同号 txtContractNumber.Text = p_BusReceiveEdit.ContractNumber; //设备代码 txtEquipmentCode.Text = p_BusReceiveEdit.EquipmentCode; //HN编码 txtHNCode.Text = p_BusReceiveEdit.HNCode; //备注 txtRemark.Text = p_BusReceiveEdit.Remarks; //附件信息 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(p_BusReceiveEdit.FileData); }
private string Devovle2DP2(HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; List <FounderSoftware.ADIM.OA.OA2DP.DevKVItem> ls = hn_oa2dp.MapFunction("DP", base.TemplateName); FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.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; ar.SetAttribute(skey, hn_oa2dp.PreHandel(l_BusReceiveEdit, 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 = "函件收文";//file.FileName; 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 = ""; FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); //if (String.IsNullOrEmpty(this.id)) return ""; B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); //l_BusReceiveEdit.Load(Convert.ToInt32(REGISTER_ID)); #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; } // 编制单位-单位 ar.FormationDept = l_BusReceiveEdit.CommunicationUnit; // 题名-文件标题 ar.Title = l_BusReceiveEdit.DocumentTitle; // 收文号-收文号 ar.ReceiveCode = l_BusReceiveEdit.DocumentNo; // 通讯渠道号-文件编码 ar.CommunicationChannelCode = l_BusReceiveEdit.FileEncoding; // 纸质文件接收日期-收文日期 ar.PaperDocumentTransceiverTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.ReceiptDate.ToString()); // 批准日期-形成日期 ar.AuthorizeTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.FormationDate.ToString()); // 缓急程度-紧急程度 ar.Pace = l_BusReceiveEdit.UrgentDegree; // 页数-页数 ar.DocPages = l_BusReceiveEdit.Pages.ToString(); // 拟办人-拟办人 ar.Proposer = txtPlotMember.Text; // 拟办日期-拟办日期 ar.ProposeDate = txtPlotTime.Text; // 批示人-公司领导 ar.Instructioner = txtLeadShipName.Text; // 批示日期-批示日期 ar.InstructionDate = txtLeadShipTime.Text; // 承办部门-承办部门 ar.UndertakeDepartment = txtUnderTake.Text; // 登记时间 ar.ImporterTime = DateTime.Now.ToString(); // 公共常量 //ar.GatherLevel = "件"; //ar.D_StorageCarrierType = "纸质"; //ar.Amount = "1"; //ar.D_Language = "中文"; ar.ElectronicDocumentCount = l_BusReceiveEdit.FileList.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 < l_BusReceiveEdit.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = l_BusReceiveEdit.FileList[i]; at.DocumentName = "函件收文";//file.FileName; 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); }
/// <summary> /// 用实体中的内容填充表单上编辑区域的内容 /// </summary> /// <param name="p_BusReceiveEdit"></param> private void PopulateEditField(B_HSEdit p_BusReceiveEdit) { //单位 txtReceiveUnit.Text = p_BusReceiveEdit.CommunicationUnit; //流程ID this.txtProcessID.Text = p_BusReceiveEdit.ProcessID; this.btnDetail.Enabled = !string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); this.btnLaunch.Enabled = string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); this.btnSecFF.Enabled = !string.IsNullOrEmpty(p_BusReceiveEdit.ProcessID); //收文号 txtDocumentNo.Text = p_BusReceiveEdit.DocumentNo; //文件编码 txtDocumentEncoding.Text = p_BusReceiveEdit.FileEncoding; //收文日期 txtReceiveDate.Text = p_BusReceiveEdit.ReceiptDate.ToString("yyyy-MM-dd"); //答复文号 txtReplyDocumentNo.Text = p_BusReceiveEdit.ReplyDocumentNo; //其他编码 txtOtherEncoding.Text = p_BusReceiveEdit.OtherEncoding; //行文日期 if (!ValidateUtility.IsDateTime(p_BusReceiveEdit.XingWenDate.ToString()) || p_BusReceiveEdit.XingWenDate == DateTime.MinValue)//任金权修改,为了实现为空 { txtXingWenDate.Text = ""; } else { txtXingWenDate.Text = p_BusReceiveEdit.XingWenDate.ToString("yyyy-MM-dd"); } //文件标题 txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle; //函件类型 ddlDocumentType.Text = p_BusReceiveEdit.LetterType; //形成日期 txtFormationDate.Text = p_BusReceiveEdit.FormationDate.ToString("yyyy-MM-dd"); //紧急程度 ddlUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree; //页数 if (p_BusReceiveEdit.Pages == int.MinValue) { txtPageCount.Text = String.Empty; } else { txtPageCount.Text = p_BusReceiveEdit.Pages.ToString(); } //保管期限 ddlKeepTime.Text = p_BusReceiveEdit.KeepTime; //对应合同号 txtContractNumber.Text = p_BusReceiveEdit.ContractNumber; //设备代码 txtEquipmentCode.Text = p_BusReceiveEdit.EquipmentCode; //HN编码 txtHNCode.Text = p_BusReceiveEdit.HNCode; ////附件信息 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(p_BusReceiveEdit.FileData); // txtRegisterID.Text = p_BusReceiveEdit.ID.ToString(); //备注信息 this.txtRemark.Text = p_BusReceiveEdit.Remarks;//renjinquan+ }
private string Devolve2DC2(HN_OA2DC oaDev) { string sXml = ""; List <FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", base.TemplateName); FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); //if (String.IsNullOrEmpty(this.id)) return ""; B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); //l_BusReceiveEdit.Load(Convert.ToInt32(REGISTER_ID)); B_LetterReceive pEntity = ControlToEntity(false) as B_LetterReceive; #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(l_BusReceiveEdit, sName, sType); if (string.IsNullOrEmpty(value)) { value = oaDev.PreHandel(pEntity, sName, sType); } ar.SetAttribute(skey, value /*(entity.GetVal(sName) as string)*/); } ar.SetOAArchiveNode(); // 其他节点处理应放置在SetOAArchiveNode方法之后 //return Devolve2DP(oaDev, sDPID, ar); #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点 ar.ElectronicDocumentCount = pEntity.FileList.Count.ToString(); //l_BusReceiveEdit.FileList.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 < pEntity.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = pEntity.FileList[i]; at.DocumentName = "函件收文";//file.FileName; 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); }
// public string GetCallbackResult() // { // // 返回服务器端处理结果给receiveServerResult方法 // return m_strResult; // } // public void RaiseCallbackEvent(string eventArgument) // { // // eventArgument是客户端传来的变量,对应arg变量 // // 在这里添加服务器端处理逻辑... // m_strResult = eventArgument; // if (m_strResult != "") // { // string strsql = "SELECT FileEncoding FROM T_OA_HS_Edit where fileencoding= '" + m_strResult + "'"; // DataTable dt = SQLHelper.GetDataTable1(strsql); // m_strResult = dt.Rows.Count.ToString(); // } // } // #endregion //} public void RaiseCallbackEvent(string eventArgument) { System.Text.RegularExpressions.Regex rex = new System.Text.RegularExpressions.Regex(@"^\d+$"); if (rex.IsMatch(eventArgument)) { B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(eventArgument); if (B_HSEdit.GetLastWorkItem(l_BusReceiveEdit.ProcessID) == ProcessConstString.SubmitAction.ACTION_CANCEL)//renjinquan修改 可以重新发起撤销的流程 { l_BusReceiveEdit.ProcessID = ""; B_HSEdit.CandelProcess(eventArgument); } //附件信息 if (!String.IsNullOrEmpty(l_BusReceiveEdit.FileData)) { List<CFuJian> l_objAttach = XmlUtility.DeSerializeXml<List<CFuJian>>(l_BusReceiveEdit.FileData); l_BusReceiveEdit.FileData = SysString.FuJianList2Xml(l_objAttach); } StringWriter l_strWriter = new StringWriter(CultureInfo.InvariantCulture); JsonSerializer jsonSerializer = new JsonSerializer(); jsonSerializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; using (JsonWriter jsonWriter = new JsonWriter(l_strWriter)) { jsonSerializer.Serialize(jsonWriter, l_BusReceiveEdit); } Session["附件ListTemp"] = l_BusReceiveEdit.FileData; m_strCallBack = l_strWriter.ToString(); } else { string strsql = "SELECT FileEncoding FROM T_OA_HS_Edit where fileencoding= '" + eventArgument + "'"; DataTable dt = SQLHelper.GetDataTable1(strsql); m_strCallBack = dt.Rows.Count.ToString(); } }
private string Devolve2DC2(HN_OA2DC oaDev) { string sXml = ""; List<FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", base.TemplateName); FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); //if (String.IsNullOrEmpty(this.id)) return ""; B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); //l_BusReceiveEdit.Load(Convert.ToInt32(REGISTER_ID)); B_LetterReceive pEntity = ControlToEntity(false) as B_LetterReceive; #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(l_BusReceiveEdit, sName, sType); if (string.IsNullOrEmpty(value)) { value = oaDev.PreHandel(pEntity, sName, sType); } ar.SetAttribute(skey, value/*(entity.GetVal(sName) as string)*/); } ar.SetOAArchiveNode(); // 其他节点处理应放置在SetOAArchiveNode方法之后 //return Devolve2DP(oaDev, sDPID, ar); #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点 ar.ElectronicDocumentCount = pEntity.FileList.Count.ToString(); //l_BusReceiveEdit.FileList.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 < pEntity.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = pEntity.FileList[i]; at.DocumentName = "函件收文";//file.FileName; 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; }
private string Devolve2DC(HN_OA2DC oaDev) { string sXml = ""; FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); //if (String.IsNullOrEmpty(this.id)) return ""; B_HSEdit l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text)); //l_BusReceiveEdit.Load(Convert.ToInt32(REGISTER_ID)); #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; } // 编制单位-单位 ar.FormationDept = l_BusReceiveEdit.CommunicationUnit; // 题名-文件标题 ar.Title = l_BusReceiveEdit.DocumentTitle; // 收文号-收文号 ar.ReceiveCode = l_BusReceiveEdit.DocumentNo; // 通讯渠道号-文件编码 ar.CommunicationChannelCode = l_BusReceiveEdit.FileEncoding; // 纸质文件接收日期-收文日期 ar.PaperDocumentTransceiverTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.ReceiptDate.ToString()); // 批准日期-形成日期 ar.AuthorizeTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.FormationDate.ToString()); // 缓急程度-紧急程度 ar.Pace = l_BusReceiveEdit.UrgentDegree; // 页数-页数 ar.DocPages = l_BusReceiveEdit.Pages.ToString(); // 拟办人-拟办人 ar.Proposer = txtPlotMember.Text; // 拟办日期-拟办日期 ar.ProposeDate = txtPlotTime.Text; // 批示人-公司领导 ar.Instructioner = txtLeadShipName.Text; // 批示日期-批示日期 ar.InstructionDate = txtLeadShipTime.Text; // 承办部门-承办部门 ar.UndertakeDepartment = txtUnderTake.Text; // 登记时间 ar.ImporterTime = DateTime.Now.ToString(); // 公共常量 //ar.GatherLevel = "件"; //ar.D_StorageCarrierType = "纸质"; //ar.Amount = "1"; //ar.D_Language = "中文"; ar.ElectronicDocumentCount = l_BusReceiveEdit.FileList.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 < l_BusReceiveEdit.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = l_BusReceiveEdit.FileList[i]; at.DocumentName = "函件收文";//file.FileName; 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; }
/// <summary> /// 实体填充控件 /// </summary> protected override void EntityToControl() { B_LetterReceive rentity = base.EntityData != null ? base.EntityData as B_LetterReceive : new B_LetterReceive(); this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID]; if (!String.IsNullOrEmpty(this.RegisterID)) { B_HSEdit hsedit = new B_HSEdit(); hsedit.ID = Convert.ToInt32(this.RegisterID); if (hsedit == null) { JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle"); return; } #region 函件收文基本信息 this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(hsedit.FileData); this.txtReceiveNo.Text = hsedit.DocumentNo; this.txtReceiveTime.Text = hsedit.ReceiptDate.ToString(ConstString.DateFormat.Normal); this.txtUrgentDegree.Text = hsedit.UrgentDegree; this.txtFileEncoding.Text = hsedit.FileEncoding; this.txtCommunicationUnit.Text = hsedit.CommunicationUnit; this.txtDocumentTitle.Text = hsedit.DocumentTitle; this.txtRemark.Text = hsedit.Remarks; this.txtPageNum.Text = hsedit.Pages.ToString(); #endregion } else { #region 函件收文基本信息 this.ucAttachment.UCDataList = rentity.FileList; //实体绑定到控件时赋值 this.txtReceiveNo.Text = rentity.DocumentNo; this.txtReceiveTime.Text = rentity.ReceiptDate.ToString(ConstString.DateFormat.Normal); this.txtReceiveDate.Text = rentity.ReceiptDate.ToString(ConstString.DateFormat.Normal); this.txtUrgentDegree.Text = rentity.UrgentDegree; this.ddlJinJi.SelectedValue = rentity.UrgentDegree; this.txtFileEncoding.Text = rentity.FileEncoding; this.txtCommunicationUnit.Text = rentity.CommunicationUnit; this.txtDocumentTitle.Text = rentity.DocumentTitle; this.txtRemark.Text = rentity.Remarks; this.txtPageNum.Text = rentity.Pages; #endregion } if (this.StepName == ProcessConstString.StepName.LetterReceiveStepName.STEP_CHECK)//公司领导 { this.ddlLeadShip.SelectedValue = rentity.LeaderShip; } else { this.ddlLeadShip.Items.Add(new ListItem(rentity.LeaderShipName, rentity.LeaderShip)); } #region 拟办 //拟办人 this.txtPlotMember.Text = rentity.NiBanRenName; //传阅领导 this.txtCirculateLeader.Text = rentity.ChuanYueLeader; //承办部门 this.txtUnderTake.Text = rentity.UnderTake; //拟办时间 if (this.txtPlotMember.Text != string.Empty) { this.txtPlotTime.Text = rentity.NiBanDate; } //传阅部门 this.txtCirculateDeptName.Text = rentity.ChuanYueDept; //协办部门 this.txtAssistance.Text = rentity.AssistDeptName; //拟办人意见 this.txtPlotComment.Text = rentity.NiBanComment; //ListItem lt = new ListItem(rentity.LeaderShipName, rentity.LeaderShip); //if (!(this.ddlLeadShip.Items.Contains(lt))) //{ // this.ddlLeadShip.Items.Add(lt); //} //else //{ // this.ddlLeadShip.Items.Add(lt); //} //公司领导 //this.ddlLeadShip.SelectedValue = rentity.LeaderShip; #endregion #region 公司领导批示 this.txtLeadShipName.Text = rentity.LeaderShipName; this.txtLeadShipTime.Text = rentity.LS_Date; this.txtLSComment.Text = rentity.LS_Comment; this.txtLeaderComment.Text = rentity.LS_CommentAdd; #endregion #region 承办 this.txtAssign.Text = rentity.UnderTake; this.txtUnderTakeComment.Text = rentity.UnderTake_Comment; //if (base.StepName == ProcessConstString.StepName.LetterReceiveStepName.STEP_SECTION_DIRECTOR) //{ // this.txtUDDeptLeader.Text = rentity.UDDeptLeadName; //} //else //{ this.txtUDDeptLeader.Text = rentity.UDDeptLeadName; //} //if (base.StepName == ProcessConstString.StepName.LetterReceiveStepName.STEP_SECTION_CHIEF) //{ // this.txtUDSectionLeader.Text = CurrentUserInfo.DisplayName; //} //else //{ this.txtUDSectionLeader.Text = rentity.UDSectionLeadName; //} this.txtUDDeptLeaderTime.Text = rentity.UDDeptLeadNameTime; this.txtUDSectionLeaderTime.Text = rentity.UDSectionLeadNameTime; this.lblchushi.Text = rentity.UDDeptLeadName + "<br>" + rentity.UDDeptLeadNameTime; this.lblkeshi.Text = rentity.UDSectionLeadName + "<br>" + rentity.UDSectionLeadNameTime; this.lblrenyuan.Text = rentity.UDSectionPeopleName + "<br>" + rentity.UDSectionPeopleNameTime; this.txtUDPeopleTime.Text = rentity.UDSectionPeopleNameTime; this.txtUDPeople.Text = rentity.UDSectionPeopleName; #endregion #region 传阅 this.txtCirculatePerson.Text = rentity.CirculateUserName; this.txtCirculateComment.Text = rentity.CirculateUserComment; this.ucAttachment.UCIsEditable = false; #endregion //拟稿处理后显示label形式的拟稿人姓名与时间 if (rentity.NiBanDate != "" && rentity.NiBanDate != null) { //this.txtPlotMember.Visible = false; //this.lbPlotMember.Visible = true; //this.lbPlotMember.Text = rentity.NiBanRenName;// +strNewLine + rentity.NiBanDate; this.txtPlotMember.Visible = true; this.lbPlotMember.Visible = false; this.txtPlotMember.Text = rentity.NiBanRenName;// +strNewLine + rentity.NiBanDate; this.txtPlotMemberID.Text = rentity.NiBanRen; this.txtPlotTime.Visible = false; this.lbPlotTime.Visible = true; this.lbPlotTime.Text = rentity.NiBanDate; } //领导;批示处理后显示label形式的领导人姓名与时间 if (rentity.LS_Date != "" && rentity.LS_Date != null) { this.txtLeadShipName.Visible = false; this.lbLeadShipName.Visible = true; this.lbLeadShipName.Text = rentity.LeaderShipName;// +strNewLine + rentity.LS_Date; this.txtLeadShipTime.Visible = false; this.lbLeadShipTime.Visible = true; this.lbLeadShipTime.Text = rentity.LS_Date; } //处室领导承办后显示label形式的领导人姓名与时间 if (rentity.UDDeptLeadNameTime != "" && rentity.UDDeptLeadNameTime != null) { this.txtUDDeptLeader.Visible = false; this.lblchushi.Visible = true; this.lblchushi.Text = rentity.UDDeptLeadName;// +strNewLine + rentity.UDDeptLeadNameTime; this.txtUDDeptLeaderTime.Visible = false; this.lbUDDetpLeaderTime.Visible = true; this.lbUDDetpLeaderTime.Text = rentity.UDDeptLeadNameTime; } //科室领导承办后显示label形式的领导人姓名与时间 if (rentity.UDSectionLeadNameTime != "" && rentity.UDSectionLeadNameTime != null) { //this.txtLeadShipName.Visible = false; this.lblkeshi.Visible = true; this.lblkeshi.Text = rentity.UDSectionLeadName;// +strNewLine + rentity.UDSectionLeadNameTime; this.txtUDSectionLeaderTime.Visible = false; this.lbUDSectionLeaderTime.Visible = true; this.lbUDSectionLeaderTime.Text = rentity.UDSectionLeadNameTime; } //直接承办人承办后显示label形式的承办人姓名与时间 if (rentity.UDSectionPeopleNameTime != "" && rentity.UDSectionPeopleNameTime != null) { //this.txtUDPeople.Visible = false; this.lblrenyuan.Visible = true; this.lblrenyuan.Text = rentity.UDSectionPeopleName;// +strNewLine + rentity.UDSectionPeopleNameTime; this.txtUDPeopleTime.Visible = false; this.lbUDPeopleTime.Visible = true; this.lbUDPeopleTime.Text = rentity.UDSectionPeopleNameTime; } }