private void GetMastFile() { string FileName = ""; string aFileName = ""; string Doc_Id = DR.GetS_Code(Request.QueryString["guid"]); Doc_Id = Doc_Id == "" ? Request.QueryString["guid"] : Doc_Id; List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Doc_Id); if (DUFList.Count == 1) { FileName = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); aFileName = DUFList[0].FilePath + DUFList[0].FileName; } else { for (int i = 0; i < DUFList.Count; i++) { if (DUFList[i].FileName.ToLower().IndexOf(System.Web.Configuration.WebConfigurationManager.AppSettings["MASTERFILE"]) > -1) { FileName = Server.MapPath(DUFList[i].FilePath + DUFList[i].FileName); aFileName = DUFList[i].FilePath + DUFList[i].FileName; break; } } } if (FileName == "") { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; this.ShowJsMessage("该收文没有上传附件"); return; } if (FileName.ToLower().IndexOf("doc") > -1 || FileName.ToLower().IndexOf("docx") > -1) //word文档 { // 打开文档 PageOfficeCtrl1.WebOpen("DocList/" + Doc_Id + "." + FileName.Substring(FileName.LastIndexOf(".") + 1), PageOffice.OpenModeType.docReadOnly, Session["RealName"].ToString()); this.divPic.Visible = false; this.divPdf.Visible = false; } else if (FileName.ToLower().IndexOf("pdf") > -1) //PDF文档 { this.ViewState["ATTFILE"] = aFileName; this.divWord.Visible = false; this.divPic.Visible = false; } else if (FileName.ToLower().IndexOf("jpg") > -1 || FileName.ToLower().IndexOf("bmp") > -1 || FileName.ToLower().IndexOf("gif") > -1 || FileName.ToLower().IndexOf("tif") > -1) //word文档 { this.showPic.ImageUrl = aFileName; this.divWord.Visible = false; this.divPdf.Visible = false; } else { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; } }
private void FitSendDocData() { List<DocSendEntity> DocList = DSD.GetDocRecord(Request.QueryString["guid"]); this.txtTItle.Text = DocList[0].D_TITLE; this.lblTitle.Text = DocList[0].SEND_LOGO; this.txtSubCode.Text = DocList[0].D_CODE.Replace(";",""); this.drgClass.Text = DocList[0].DOC_CLASS; this.dtBuyTime.Text = DocList[0].DOC_TIME.ToString(); this.txtKey.Text = DocList[0].KEY_CODE; this.txtMainSend.Text = DocList[0].MAIN_RECEIVER; this.txtPage.Text = DocList[0].PAGE_COUNT.ToString(); this.txtNum.Text = DocList[0].PRINT_COUNT.ToString(); this.txtPrinter.Text = DocList[0].PRINTER; this.txtJd.Text = DocList[0].PROOFER; this.drgSecure.Text= DocList[0].SECURE_CLASS; this.drgimite.Text = DocList[0].STORE_LIMIT; this.txtSubSend.Text = DocList[0].SUB_RECEIVER; this.drgJj.Text =DocList[0].URGENT_CLASS; DSD.FitDocData(Request.QueryString["guid"], this.Ng, this.Qf, this.Hg,this.Hq); List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["guid"]); if (DUFList.Count > 0) { this.txtAttachment.Text = "<a href='" + DUFList[0].FilePath + DUFList[0].FileName + "' target=_blank>点击查看附件</a>"; } }
private void GetWordFile() { string FileName = ""; if (at.AttachCount > 0) { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["guid"].ToString()); FileName = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); } this.hidFile.Value = FileName; }
private void GetAttchmentInfo() { if (at.AttachCount > 0) { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["guid"]); string FileName = ""; for (int i = 0; i < DUFList.Count; i++) { FileName = DUFList[i].FilePath + DUFList[i].FileName+ ";"; } this.Session["DOCATTACHMENT"] = FileName; } }
private void GetMastFile() { string FileName = ""; string aFileName = ""; List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["guid"]); if (DUFList.Count > 0) { FileName = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); aFileName = DUFList[0].FilePath + DUFList[0].FileName; } if (FileName == "") { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; this.ShowJsMessage("该收文没有上传附件"); return; } if (FileName.ToLower().IndexOf("doc") > -1 || FileName.ToLower().IndexOf("docx") > -1) //word文档 { // 打开文档 string F_Name = "DocList/" + Request.QueryString["guid"] + "." + FileName.Substring(FileName.LastIndexOf(".") + 1); if (!System.IO.File.Exists(Server.MapPath(F_Name))) { GetAttchmentInfo("/UploadFiles/" + Request.QueryString["guid"] + "/" + DUFList[0].FileName); } PageOfficeCtrl1.WebOpen(F_Name, PageOffice.OpenModeType.docReadOnly, Session["RealName"].ToString()); this.divPic.Visible = false; this.divPdf.Visible = false; } else if (FileName.ToLower().IndexOf("pdf") > -1) //PDF文档 { this.ViewState["ATTFILE"] = aFileName; this.divWord.Visible = false; this.divPic.Visible = false; } else if (FileName.ToLower().IndexOf("jpg") > -1 || FileName.ToLower().IndexOf("bmp") > -1 || FileName.ToLower().IndexOf("gif") > -1 || FileName.ToLower().IndexOf("tif") > -1) //word文档 { this.showPic.ImageUrl = aFileName; this.divWord.Visible = false; this.divPdf.Visible = false; } else { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; } }
private void GetAttchmentInfo() { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Convert.ToString(ViewState["InfoGuid"])); if (DUFList.Count > 0) { if (DUFList[0].FileName.ToLower().IndexOf("doc") > -1 || DUFList[0].FileName.ToLower().IndexOf("docx") > -1 || DUFList[0].FileName.ToLower().IndexOf("xls") > -1) { string FileName = ""; FileName = DUFList[0].FilePath + DUFList[0].FileName; string FileType = DUFList[0].FileName.Substring(DUFList[0].FileName.LastIndexOf(".") + 1); System.IO.FileInfo fi = new System.IO.FileInfo(Server.MapPath(@FileName)); fi.CopyTo(Server.MapPath(DUFList[0].FilePath) + this.ViewState["InfoGuid"] + "." + FileType, false); } } }
private void GetAttchmentInfo() { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["guid"]); if (DUFList.Count > 0) { string FileName = ""; for (int i = 0; i < DUFList.Count; i++) { FileName = DUFList[i].FilePath + DUFList[i].FileName; string FileType = DUFList[i].FileName.Substring(DUFList[i].FileName.LastIndexOf(".") + 1); System.IO.FileInfo fi = new System.IO.FileInfo(Server.MapPath(@FileName)); fi.CopyTo(Server.MapPath(@"DocList\") + this.ViewState["FileGuid"] + "." + FileType, false); } } }
private int SavaData() { if (this.drgType.SelectedIndex == 0) { this.ShowJsMessage("请选择合同种类"); return 0; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Convert.ToString(ViewState["CheckGuid"])); if (DUFList.Count < 1) { this.ShowJsMessage("请上传单位内部审核材料"); return 0; } int Flag = CD.Insert(Convert.ToString(ViewState["Guid"]), this.txtC_Name.Text.Trim(), this.drgType.SelectedItem.Text,this.txtCode.Text.Trim(), this.txtValue.Text.Trim(), this.txtLimit.Text.Trim(), this.txtFrom.Text.Trim(), this.txtContent.Text.Trim(), Session["RealName"].ToString(), Session["EPORTID"].ToString(), Session["CompanyFullName"].ToString(), Convert.ToString(ViewState["CheckGuid"])); return Flag; }
private void InitiData() { string DocGuid = Request.QueryString["DocGuid"]; string FileName = ""; if (Request.QueryString["source"] != null)//公文原文 { FileName = "Source/" + "docS" + DocGuid + ".doc" ; } if (Request.QueryString["zs"] != null)//公文原文 { FileName = "DocList/"+ DocGuid + ".doc"; } if (Request.QueryString["lh"] != null)//公文原文 { FileName = "DocList/" + DocGuid + ".doc"; } PageOfficeCtrl1.ServerPage = "../../pageoffice/server.aspx"; // 打开文档 if (Request.QueryString["lh"] == null) { PageOfficeCtrl1.WebOpen(FileName, PageOffice.OpenModeType.docReadOnly, Session["RealName"].ToString()); } else { PageOfficeCtrl1.WebOpen(FileName, PageOffice.OpenModeType.docRevisionOnly, Session["RealName"].ToString()); } this.GridView1.DataSource = DSD.GetDocWorkFlow("1", Request.QueryString["DocGuid"], Session["EPORTID"].ToString()); this.GridView1.DataBind(); List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["DocGuid"]); if (DUFList.Count > 0) { this.txtAttachment.Text = "<a href='" + DUFList[0].FilePath + DUFList[0].FileName + "' target=_blank>点击查看附件</a>"; } }
private void SavaData() { if (this.txtToDept.Value.Replace("#", "").Replace("undefined", "") == "") { ShowJsMessage("请选择发往单位"); return; } if (this.Session["EPORTID"].ToString() != "GWJT120911" && this.txtToDept.Value.Trim().IndexOf("TCGW111128") > -1)//只有集团可以向管委会发文 { ShowJsMessage("只有集团可以向管委会发文,请重新选择发往单位"); return; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["guid"].ToString()); string Att = ""; if (DUFList.Count > 0) { Att = DUFList[0].FilePath + DUFList[0].FileName; } new DocSendRegistDB().Insert(this.ViewState["guid"].ToString(), this.txtCode.Text.Trim(), Convert.ToDateTime(this.dtTime.Text.Trim()), DateTime.Now, this.txtTitle.Text.Trim(), this.txtContent.Text.Trim(), this.Session["UserID"].ToString(), this.Session["RealName"].ToString(), this.txtTo.Text.Trim(), this.txtToDept.Value.Trim(), Att, Session["EPORTID"].ToString(), Session["CompanyFullName"].ToString()); if (this.txtToDept.Value.Trim().IndexOf("TCGW111128") > -1)//向管委会发文 { try { string SendPath = System.Web.Configuration.WebConfigurationManager.AppSettings["GWHPATH"]; string XmlPath = System.Web.Configuration.WebConfigurationManager.AppSettings["XMLPATH"]; string ZipPwd = System.Web.Configuration.WebConfigurationManager.AppSettings["ZIPPWD"]; if (System.IO.Directory.Exists(SendPath)) { string[] FileList = new string[DUFList.Count]; string[] ZipFile = new string[DUFList.Count + 1]; for (int i = 0; i < DUFList.Count; i++) { FileList[i] = DUFList[i].FileName; ZipFile[i] = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); } XmlPath = XmlPath +"\\"+ this.ViewState["guid"].ToString(); if (!System.IO.Directory.Exists(XmlPath)) { System.IO.Directory.CreateDirectory(XmlPath); } System.IO.File.AppendAllText(XmlPath + "\\Meta.xml", GetXmlContent(FileList)); ZipFile[DUFList.Count] = XmlPath + "\\Meta.xml"; bool bolFlag = new ZipFiles().ZipFileDictory(ZipFile, SendPath+"\\"+this.ViewState["guid"].ToString() + ".zip", ZipPwd); if (bolFlag == false) { ShowJsMessage("向管委会发文,生成压缩文件出错,向管委会发文失败"); return; } } } catch (Exception ex) { ShowJsMessage("向管委会发文发文失败,失败原因"+ex.Message); return; } } CallJsFun("alert('成功保存');window.close();"); }
private void SavaData() { if (this.txtToDept.Value.Replace("#", "") == "") { ShowJsMessage("请选择发往单位"); return; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["guid"].ToString()); string Att = ""; if (DUFList.Count > 0) { Att = DUFList[0].FilePath + DUFList[0].FileName; } new DocSendRegistDB().Update(this.ViewState["guid"].ToString(), this.txtCode.Text.Trim(), Convert.ToDateTime(this.dtTime.Text.Trim()), DateTime.Now, this.txtTitle.Text.Trim(), this.txtContent.Text.Trim(), this.Session["UserID"].ToString(), this.Session["RealName"].ToString(),this.txtTo.Text.Trim(), this.txtToDept.Value.Trim(), Att); CallJsFun("alert('成功保存');window.close();"); }
private void GetMastFile() { string FileName = ""; string aFileName = ""; List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["InfoGuid"]); if (DUFList.Count >0) { FileName = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); aFileName = DUFList[0].FilePath + DUFList[0].FileName; } else { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; return; } if (FileName.ToLower().IndexOf("doc") > -1 || FileName.ToLower().IndexOf("docx") > -1) //word文档 { // 打开文档 PageOfficeCtrl1.WebOpen(DUFList[0].FilePath + Request.QueryString["InfoGuid"] + "." + DUFList[0].FileName.Substring(DUFList[0].FileName.LastIndexOf(".") + 1), PageOffice.OpenModeType.docReadOnly, Session["RealName"].ToString()); this.divPic.Visible = false; this.divPdf.Visible = false; } if (FileName.ToLower().IndexOf("xls") > -1 || FileName.ToLower().IndexOf("xlsx") > -1) //word文档 { // 打开文档 PageOfficeCtrl1.WebOpen(DUFList[0].FilePath + Request.QueryString["InfoGuid"] + "." + DUFList[0].FileName.Substring(DUFList[0].FileName.LastIndexOf(".") + 1), PageOffice.OpenModeType.xlsReadOnly, Session["RealName"].ToString()); this.divPic.Visible = false; this.divPdf.Visible = false; } else if (FileName.ToLower().IndexOf("pdf") > -1) //PDF文档 { this.ViewState["ATTFILE"] = aFileName; this.divWord.Visible = false; this.divPic.Visible = false; } else if (FileName.ToLower().IndexOf("jpg") > -1 || FileName.ToLower().IndexOf("bmp") > -1 || FileName.ToLower().IndexOf("gif") > -1 || FileName.ToLower().IndexOf("tif") > -1) //word文档 { this.showPic.ImageUrl = aFileName; this.divWord.Visible = false; this.divPdf.Visible = false; } else { this.divWord.Visible = false; this.divPdf.Visible = false; this.divPic.Visible = false; } }
private int SavaData() { if (this.drgType.SelectedIndex == 0) { this.ShowJsMessage("请选择合同种类"); return 0; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Convert.ToString(ViewState["CheckGuid"])); if (DUFList.Count < 1) { this.ShowJsMessage("请上传单位内部审核材料"); return 0; } return CD.Update(Request.QueryString["id"], this.txtC_Name.Text.Trim(), this.drgType.SelectedItem.Text, this.txtCode.Text.Trim(), this.txtValue.Text.Trim(), this.txtLimit.Text.Trim(), this.txtFrom.Text.Trim(), this.txtContent.Text.Trim(), Convert.ToString(ViewState["CheckGuid"])); }
private void SavaData() { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["guid"].ToString()); string Att = ""; if (DUFList.Count > 0) { Att = DUFList[0].FilePath + DUFList[0].FileName; } new DocRegBakDB().Insert(this.ViewState["guid"].ToString(), this.txtCode.Text.Trim(), Convert.ToDateTime(this.dtTime.Text.Trim()), DateTime.Now, this.txtTitle.Text.Trim(), this.txtContent.Text.Trim(), this.Session["UserID"].ToString(), this.Session["RealName"].ToString(), this.txtTo.Text.Trim(), Att, Session["EPORTID"].ToString(), Session["CompanyFullName"].ToString()); CallJsFun("alert('成功保存');window.close();"); }
/// <summary> /// /// </summary> /// <param name="TableFlag"></param> /// <param name="T_Guid"></param> /// <param name="TableNote"></param> /// <param name="TableName"></param> /// <param name="PAGEURL"></param> public void GetTableInfo(string TableFlag, out string T_Guid, out string TableNote, out string TableName, out string PAGEURL) { FrameAttachment FA = new FrameAttachment(); Database db = DatabaseFactory.CreateDatabase(ConnStr); string strSql = (db.DbProviderFactory.ToString() != "System.Data.OracleClient.OracleClientFactory") ? "SELECT GUID,TABLENOTE,TABLENAME,PAGEURL,PAGEURL2 FROM OA_SWFTABLEFLAG WHERE TABLEFLAG=@TABLEFLAG" : "SELECT GUID,TABLENOTE,TABLENAME,PAGEURL,PAGEURL2 FROM OA_SWFTABLEFLAG WHERE TABLEFLAG=:TABLEFLAG"; DbCommand cmd = db.GetSqlStringCommand(strSql); db.AddInParameter(cmd, "TABLEFLAG", DbType.String, TableFlag); DataView dv = db.ExecuteDataView(cmd); if (dv.Count == 0) { TableNote = ""; T_Guid = ""; TableName = ""; PAGEURL = ""; return; } TableNote = dv[0]["TABLENOTE"].ToString().Trim(); T_Guid = dv[0]["GUID"].ToString().Trim(); TableName = dv[0]["TABLENAME"].ToString().Trim(); PAGEURL = dv[0]["PAGEURL"].ToString().Trim(); }
private void SavaData() { if (at.AttachCount < 1) { CallJsFun("alert('请选择模版文件')"); return; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(ViewState["LogoGuid"].ToString()); DTB.DTEntity().L_ID = Request.QueryString["VersionGuid"]; DTB.DTEntity().T_FILENAME = DUFList[0].FileName; DTB.DTEntity().T_FILETYPE = DUFList[0].FileType; DTB.DTEntity().T_TITLE = this.txtName.Text.Trim(); DTB.DTEntity().UPLOADUSERID = DUFList[0].UploadUserID; DTB.DTEntity().UPLOADUSERNAME = DUFList[0].UploadUserName; DTB.DTEntity().T_FULL_FILENAME = DUFList[0].FilePath + DUFList[0].FileName; DTB.DTEntity().T_ID = ViewState["LogoGuid"].ToString(); int Flag = DTB.InsertDocTemplate(); if (Flag < 1) { CallJsFun("alert('由于网络原因,本次保存失败,请联系信息中心技术人员!');"); return; } CallJsFun("alert('成功保存数据!');"); this.InitData(); }
public void RefreshGrid() { string GroupGuid = _AttGroupGuid; if (GroupGuid != null && GroupGuid != "") { DataView dv = new FrameAttachment().SelectFilesByGroupGuid(GroupGuid); _AttachCount = dv.Count; //附件数量 for (int i = 0; i < dv.Count; i++) { string ft = dv[i]["FILETYPE"].ToString(); dv[i]["FILETYPE"] = ft.Substring(ft.LastIndexOf(".") + 1) + ".gif"; } //上传或下载,显示不同的按钮 if (_ShowWay.ToString() == DisplayWay.Download.ToString()) { ViewState["UploadDisplay"] = "none"; ViewState["DownloadDisplay"] = " "; } else { ViewState["UploadDisplay"] = " "; ViewState["DownloadDisplay"] = "none"; } if (_ShowModule.ToString() == ListType.TableList.ToString()) { dgAttachment.DataSource = dv; dgAttachment.DataBind(); tdGrid.Visible = true; tdLine.Visible = false; } else { //列数以小的为准,防止出现空列 int Columns = _RepeatColumns > dv.Count ? dv.Count : _RepeatColumns; if (Columns == 0) Columns = 1; dlFileList.RepeatColumns = Columns; dlFileList.ItemStyle.Width = Unit.Parse((100 / dlFileList.RepeatColumns).ToString() + "%"); dlFileList.DataSource = dv; dlFileList.DataKeyField = "FILEGUID"; dlFileList.DataBind(); tdLine.Visible = true; tdGrid.Visible = false; } } }
private void InitiData() { string DocGuid = Request.QueryString["guid"]; string FileName = "DocList/" + DocGuid + ".doc"; PageOfficeCtrl1.WebOpen(FileName, PageOffice.OpenModeType.docReadOnly, Session["RealName"].ToString()); if (Request.QueryString["query"] == null) { DataView dv = DR.GetDocRange(Request.QueryString["guid"]); if (dv != null && dv.Count > 0) { string Tip = dv[0]["RANGE_TYPE"].ToString(); if (Tip == "1") { this.lblrange.Text = "公开"; } if (Tip == "2") { this.lblrange.Text = dv[0]["RANGE_USER"].ToString() == "" ? "本部门" : "本部门及" + dv[0]["RANGE_USER"].ToString(); } if (Tip == "3") { this.lblrange.Text = "仅人员"; } } this.CallJsFun("document.all['tabQuery'].style.display = 'none';"); this.CallJsFun("document.all['tabRange'].style.display = 'block';"); } else { this.CallJsFun("document.all['tabQuery'].style.display = 'block';"); this.CallJsFun("document.all['tabRange'].style.display = 'none';"); } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(DocGuid); if (DUFList.Count > 0) { this.txtAttachment.Text = "<a href='" + DUFList[0].FilePath + DUFList[0].FileName + "' target=_blank>点击查看附件</a>"; } }
private void GetWordFile() { string FileName = ""; if (at.AttachCount > 0) { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["guid"].ToString()); FileName =Server.MapPath( DUFList[0].FilePath + DUFList[0].FileName) ; if (DUFList.Count > 0) { string FileName1 = ""; for (int i = 0; i < DUFList.Count; i++) { FileName1 = DUFList[i].FilePath + DUFList[i].FileName; string FileType = DUFList[i].FileName.Substring(DUFList[i].FileName.LastIndexOf(".") + 1); System.IO.FileInfo fi = new System.IO.FileInfo(Server.MapPath(@FileName1)); fi.CopyTo(Server.MapPath(@"../RevDoc/DocList\") + this.ViewState["guid"] + "." + FileType, false); } } } this.hidFile.Value = FileName; }
private void SavaData() { if (at.AttachCount < 1) { CallJsFun("alert('请选择模版文件')"); return; } List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(this.ViewState["StampGuid"].ToString()); DS.DSEntity().S_ID = this.ViewState["StampGuid"].ToString(); DS.DSEntity().S_FILE = DUFList[0].FilePath + DUFList[0].FileName; DS.DSEntity().S_NAME = this.txtName.Text.Trim(); DS.DSEntity().S_SECURE = ""; int Flag = DS.InsertDocStamp(); if (Flag < 1) { CallJsFun("alert('由于网络原因,本次保存失败,请联系信息中心技术人员!');"); return; } CallJsFun("alert('成功保存数据!');"); this.ViewState["StampGuid"] = Guid.NewGuid().ToString(); this.InitData(); }
private void InitiDoc() { string DocGuid = Request.QueryString["DocGuid"]; string IsFirst = Request.QueryString["IsFirst"]; string TempLate = Server.MapPath(@"DocList\" + DocGuid + ".doc"); if (!(Request.QueryString["method"] != null && Request.QueryString["method"].ToLower() == "post"))//打开公文模版 { if (Request.QueryString["source"] == null) { if (IsFirst == "0" && Request.QueryString["TemplateGuid"] == null)//空模版 { if (!File.Exists(TempLate)) { TempLate = Server.MapPath("blank.doc"); } } else if (IsFirst == "0" && Request.QueryString["TemplateGuid"] != null) //非空模版 { if (!File.Exists(TempLate)) { List<FrameAttachment.DetailUploadFile> DUFList = new FrameAttachment().SelectFilesByGroupGuid2(Request.QueryString["TemplateGuid"]); TempLate = Server.MapPath(DUFList[0].FilePath + DUFList[0].FileName); } } else//其它步骤修改公文,打开进行修改 { if (!File.Exists(TempLate)) { TempLate = Server.MapPath("blank.doc"); } } } else { TempLate = Server.MapPath(@"Source\docS" + DocGuid + ".doc"); } byte[] AttInput; System.IO.Stream stm = File.OpenRead(TempLate); byte[] filedata = new Byte[stm.Length]; stm.Read(filedata, 0, (int)stm.Length); stm.Close(); AttInput = filedata; Response.BinaryWrite(AttInput); } else if (Request.QueryString["method"] != null && Request.QueryString["method"].ToLower() == "post")//保存公文 { Stream stm = Request.InputStream; byte[] bInput = new byte[stm.Length]; stm.Read(bInput, 0, (int)stm.Length); string FileName = ""; if (IsFirst == "0")//保存公文原文 { FileName = "docS" + DocGuid + ".doc"; FileInfo fi = new FileInfo(Server.MapPath(@"Source\" + FileName)); FileStream fs = fi.OpenWrite(); fs.Write(bInput, 0, bInput.Length); fs.Close(); fs.Dispose(); } FileName = DocGuid + ".doc"; FileInfo fi1 = new FileInfo(Server.MapPath(@"DocList\" + FileName)); FileStream fs1 = fi1.OpenWrite(); fs1.Write(bInput, 0, bInput.Length); stm.Close(); stm.Dispose(); fs1.Close(); fs1.Dispose(); } }