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_Finance entity = this.ControlToEntity(false) as B_Finance; entity.FormsData = XmlUtility.SerializeXml(entity); //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(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 = "请示报告";//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="sender"></param> /// <param name="e"></param> protected void btnUpload_Click(object sender, EventArgs e) { try { if (String.IsNullOrEmpty(UCProcessType)) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, "文档库设置不能为空!"); return; } if (multiFile.Files.Length <= 0) { return; } foreach (UploadedFile file in multiFile.Files) { if (file.FileName.Contains("#") || file.FileName.Contains("'")) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "含有特殊字符,请替换后再上传"); JScript.ResponseScript(this, "javascript:__doPostBack('LinkButton1','')"); return; } } foreach (UploadedFile file in multiFile.Files) { if (file.ContentLength <= MossObject.maxFileSize * 1024 * 1024) { MossObject attach = new MossObject(); attach.ServerWeb= OAConfig.GetConfig("MOSS认证", "ServerWeb"); attach.OldFileName = file.FileName; attach.DocumentName = UCProcessType; #region 更新栏位 List<DictionaryEntry> lst = new List<DictionaryEntry>(); DictionaryEntry de = new DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new DictionaryEntry(); de.Key = "别名"; de.Value = file.FileName; lst.Add(de); de = new DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion DictionaryEntry[] result = attach.ConvertToDE(lst.ToArray()); attach.DocumentEntry = result; //文件扩展名 string fileType = System.IO.Path.GetExtension(file.FileName); if (fileType.IndexOf('.') == 0) { fileType = fileType.Substring(1); } bool IsSuccess = false; if ("exe,dll".Contains(fileType.ToLower())) { IMessage im = new WebFormMessage(Page, "不可上传exe或dll文件!"); im.Show(); IsSuccess = false; } else { attach.UploadFilesStream = file.InputStream; //上传附件并更新栏位 IsSuccess = attach.Upload(); } if (IsSuccess) { CFuJian ff = new CFuJian(); ff.Type = System.IO.Path.GetExtension(attach.FileName); if (ff.Type.IndexOf('.') == 0) { ff.Type = ff.Type.Substring(1); } ff.Title = attach.FileName; ff.Alias = System.IO.Path.GetFileNameWithoutExtension(attach.OldFileName); ff.FolderName = attach.FolderName; ff.FileName = attach.FileName; ff.Size = attach.ToFileSize_new(file.ContentLength); //文件大小 ff.ProcessType = UCProcessType; ff.WorkItemID = UCWorkItemID; ff.fullURL = attach.UploadFullName; //全路径 ff.URL = attach.UploadURL;//文件夹+/文件名 UCDataList.Add(ff); } //CFuJian l_objAttachment = MossObject.Upload(file, UCProcessType, UCProcessID, UCWorkItemID); //UCDataList.Add(l_objAttachment); } else { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "大小超过" + MossObject.maxFileSize + "M"); } } RepeaterFiles.DataSource = UCDataList; RepeaterFiles.DataBind(); RunScript(); } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } }
private string Devolve2DC(HN_OA2DC oaDev) { string sXml = ""; List <FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", base.TemplateName); B_Finance entity = this.ControlToEntity(false) as B_Finance; entity.FormsData = XmlUtility.SerializeXml(entity); 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; 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 = "请示报告";//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 Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; B_Finance entity = this.ControlToEntity(false) as B_Finance; #region ArchiveNode FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); ar.System = "OA_" + base.IdentityID.ToString(); ar.FK_DPID = sDPID; ar.UndertakeDepartment = entity.BianZhiBuMenID; ar.Title = entity.DocumentTitle; ar.MainDispenseUnit = entity.MainSend; ar.RelatedDespenseUnit = entity.CopySend; ar.FormationDept = entity.Department; ar.EffectTime = entity.ConfirmDate.ToShortDateString(); ar.Auditby = entity.CheckDrafter; ar.AuditDate = entity.CheckDate.ToShortDateString(); ar.Author = entity.Drafter; 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(); //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; } // Pace-缓急程度 ar.Pace = chkJinJi.Checked ? "0" : "1"; // 页数 ar.DocPages = txtPages.Text; // 通讯渠道号 ar.CommunicationChannelCode = txtOurRef.Text; #region 签发人 签发日期 if (txtSignDate.Text != "") { if (txtSignDate.Text.Contains(" ")) { //签发日期-批准日期 ar.AuthorizeTime = txtSignDate.Text.Split(' ')[1]; } else { //签发日期-批准日期 ar.AuthorizeTime = txtSignDate.Text; } //签发人-批准者 ar.Authorizer = txtQianFaRen.Text; } #endregion // 会签日期 if (txtHuiQianRenDates.Text != "") { //if (txtHuiQianRenDates.Text.Contains(" ")) //{ // ar.CountersignedDate = txtHuiQianRenDates.Text.Split(' ')[1]; //} //else //{ // ar.CountersignedDate = txtHuiQianRenDates.Text; //} // 会签者 ar.Countersigner = txtHuiQianRenDates.Text;//txtHuiQianRen.Text; } #region 核稿人-校核者 //核稿人-校核者 if (txtHeGaoRenDate.Text != "") { if (txtHeGaoRenDate.Text.Contains(" ")) { //核稿日期-校核日期 ar.CheckDate = txtHeGaoRenDate.Text.Split(' ')[1]; } else { //核稿日期-校核日期 ar.CheckDate = txtHeGaoRenDate.Text; } //核稿人-校核者 ar.Checkthose = txtHeGaoRenDate.Text; } #endregion // 编制人/编制日期 //TODO:归档编制人/编制日期 ar.Author = wfFaQiRen.Text; ar.FormationTime = ""; // 编制单位 ar.FormationDept = drpSendDept.SelectedItem.Text; // 题名 ar.Title = txtSubject.Text; // 主送单位 ar.MainDispenseUnit = txtCompany.Text; // 抄送单位 ar.RelatedDespenseUnit = txtccCompany.Text; // 备注 ar.Remark = txtComment.Text; //ar.FK_CategoryID = "903"; // 公共常量 //ar.GatherLevel = "件"; //ar.D_StorageCarrierType = "纸质"; //ar.Amount = "1"; //ar.D_Language = "中文"; 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 = "函件发文";//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 Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; #region ArchiveNode FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); List <FounderSoftware.ADIM.OA.OA2DP.DevKVItem> ls = hn_oa2dp.MapFunction("DP", base.TemplateName); EntityLetterSend entity = this.ControlToEntity(false) as EntityLetterSend; 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(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归档节点 #region 注释保留 /* * // Pace-缓急程度 * //ar.Pace = chkJinJi.Checked ? "0" : "1"; * // 页数 * ar.DocPages = txtPages.Text; * // 通讯渠道号 * ar.CommunicationChannelCode = txtOurRef.Text; #region 签发人 签发日期 * if (txtSignDate.Text != "") * { * if (txtSignDate.Text.Contains(" ")) * { * //签发日期-批准日期 * ar.AuthorizeTime = txtSignDate.Text.Split(' ')[1]; * } * else * { * //签发日期-批准日期 * ar.AuthorizeTime = txtSignDate.Text; * } * //签发人-批准者 * ar.Authorizer = txtQianFaRen.Text; * } #endregion * // 会签者 * //ar.Countersigner = txtHuiQianRen.Text; * // 会签日期 * //ar.CountersignedDate = txtHuiQianRenDates.Text; #region 核稿人-校核者 * ////核稿人-校核者 * //if (txtHeGaoRenDate.Text != "") * //{ * // if (txtHeGaoRenDate.Text.Contains(" ")) * // { * // //核稿日期-校核日期 * // ar.CheckDate = txtHeGaoRenDate.Text.Split(' ')[1]; * // } * // else * // { * // //核稿日期-校核日期 * // ar.CheckDate = txtHeGaoRenDate.Text; * // } * // //核稿人-校核者 * // ar.Checkthose = txtHeGaoRenDate.Text; * //} #endregion * // 编制人/编制日期 * // 编制单位 * ar.FormationDept = drpSendDept.SelectedItem.Text; * // 题名 * ar.Title = txtSubject.Text; * // 主送单位 * ar.MainDispenseUnit = txtCompany.Text; * // 抄送单位 * ar.RelatedDespenseUnit = txtccCompany.Text; * // 备注 * ar.Remark = txtComment.Text; * //ar.FK_CategoryID = "903"; * // 公共常量 * //ar.GatherLevel = "件"; * //ar.D_StorageCarrierType = "纸质"; * //ar.Amount = "1"; * //ar.D_Language = "中文"; * */ #endregion 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); }
public static CFuJian Upload(UploadedFile file, string UCProcessType, string UCProcessID, string UCWorkItemID) { CFuJian cFuJian = new CFuJian(); OA_DocumentService api = MossObject.GetMOSSAPI(); string[] fileInfo = GetUploadFileInfo(UCProcessType, file.FileName); cFuJian.Type = System.IO.Path.GetExtension(file.FileName); //文件类型 扩展名 if (cFuJian.Type.IndexOf('.') > -1) { cFuJian.Type = cFuJian.Type.Substring(1); } cFuJian.Alias = file.FileName.Substring(0, file.FileName.Length - cFuJian.Type.Length - 1); //别名 //ff.Title = ff.Alias + "." + ff.Type; cFuJian.Title = fileInfo[3]; if (cFuJian.Type.Length == 0)//没有扩展名 { cFuJian.Alias = file.FileName; } cFuJian.Alias = cFuJian.Alias.Replace(" ", ""); cFuJian.FolderName = fileInfo[2]; cFuJian.FileName = fileInfo[3]; cFuJian.Size = MossObject.ToFileSize(file.ContentLength); //文件大小 cFuJian.ProcessType = UCProcessType; cFuJian.WorkItemID = UCWorkItemID; string[] saveUrl; #region DLL if (OAConfig.GetConfig("MOSS认证", "是否启用DLL") == "1") { #region 更新栏位 List <System.Collections.DictionaryEntry> lst = new List <System.Collections.DictionaryEntry>(); System.Collections.DictionaryEntry de = new System.Collections.DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new System.Collections.DictionaryEntry(); de.Key = "别名"; de.Value = cFuJian.Alias; lst.Add(de); de = new System.Collections.DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion System.Collections.DictionaryEntry[] result = DocumentManager.ConvertToDE(lst.ToArray()); if (file.ContentLength <= MossObject.middleFileSize * 1024 * 1024) { saveUrl = DocumentManager.Upload(fileInfo, MossObject.StreamToBytes(file.InputStream), result, false); } else { string strFileTemp = "D:\\FileTemp\\"; if (System.IO.Directory.Exists(strFileTemp) == false) { System.IO.Directory.CreateDirectory(strFileTemp); } string fileTemp = strFileTemp + "OA" + Current.UserName + Path.GetFileNameWithoutExtension(file.TmpFile.Name); string filePath = fileTemp + file.FileName; p1: if (System.IO.File.Exists(filePath)) { filePath = fileTemp + new Random(1).Next(100).ToString() + file.FileName; goto p1; } else { file.TmpFile.MoveTo(filePath); } saveUrl = DocumentManager.Upload(fileInfo, filePath, result, false); File.Delete(filePath); } ////int ret = api.CopyTo(fileInfo, "322.doc", true); //file.TmpFile.Delete(); //删除临时文件 //cFuJian.fullURL = saveUrl[0]; //全路径 //cFuJian.URL = saveUrl[1];//文件夹+/文件名 //cFuJian.Encode = "";//文件编码 //return cFuJian; } #endregion #region webservice else { #region 更新栏位 List <DictionaryEntry> lst = new List <DictionaryEntry>(); DictionaryEntry de = new DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new DictionaryEntry(); de.Key = "别名"; de.Value = cFuJian.Alias; lst.Add(de); de = new DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion DictionaryEntry[] result = api.ConvertToDE(lst.ToArray()); if (file.ContentLength <= MossObject.middleFileSize * 1024 * 1024) { //上传到文档库 saveUrl = api.Upload(fileInfo, MossObject.StreamToBytes(file.InputStream), result, false); } else { string strFileTemp = "D:\\FileTemp\\"; if (System.IO.Directory.Exists(strFileTemp) == false) { System.IO.Directory.CreateDirectory(strFileTemp); } string fileTemp = strFileTemp + "OA" + Current.UserName + Path.GetFileNameWithoutExtension(file.TmpFile.Name); string filePath = fileTemp + file.FileName; p1: if (System.IO.File.Exists(filePath)) { filePath = fileTemp + new Random(1).Next(100).ToString() + file.FileName; goto p1; } else { file.TmpFile.MoveTo(filePath); } saveUrl = api.Upload_New(fileInfo, filePath, result, false); File.Delete(filePath); } } #endregion file.TmpFile.Delete(); //删除临时文件 cFuJian.fullURL = saveUrl[0]; //全路径 cFuJian.URL = saveUrl[1]; //文件夹+/文件名 cFuJian.Encode = ""; //文件编码 return(cFuJian); }
private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; B_GS_WorkItems entity = this.ControlToEntity(false) as B_GS_WorkItems; 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 = "公司收文";//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 Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID) { string sXml = ""; B_WorkRelation entity = ControlToEntity(false) as B_WorkRelation; #region ArchiveNode FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode(); ar.System = "OA_" + base.IdentityID.ToString(); ar.FK_DPID = sDPID; //ar.Amount = ""; //ar.Area = ""; //ar.Author = entity.Drafter; //ar.Authorizer = entity.DeptPrincipal; //ar.AuthorizeTime = entity.ConfirmDate.ToShortDateString(); //ar.CallBackWebServiceMethod = ""; //ar.CallBackWebServiceUrl = ""; //ar.CDNumber = ""; //ar.Code = entity.DocumentNo; //ar.Code19 = ""; //ar.CommunicationChannelCode = ""; //ar.CoverRange = ""; //ar.D_AuditStatus = ""; //ar.D_DisposeStatus = ""; //ar.D_DocStandards = ""; //ar.D_DocStorageLife = ""; //ar.D_EquipmentRelation = ""; //ar.D_FileFormat = ""; //ar.D_FileStatus = ""; //ar.D_FillingUnit = ""; //ar.D_InvalidType = ""; //ar.D_Language = ""; //ar.D_ProcessStatus = entity.D_StepStatus; //ar.D_Reactor = ""; //ar.D_ReceiveType = ""; //ar.D_SecretLevel = ""; //ar.D_StorageCarrierType = ""; //ar.DCTableName = ""; //ar.DevolveStatus = ""; //ar.DigitalResourceFormationDept = ""; //ar.DigitalResourceFormationTime = ""; //ar.DocCode = ""; //ar.DocCodesExplain = ""; //ar.DocmentType = ""; //ar.DocPages = ""; //ar.DocStorageLife = ""; //ar.EffectTime = ""; ////ar.ElectronicDocumentCount = ""; //ar.ElectronicDocumentTransceiverTime = ""; //ar.ExpertOpinion = ""; //ar.Ext_2 = ""; //ar.Ext_3 = ""; //ar.Ext_4 = ""; //ar.Ext_5 = ""; //ar.FileName = entity.DocumentTitle; //ar.FillingTime = ""; //ar.FK_CategoryID = ""; //ar.FK_DC_ArchiveId = ""; //ar.FormationDept = entity.Department; //ar.FormationTime = entity.DraftDate.ToShortDateString(); //ar.FrameCode = ""; //ar.FunctionField = ""; //ar.GatherLevel = ""; //ar.Importer = ""; //ar.ImporterTime = ""; //ar.InvalidTime = ""; //ar.Is_Dispose = ""; //ar.Is_Lend = ""; //ar.Is_Piece = ""; //ar.Is_Transfer = ""; //ar.IsDeleteAfterProcess = ""; //ar.IsDownLoadAttachment = ""; //ar.KeyWords = ""; //ar.Level = ""; //ar.MainDispenseUnit = ""; //ar.MediaTimespan = ""; //ar.NucleusCode = ""; //ar.OriginalID = ""; //ar.OriginalInfomationSystem = ""; //ar.OtherFileName = ""; //ar.OtherTitle = ""; //ar.OverhaulCode = ""; //ar.PaperDocumentTransceiverTime = ""; //ar.PictureCode = ""; //ar.Profession = ""; //ar.QualitySafeLevel = ""; //ar.ReceiveCode = ""; //ar.ReceiveTime = ""; //ar.RecorderCode = ""; //ar.RelatedCode = ""; //ar.RelatedDespenseUnit = ""; //ar.Remark = ""; //ar.Revision = ""; //ar.Room = ""; //ar.StaffCode = ""; //ar.SubTitle = ""; //ar.Summary = ""; ////ar.System = ""; //ar.SystemCode = ""; //ar.ThemeWord = entity.Subject; //ar.Title = ""; //ar.UndertakeDepartment = entity.MainSend; //ar.Workshop = ""; 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="sender"></param> /// <param name="e"></param> protected void btnUpload_Click(object sender, EventArgs e) { try { if (String.IsNullOrEmpty(UCProcessType)) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, "文档库设置不能为空!"); return; } if (multiFile.Files.Length <= 0) { return; } foreach (UploadedFile file in multiFile.Files) { if (file.FileName.Contains("#") || file.FileName.Contains("'")) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "含有特殊字符,请替换后再上传"); JScript.ResponseScript(this, "javascript:__doPostBack('LinkButton1','')"); return; } } foreach (UploadedFile file in multiFile.Files) { if (file.ContentLength <= MossObject.maxFileSize * 1024 * 1024) { MossObject attach = new MossObject(); attach.ServerWeb = OAConfig.GetConfig("MOSS认证", "ServerWeb"); attach.OldFileName = file.FileName; attach.DocumentName = UCProcessType; #region 更新栏位 List <DictionaryEntry> lst = new List <DictionaryEntry>(); DictionaryEntry de = new DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new DictionaryEntry(); de.Key = "别名"; de.Value = file.FileName; lst.Add(de); de = new DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion DictionaryEntry[] result = attach.ConvertToDE(lst.ToArray()); attach.DocumentEntry = result; //文件扩展名 string fileType = System.IO.Path.GetExtension(file.FileName); if (fileType.IndexOf('.') == 0) { fileType = fileType.Substring(1); } bool IsSuccess = false; if ("exe,dll".Contains(fileType.ToLower())) { IMessage im = new WebFormMessage(Page, "不可上传exe或dll文件!"); im.Show(); IsSuccess = false; } else { attach.UploadFilesStream = file.InputStream; //上传附件并更新栏位 IsSuccess = attach.Upload(); } if (IsSuccess) { CFuJian ff = new CFuJian(); ff.Type = System.IO.Path.GetExtension(attach.FileName); if (ff.Type.IndexOf('.') == 0) { ff.Type = ff.Type.Substring(1); } ff.Title = attach.FileName; ff.Alias = System.IO.Path.GetFileNameWithoutExtension(attach.OldFileName); ff.FolderName = attach.FolderName; ff.FileName = attach.FileName; ff.Size = attach.ToFileSize_new(file.ContentLength); //文件大小 ff.ProcessType = UCProcessType; ff.WorkItemID = UCWorkItemID; ff.fullURL = attach.UploadFullName; //全路径 ff.URL = attach.UploadURL; //文件夹+/文件名 UCDataList.Add(ff); } //CFuJian l_objAttachment = MossObject.Upload(file, UCProcessType, UCProcessID, UCWorkItemID); //UCDataList.Add(l_objAttachment); } else { JScript.ShowMsgBox(Page, MsgType.VbExclamation, file.FileName + "大小超过" + MossObject.maxFileSize + "M"); } } RepeaterFiles.DataSource = UCDataList; RepeaterFiles.DataBind(); RunScript(); } catch (Exception ex) { JScript.ShowMsgBox(Page, MsgType.VbExclamation, ex.Message); } }
public static CFuJian Upload(UploadedFile file, string UCProcessType, string UCProcessID, string UCWorkItemID) { CFuJian cFuJian = new CFuJian(); OA_DocumentService api = MossObject.GetMOSSAPI(); string[] fileInfo = GetUploadFileInfo(UCProcessType, file.FileName); cFuJian.Type = System.IO.Path.GetExtension(file.FileName); //文件类型 扩展名 if (cFuJian.Type.IndexOf('.') > -1) { cFuJian.Type = cFuJian.Type.Substring(1); } cFuJian.Alias = file.FileName.Substring(0, file.FileName.Length - cFuJian.Type.Length - 1); //别名 //ff.Title = ff.Alias + "." + ff.Type; cFuJian.Title = fileInfo[3]; if (cFuJian.Type.Length == 0)//没有扩展名 { cFuJian.Alias = file.FileName; } cFuJian.Alias = cFuJian.Alias.Replace(" ", ""); cFuJian.FolderName = fileInfo[2]; cFuJian.FileName = fileInfo[3]; cFuJian.Size = MossObject.ToFileSize(file.ContentLength); //文件大小 cFuJian.ProcessType = UCProcessType; cFuJian.WorkItemID = UCWorkItemID; string[] saveUrl; #region DLL if (OAConfig.GetConfig("MOSS认证", "是否启用DLL") == "1") { #region 更新栏位 List<System.Collections.DictionaryEntry> lst = new List<System.Collections.DictionaryEntry>(); System.Collections.DictionaryEntry de = new System.Collections.DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new System.Collections.DictionaryEntry(); de.Key = "别名"; de.Value = cFuJian.Alias; lst.Add(de); de = new System.Collections.DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion System.Collections.DictionaryEntry[] result = DocumentManager.ConvertToDE(lst.ToArray()); if (file.ContentLength <= MossObject.middleFileSize * 1024 * 1024) { saveUrl = DocumentManager.Upload(fileInfo, MossObject.StreamToBytes(file.InputStream), result, false); } else { string strFileTemp = "D:\\FileTemp\\"; if (System.IO.Directory.Exists(strFileTemp) == false) { System.IO.Directory.CreateDirectory(strFileTemp); } string fileTemp = strFileTemp + "OA" + Current.UserName + Path.GetFileNameWithoutExtension(file.TmpFile.Name); string filePath = fileTemp + file.FileName; p1: if (System.IO.File.Exists(filePath)) { filePath = fileTemp + new Random(1).Next(100).ToString() + file.FileName; goto p1; } else { file.TmpFile.MoveTo(filePath); } saveUrl = DocumentManager.Upload(fileInfo, filePath, result, false); File.Delete(filePath); } ////int ret = api.CopyTo(fileInfo, "322.doc", true); //file.TmpFile.Delete(); //删除临时文件 //cFuJian.fullURL = saveUrl[0]; //全路径 //cFuJian.URL = saveUrl[1];//文件夹+/文件名 //cFuJian.Encode = "";//文件编码 //return cFuJian; } #endregion #region webservice else { #region 更新栏位 List<DictionaryEntry> lst = new List<DictionaryEntry>(); DictionaryEntry de = new DictionaryEntry(); de.Key = "流程实例"; de.Value = UCProcessID; lst.Add(de); de = new DictionaryEntry(); de.Key = "别名"; de.Value = cFuJian.Alias; lst.Add(de); de = new DictionaryEntry(); de.Key = "上次修改者"; de.Value = CurrentUserInfo.DisplayName; lst.Add(de); #endregion DictionaryEntry[] result = api.ConvertToDE(lst.ToArray()); if (file.ContentLength <= MossObject.middleFileSize * 1024 * 1024) { //上传到文档库 saveUrl = api.Upload(fileInfo, MossObject.StreamToBytes(file.InputStream), result, false); } else { string strFileTemp = "D:\\FileTemp\\"; if (System.IO.Directory.Exists(strFileTemp) == false) { System.IO.Directory.CreateDirectory(strFileTemp); } string fileTemp = strFileTemp + "OA" + Current.UserName + Path.GetFileNameWithoutExtension(file.TmpFile.Name); string filePath = fileTemp + file.FileName; p1: if (System.IO.File.Exists(filePath)) { filePath = fileTemp + new Random(1).Next(100).ToString() + file.FileName; goto p1; } else { file.TmpFile.MoveTo(filePath); } saveUrl = api.Upload_New(fileInfo, filePath, result, false); File.Delete(filePath); } } #endregion file.TmpFile.Delete(); //删除临时文件 cFuJian.fullURL = saveUrl[0]; //全路径 cFuJian.URL = saveUrl[1];//文件夹+/文件名 cFuJian.Encode = "";//文件编码 return cFuJian; }
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); }
private string Devolve2DC(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName) { string sXml = ""; FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); #region 开始生成Archive节点 ar.System = "OA_" + base.IdentityID.ToString(); string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object"); switch (ObjPlatForm) { case "DC": ar.SysFlag = "1"; break; case "FC": ar.SysFlag = "2"; break; default: ar.SysFlag = "1"; break; } // 文件编码-程序编码 ar.Code = enProFile.ProgramCode; // 编制单位-主办部门 ar.FormationDept = strDraftDept; // 题名-程序名称 ar.Title = enProFile.DocumentTitle; // 功能领域-程序子类 ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID); // 版本-版次 ar.Revision = enProFile.Edition; // 页数-总页数 ar.DocPages = enProFile.TextPageSum; // 批准者-批准操作人 ar.Authorizer = enProFile.ApproveName; // 生效日期-批准日期 ar.AuthorizeTime = CheckDateTime(enProFile.ApproveDate.ToString()); // 审核者-审核操作人 ar.Auditby = enProFile.AuditName; // 审核日期-审核日期 ar.AuditDate = CheckDateTime(enProFile.AuditDate.ToString()); // 校核者-校核操作人 ar.Checkthose = enProFile.CheckName; // 校核日期-校核日期 ar.CheckDate = CheckDateTime(enProFile.CheckDate.ToString()); // 编制人-编制操作人 ar.Author = enProFile.WriteName; // 编制日期-编制日期 ar.FormationTime = CheckDateTime(enProFile.WriteDate.ToString()); //ar.FK_CategoryID = "903"; // 公共常量 //ar.GatherLevel = "件"; //ar.D_StorageCarrierType = "纸质"; //ar.Amount = "1"; //ar.D_Language = "中文"; ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString(); #endregion sXml = oaDev.GenOAArchiveNode(ar, sProcessName); /****开始生成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 < enProFile.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = enProFile.FileList[i]; at.DocumentName = ProcessConstString.TemplateName.PROGRAM_FILE; //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 Devolve2DC2(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName) { string sXml = ""; List <FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", sProcessName); FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode(); FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode(); #region 开始生成Archive节点 ar.System = "OA_" + base.IdentityID.ToString(); string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/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; ar.SetAttribute(skey, oaDev.PreHandel(enProFile, sName, sType) /*(entity.GetVal(sName) as string)*/); } ar.SetOAArchiveNode(); // 其他节点处理应放置在SetOAArchiveNode方法之后 // 编制单位-主办部门 ar.FormationDept = strDraftDept; // 功能领域-程序子类 ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID); //return Devolve2DP(oaDev, sDPID, ar); #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点 ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString(); #endregion sXml = oaDev.GenOAArchiveNode(ar, sProcessName); /****开始生成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 < enProFile.FileList.Count; i++) { HNDC_CAttachmentNode at = new HNDC_CAttachmentNode(); CFuJian file = enProFile.FileList[i]; at.DocumentName = ProcessConstString.TemplateName.PROGRAM_FILE; //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); }