diff --git a/SGGL/BLL/API/APIUserService.cs b/SGGL/BLL/API/APIUserService.cs index e13daf5f..988c4586 100644 --- a/SGGL/BLL/API/APIUserService.cs +++ b/SGGL/BLL/API/APIUserService.cs @@ -347,7 +347,7 @@ namespace BLL using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { var getUser = db.Person_Persons.FirstOrDefault(x => x.PersonId == personId); - if (getUser != null) + if (getUser != null&&!string .IsNullOrEmpty(SignatureUrl)) { getUser.SignatureUrl = SignatureUrl; db.SubmitChanges(); diff --git a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs index f40e72a4..fed13c2a 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +using Aspose.Words; +using System; +using System.Collections.Generic; +using System.IO; using System.Linq; using System.Web.UI.WebControls; @@ -27,8 +30,6 @@ namespace BLL return Funs.DB.PHTGL_ActionPlanFormation.FirstOrDefault(e => e.ActionPlanCode == actionPlanCode); } - - /// /// 添加 /// @@ -226,6 +227,366 @@ namespace BLL } } + /// + /// ActionPlanID + /// + /// + public static Document Print( string Id) + { + string rootPath = Funs.RootPath; + //string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + var lwfirwork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); + initTemplatePath = "File\\Word\\PHTGL\\施工招标实施计划审批表.docx"; + if (lwfirwork != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectID)) + { + initTemplatePath = "File\\Word\\PHTGL\\施工招标实施计划审批表LW.docx"; + + } + } + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + ///更新书签 + var getFireWork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); + var Act = PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewByActionPlanID(Id); + var list = PHTGL_ActionPlanFormation_Sch1Service.GetListPHTGL_ActionPlanFormation_Sch1ById(Id); + + Document doc = new Aspose.Words.Document(newUrl); + Bookmark txtActionPlanCode = doc.Range.Bookmarks["ActionPlanCode"]; + Bookmark txtBidProject = doc.Range.Bookmarks["txtBidProject"]; + Bookmark txtName = doc.Range.Bookmarks["txtName"]; + Bookmark txtCreateTime = doc.Range.Bookmarks["CreateTime"]; + Bookmark txtProjectName = doc.Range.Bookmarks["txtProjectName"]; + Bookmark txtUnit = doc.Range.Bookmarks["txtUnit"]; + Bookmark txtConstructionSite = doc.Range.Bookmarks["txtConstructionSite"]; + Bookmark txtBiddingProjectScope = doc.Range.Bookmarks["txtBiddingProjectScope"]; + Bookmark txtBiddingProjectContent = doc.Range.Bookmarks["txtBiddingProjectContent"]; + Bookmark txtTimeRequirements = doc.Range.Bookmarks["txtTimeRequirements"]; + Bookmark txtQualityRequirement = doc.Range.Bookmarks["txtQualityRequirement"]; + Bookmark txtHSERequirement = doc.Range.Bookmarks["txtHSERequirement"]; + Bookmark txtTechnicalRequirement = doc.Range.Bookmarks["txtTechnicalRequirement"]; + Bookmark txtCurrentRequirement = doc.Range.Bookmarks["txtCurrentRequirement"]; + Bookmark txtSub_Selection = doc.Range.Bookmarks["txtSub_Selection"]; + Bookmark txtBid_Selection = doc.Range.Bookmarks["txtBid_Selection"]; + Bookmark txtContractingMode_Select = doc.Range.Bookmarks["txtContractingMode_Select"]; + Bookmark txtPriceMode_Select = doc.Range.Bookmarks["txtPriceMode_Select"]; + Bookmark txtMaterialsDifferentiate = doc.Range.Bookmarks["txtMaterialsDifferentiate"]; + Bookmark txtImportExplain = doc.Range.Bookmarks["txtImportExplain"]; + Bookmark txtShortNameList = doc.Range.Bookmarks["txtShortNameList"]; + Bookmark txtEvaluationMethods = doc.Range.Bookmarks["txtEvaluationMethods"]; + Bookmark txtEvaluationPlan = doc.Range.Bookmarks["txtEvaluationPlan"]; + Bookmark txtBiddingMethods_Select = doc.Range.Bookmarks["txtBiddingMethods_Select"]; + Bookmark txtSchedulePlan = doc.Range.Bookmarks["txtSchedulePlan"]; + #region 附件表 + Dictionary Dic_File = new Dictionary(); + for (int i = 1; i < 14; i++) + { + string txtPlanningContent = "txtPlanningContent" + Convert.ToString(i); + string txtRemarks = "txtRemarks" + Convert.ToString(i); + string value_ActionPlan = ""; + string value_Remarks = ""; + var model = list.Find(e => e.SortIndex == Convert.ToString(i)); + if (model != null) + { + value_ActionPlan = model.ActionPlan; + value_Remarks = model.Remarks; + } + string[] key = { txtPlanningContent, txtRemarks }; + object[] value = { value_ActionPlan, value_Remarks }; + doc.MailMerge.Execute(key, value); + + } + + #endregion + if (txtActionPlanCode != null) + { + if (getFireWork != null) + { + txtActionPlanCode.Text = getFireWork.ActionPlanCode; + } + } + if (txtName != null) + { + if (getFireWork != null) + { + txtName.Text = getFireWork.ProjectShortName; + } + + } + if (txtBidProject != null) + { + if (getFireWork != null) + { + + txtBidProject.Text = getFireWork.BidProject; + } + } + if (txtCreateTime != null) + { + if (getFireWork != null) + { + + txtCreateTime.Text = string.Format("{0:D}", getFireWork.CreateTime); + } + } + if (Act != null) + { + if (Act.State == Const.ContractReview_Complete) + { + + AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", Act.Approval_Construction, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", Act.ConstructionManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", Act.DeputyGeneralManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", Act.ProjectManager, ""); + } + } + + + if (txtProjectName != null) + { + if (getFireWork != null) + { + txtProjectName.Text = getFireWork.ProjectName; + } + } + if (txtUnit != null) + { + if (getFireWork != null) + { + txtUnit.Text = getFireWork.Unit; + + } + } + if (txtConstructionSite != null) + { + if (getFireWork != null) + { + txtConstructionSite.Text = getFireWork.ConstructionSite; + + } + } + if (txtBiddingProjectScope != null) + { + if (getFireWork != null) + { + txtBiddingProjectScope.Text = getFireWork.BiddingProjectScope; + + } + } + if (txtBiddingProjectContent != null) + { + if (getFireWork != null) + { + txtBiddingProjectContent.Text = getFireWork.BiddingProjectContent; + + } + } + if (txtTimeRequirements != null) + { + if (getFireWork != null) + { + txtTimeRequirements.Text = getFireWork.TimeRequirements; + + } + + } + if (txtQualityRequirement != null) + { + if (getFireWork != null) + { + txtQualityRequirement.Text = getFireWork.QualityRequirement; + + } + + } + if (txtHSERequirement != null) + { + if (getFireWork != null) + { + txtHSERequirement.Text = getFireWork.HSERequirement; + + } + + } + if (txtTechnicalRequirement != null) + { + if (getFireWork != null) + { + txtTechnicalRequirement.Text = getFireWork.TechnicalRequirement; + + } + + } + if (txtCurrentRequirement != null) + { + if (getFireWork != null) + { + txtCurrentRequirement.Text = getFireWork.CurrentRequirement; + + } + + } + if (txtSub_Selection != null) + { + if (getFireWork != null) + { + txtSub_Selection.Text = getFireWork.Sub_Selection; + + } + + } + if (txtBid_Selection != null) + { + if (getFireWork != null) + { + txtBid_Selection.Text = getFireWork.Bid_Selection; + + } + + } + if (txtContractingMode_Select != null) + { + if (getFireWork != null) + { + txtContractingMode_Select.Text = getFireWork.ContractingMode_Select; + + } + + } + if (txtPriceMode_Select != null) + { + if (getFireWork != null) + { + txtPriceMode_Select.Text = getFireWork.PriceMode_Select; + + } + + } + if (txtMaterialsDifferentiate != null) + { + if (getFireWork != null) + { + txtMaterialsDifferentiate.Text = getFireWork.MaterialsDifferentiate; + + } + + } + if (txtImportExplain != null) + { + if (getFireWork != null) + { + txtImportExplain.Text = getFireWork.ImportExplain; + + } + + } + if (txtShortNameList != null) + { + if (getFireWork != null) + { + txtShortNameList.Text = getFireWork.ShortNameList; + + } + + } + if (txtEvaluationMethods != null) + { + if (getFireWork != null) + { + txtEvaluationMethods.Text = getFireWork.EvaluationMethods; + + } + + } + if (txtEvaluationPlan != null) + { + if (getFireWork != null) + { + txtEvaluationPlan.Text = getFireWork.EvaluationPlan; + + } + + } + if (txtBiddingMethods_Select != null) + { + if (getFireWork != null) + { + txtBiddingMethods_Select.Text = getFireWork.BiddingMethods_Select; + + } + + } + if (txtSchedulePlan != null) + { + if (getFireWork != null) + { + txtSchedulePlan.Text = getFireWork.SchedulePlan; + + } + + } + if (!string.IsNullOrEmpty(getFireWork.AttachUrlContent)) + { + + var Path = newUrl.Replace(".docx", "编辑栏.docx"); //word文件保存路径 + AsposeWordHelper.HtmlIntoWord(getFireWork.AttachUrlContent, Path); + Document doc2 = new Document(Path); + DocumentBuilder builder = new DocumentBuilder(doc2); + //doc2.FirstSection.PageSetup.SectionStart = SectionStart.OddPage; + builder.PageSetup.PaperSize = PaperSize.A4; + doc.AppendDocument(doc2, ImportFormatMode.UseDestinationStyles); + doc.UpdateWordCount(); + File.Delete(Path); + } + doc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + File.Delete(newUrl); + return doc1; + } + public static void PrintFile( string Id) + { + string rootPath = Funs.RootPath; + string newUrl = string.Empty; + newUrl = rootPath + "File\\Word\\PHTGL\\施工招标实施计划审批表.docx"; + newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var q = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); + var doc = BLL.PHTGL_ActionPlanFormationService.Print( Id); + doc.Save(newUrl); + //生成PDF文件 + string pdfUrl = newUrl.Replace(".docx", ".pdf"); + // BLL.AsposeWordHelper.WordIntoPdf(newUrl, pdfUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(pdfUrl).Replace("施工招标实施计划审批表", q.ActionPlanCode + "施工分包实施计划"); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } } } \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs index 4f02c3a8..52caaea5 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs @@ -1,4 +1,9 @@ -using System.Collections.Generic; +using Aspose.Words; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; using System.Linq; namespace BLL @@ -13,7 +18,6 @@ namespace BLL return Funs.DB.PHTGL_BidApproveUserReview.FirstOrDefault(e => e.ApproveUserReviewID == ApproveUserReviewID); } - public static void AddPHTGL_BidApproveUserReview(Model.PHTGL_BidApproveUserReview newtable) { Model.PHTGL_BidApproveUserReview table = new Model.PHTGL_BidApproveUserReview(); @@ -34,7 +38,6 @@ namespace BLL Funs.DB.SubmitChanges(); } - public static void UpdatePHTGL_BidApproveUserReview(Model.PHTGL_BidApproveUserReview newtable) { Model.PHTGL_BidApproveUserReview table = Funs.DB.PHTGL_BidApproveUserReview.FirstOrDefault(e => e.ApproveUserReviewID == newtable.ApproveUserReviewID); @@ -119,6 +122,101 @@ namespace BLL return list; } + public static Document Print(string Id) + { + string rootPath = Funs.RootPath; + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + initTemplatePath = "File\\Word\\PHTGL\\施工招标评标小组名单审批表.docx"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + ///更新书签 + var getFireWork = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(Id); + var Bid = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(getFireWork.BidDocumentsReviewId); + var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Bid.ActionPlanID); + #region 评标小组成员名单 + string strSql = @" SELECT Number = row_number() over(order by ID) + ,APP.ApproveUserName as Name + ,APP.ApproveUserSpecial as Special + ,APP.ApproveUserUnit as Unit + ,APP.Remarks as Remarks" + + @" FROM PHTGL_BidApproveUserReview_Sch1 AS APP " + + @"where 1=1 AND ApproveUserReviewID = @ApproveUserReviewID "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ApproveUserReviewID", Id)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + tb.TableName = "Table"; + Document doc = new Aspose.Words.Document(newUrl); + doc.MailMerge.ExecuteWithRegions(tb); + #endregion + Dictionary Dic_File = new Dictionary(); + Dic_File.Add("txtProjectName", Act.ProjectShortName); + Dic_File.Add("txtBidProject", getFireWork.BidProject); + Dic_File.Add("txtBidDocumentCode", Bid.BidDocumentsCode); + foreach (var item in Dic_File) + { + string[] key = { item.Key }; + object[] value = { item.Value }; + doc.MailMerge.Execute(key, value); + + } + + if (getFireWork.State == Const.ContractReview_Complete) + { + AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + + } + doc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + File.Delete(newUrl); + return doc1; + } + public static void PrintFile( string Id) + { + string rootPath = Funs.RootPath; + + string newUrl = string.Empty; + newUrl = rootPath + "File\\Word\\PHTGL\\施工招标评标小组名单审批表.docx"; + newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var doc = Print( Id); + doc.Save(newUrl); + + //生成PDF文件 + string pdfUrl = newUrl.Replace(".docx", ".pdf"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(pdfUrl); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } } } \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs index 5c828adc..9a260ba4 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +using Aspose.Words; +using System; +using System.Collections.Generic; +using System.IO; using System.Linq; namespace BLL @@ -157,7 +160,120 @@ namespace BLL return list; } + public static Document Print(string Id) + { + string rootPath = Funs.RootPath; + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表.docx"; + var lwfirwork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + if (lwfirwork != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectId)) + { + initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表LW.docx"; + + } + } + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + Document doc = new Aspose.Words.Document(newUrl); + + ///更新书签 + var getFireWork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + var Act = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(getFireWork.ActionPlanID); + var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); + var model_ControlManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ControlManager); + var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); + var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); + + Dictionary Dic_File = new Dictionary(); + Dic_File.Add("txtCode", string.Format("{0:yyyyMMdd}", Convert.ToDateTime(getFireWork.CreatTime))); + Dic_File.Add("txtBidDocumentCode", getFireWork.BidDocumentsCode); + Dic_File.Add("txtProjectName", Act.ProjectShortName); + Dic_File.Add("txtProjectCode", Act.ProjectCode); + Dic_File.Add("txtBidContent", getFireWork.BidContent); + Dic_File.Add("txtBidType", getFireWork.BidType); + Dic_File.Add("txtBidDocumentsName", getFireWork.BidDocumentsName); + Dic_File.Add("Bidding_SendTime", string.Format("{0:D}", getFireWork.Bidding_SendTime)); + Dic_File.Add("Bidding_StartTime", string.Format("{0:D}", getFireWork.Bidding_StartTime)); + + if (getFireWork.State == Const.ContractReview_Complete) + { + Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); + Dic_File.Add("ControlManagerTime", string.Format("{0:D}", DateTime.Parse(model_ControlManager.ApproveDate))); + Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); + Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); + + AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ControlManager", getFireWork.ControlManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + } + else + { + Dic_File.Add("ConstructionManagerTime", " 年 月 日"); + Dic_File.Add("ControlManagerTime", " 年 月 日"); + Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); + Dic_File.Add("ProjectManagerTime", " 年 月 日"); + } + foreach (var item in Dic_File) + { + string[] key = { item.Key }; + object[] value = { item.Value }; + doc.MailMerge.Execute(key, value); + + } + + doc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + File.Delete(newUrl); + return doc1; + + } + public static void PrintFile( string Id) + { + string rootPath = Funs.RootPath; + + var q = GetPHTGL_BidDocumentsReviewById(Id); + string newUrl = string.Empty; + newUrl = rootPath + "File\\Word\\PHTGL\\招标文件审批表.docx"; + newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var doc = Print( Id); + doc.Save(newUrl); + + //生成PDF文件 + string pdfUrl = newUrl.Replace(".docx", ".pdf"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(pdfUrl).Replace("招标文件审批表", q.BidDocumentsCode + "招标文件审批表"); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } } } \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs index 1c931c37..862499b5 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs @@ -1,4 +1,10 @@ -using System.Collections.Generic; +using Aspose.Words; +using NPOI.SS.Formula.Functions; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; using System.Linq; using System.Web.UI.WebControls; @@ -16,7 +22,6 @@ namespace BLL /// public const int Type_MinPrice = 1; - public const string BidReport = "SetSubReview_sch"; public static ListItem[] GetCreateType() { @@ -166,6 +171,224 @@ namespace BLL select x).ToList(); return list; } + public static Document Print(string Id) + { + string rootPath = Funs.RootPath; + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + string strSql = ""; + var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(Id); + var BidUser = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(getFireWork.ApproveUserReviewID); + var BidDoc = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidUser.BidDocumentsReviewId); + var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(BidDoc.ActionPlanID); + + + switch (getFireWork.Type) + { + case PHTGL_SetSubReviewService.Type_ConEvaluation: + if (Act != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法)LW.docx"; + + } + else + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法).docx"; + + } + } + strSql = @" SELECT + Sch2.Company as Company + ,Sch2.Price_ReviewResults as Price_ReviewResults + ,Sch2.Skill_ReviewResults as Skill_ReviewResults + ,Sch2.Business_ReviewResults as Business_ReviewResults + ,Sch2.Synthesize_ReviewResults as Synthesize_ReviewResults + ,Sch2.Remarks as Remarks " + + @" FROM PHTGL_SetSubReview_Sch2 AS Sch2 " + + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; + break; + case PHTGL_SetSubReviewService.Type_MinPrice: + if (Act != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法)LW.docx"; + + } + else + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法).docx"; + + } + } + strSql = @" SELECT + Sch1.Company as Company + ,Sch1.ReviewResults as ReviewResults + ,Sch1.Remarks as Remarks " + + @" FROM PHTGL_SetSubReview_Sch1 AS Sch1 " + + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; + break; + + } + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + + List listStr = new List(); + listStr.Add(new SqlParameter("@SetSubReviewID", Id)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + tb.TableName = "Table"; + Document doc = new Aspose.Words.Document(newUrl); + doc.MailMerge.ExecuteWithRegions(tb); + + var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); + var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); + var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); + var model_DeputyGeneralManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.DeputyGeneralManager); + + Dictionary Dic_File = new Dictionary(); + Dic_File.Add("txtSetSubReviewCode", getFireWork.SetSubReviewCode); + Dic_File.Add("txtBidDocumentsCode", BidDoc.BidDocumentsCode); + Dic_File.Add("txtProjectName", Act.ProjectShortName); + Dic_File.Add("txtBidContent", BidDoc.BidContent); + Dic_File.Add("txtBidding_StartTime", string.Format("{0:D}", BidDoc.Bidding_StartTime)); + + if (getFireWork.State == Const.ContractReview_Complete) + { + + Dic_File.Add("txtConstructionManagerIdea", model_ConstructionManager.ApproveIdea.Length > 3 ? model_ConstructionManager.ApproveIdea : "同意"); + Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); + + Dic_File.Add("txtApproval_ConstructionIdea", model_Approval_Construction.ApproveIdea.Length > 3 ? model_Approval_Construction.ApproveIdea : "同意"); + Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); + + Dic_File.Add("ProjectManagerIdea", model_ProjectManager.ApproveIdea.Length > 3 ? model_ProjectManager.ApproveIdea : "同意"); + Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); + + Dic_File.Add("txtDeputyGeneralManagerIdea", model_DeputyGeneralManager.ApproveIdea.Length > 3 ? model_DeputyGeneralManager.ApproveIdea : "同意"); + Dic_File.Add("DeputyGeneralManagerTime", string.Format("{0:D}", DateTime.Parse(model_DeputyGeneralManager.ApproveDate))); + + AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); + AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + + } + else + { + Dic_File.Add("txtConstructionManagerIdea", ""); + Dic_File.Add("ConstructionManagerTime", " 年 月 日"); + + Dic_File.Add("txtApproval_ConstructionIdea", ""); + Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); + + Dic_File.Add("ProjectManagerIdea", ""); + Dic_File.Add("ProjectManagerTime", " 年 月 日"); + + Dic_File.Add("txtDeputyGeneralManagerIdea", ""); + Dic_File.Add("DeputyGeneralManagerTime", " 年 月 日"); + + } + foreach (var item in Dic_File) + { + string[] key = { item.Key }; + object[] value = { item.Value }; + doc.MailMerge.Execute(key, value); + } + + + doc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + + File.Delete(newUrl); + return doc1; + } + public static void PrintFile(string Id) + { + string rootPath = Funs.RootPath; + + string newUrl = string.Empty; + string initTemplatePath = string.Empty; + var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(Id); + var BidUser = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(getFireWork.ApproveUserReviewID); + var BidDoc = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidUser.BidDocumentsReviewId); + var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(BidDoc.ActionPlanID); + + switch (getFireWork.Type) + { + case PHTGL_SetSubReviewService.Type_ConEvaluation: + if (Act != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法)LW.docx"; + + } + else + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法).docx"; + + } + } + + break; + case PHTGL_SetSubReviewService.Type_MinPrice: + if (Act != null) + { + if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法)LW.docx"; + + } + else + { + initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法).docx"; + + } + } + + break; + + } + + newUrl = rootPath + initTemplatePath; + newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var doc = Print(Id); + doc.Save(newUrl); + + //生成PDF文件 + string pdfUrl = newUrl.Replace(".docx", ".pdf"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(pdfUrl); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } } } \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs index f7be72f6..006edb7c 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs +++ b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs @@ -268,7 +268,7 @@ namespace BLL /// 合同评审、审批表 /// /// - public static void Print(string ContractReviewId) + public static Document Print(string ContractReviewId) { string rootPath = Funs.RootPath; string initTemplatePath = string.Empty; @@ -281,7 +281,6 @@ namespace BLL { initTemplatePath = "File\\Word\\PHTGL\\合同评审、审批表Old.docx"; - } else { @@ -542,7 +541,7 @@ namespace BLL { File.Delete(newUrl); } - return; + return null; } @@ -576,17 +575,35 @@ namespace BLL } } var table0 = docc.GetChildNodes(NodeType.Table, true)[0] as Aspose.Words.Tables.Table; - docc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + File.Delete(newUrl); + return doc1; + } + + public static void PrintFile( string ContractReviewId) + { + string rootPath = Funs.RootPath; + var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId); + var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId); + + string newUrl = string.Empty; + newUrl = rootPath + "File\\Word\\PHTGL\\合同评审、审批表.docx"; + newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var doc = Print(ContractReviewId); + doc.Save(newUrl); //生成PDF文件 string pdfUrl = newUrl.Replace(".docx", ".pdf"); - BLL.AsposeWordHelper.WordIntoPdf(newUrl, pdfUrl); - - //Document doc1 = new Aspose.Words.Document(newUrl); - //if (doc1 == null) { throw new Exception("Word文件无效"); } - //doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 - string fileName = Path.GetFileName(filePath).Replace("合同评审", txtContractNum + "合同评审"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(pdfUrl).Replace("合同评审", getFireWork.ContractNum + "合同评审"); FileInfo info = new FileInfo(pdfUrl); long fileSize = info.Length; System.Web.HttpContext.Current.Response.Clear(); @@ -598,6 +615,37 @@ namespace BLL System.Web.HttpContext.Current.Response.Close(); File.Delete(newUrl); File.Delete(pdfUrl); + + } + + public static void PrintApprovalForm(string ContractReviewId) + { + var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId); + var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId); + switch (getFireWork.ConfirmWay) + { + case "1": + break; + case "2": + break; + case "3": + break; + case "4": + break; + case "5": + break; + case "6": + break; + } + } + public static void PrintApprovalFormType_Act() + { + } + public static void PrintApprovalFormType_SetSub() + { + } + public static void PrintApprovalFormType__Con() + { } /// /// 分包合同协议书 @@ -969,8 +1017,6 @@ namespace BLL return doc; } - - #region 附件 public static Document sch1(string AttachUrlId, int schnumber) { diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index e64293cc..0cb1f5ac 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -656,7 +656,6 @@ namespace BLL QRCodeAttachUrl = person.QRCodeAttachUrl, IDCardUrl = person.IDCardUrl, IDCardBackUrl = person.IDCardBackUrl, - SignatureUrl = person.SignatureUrl, IsForeign = person.IsForeign, PersonType = person.PersonType, MaritalStatus = person.MaritalStatus, @@ -696,6 +695,12 @@ namespace BLL { ///生成二维码 newPerson.QRCodeAttachUrl = BLL.CreateQRCodeService.CreateCode_Simple("person$" + person.IdentityCard); + } + if (!string.IsNullOrEmpty(person.SignatureUrl)) + { + newPerson. SignatureUrl = person.SignatureUrl; + + } db.Person_Persons.InsertOnSubmit(newPerson); db.SubmitChanges(); @@ -751,7 +756,11 @@ namespace BLL newPerson.HeadImage = person.HeadImage; newPerson.IDCardUrl = person.IDCardUrl; newPerson.IDCardBackUrl = person.IDCardBackUrl; - newPerson.SignatureUrl = person.SignatureUrl; + if (!string.IsNullOrEmpty(person.SignatureUrl)) + { + newPerson.SignatureUrl = person.SignatureUrl; + + } newPerson.IsForeign = person.IsForeign; newPerson.PersonType = person.PersonType; newPerson.MaritalStatus = person.MaritalStatus; @@ -845,7 +854,12 @@ namespace BLL table.QRCodeAttachUrl = newtable.QRCodeAttachUrl; table.IDCardUrl = newtable.IDCardUrl; table.IDCardBackUrl = newtable.IDCardBackUrl; - table.SignatureUrl = newtable.SignatureUrl; + if (!string.IsNullOrEmpty(newtable.SignatureUrl)) + { + table.SignatureUrl = newtable.SignatureUrl; + + + } table.IsForeign = newtable.IsForeign; table.MaritalStatus = newtable.MaritalStatus; table.PoliticsStatus = newtable.PoliticsStatus; @@ -1001,7 +1015,11 @@ namespace BLL newPerson.HeadImage = person.HeadImage; newPerson.IDCardUrl = person.IDCardUrl; newPerson.IDCardBackUrl = person.IDCardBackUrl; - newPerson.SignatureUrl = person.SignatureUrl; + if (!string.IsNullOrEmpty(person.SignatureUrl)) + { + newPerson.SignatureUrl = person.SignatureUrl; + + } newPerson.IsForeign = person.IsForeign; newPerson.PersonType = person.PersonType; newPerson.MaritalStatus = person.MaritalStatus; diff --git a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx new file mode 100644 index 00000000..8fd2ba04 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx @@ -0,0 +1,121 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditOffice.aspx.cs" Inherits="WordEdit.EditOffice" %> + + + + + + + + 首页 - OFFICE文档控件演示示例 + + + + + + + + + + + + +
+
+
重庆软航科技有限公司
+ +
+
+
+
+ + 保存office文档 + +
+
+
+
+
+
+ + diff --git a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs new file mode 100644 index 00000000..988be538 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs @@ -0,0 +1,30 @@ +using FineUIPro; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Policy; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WordEdit +{ + public partial class EditOffice : System.Web.UI.Page + { + public string url; + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + url = "http://localhost:8899/File/Word/集团公司安全监督检查管理办法.doc"; + + } + + } + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.designer.cs b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.designer.cs new file mode 100644 index 00000000..68ecb64e --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.designer.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WordEdit +{ + + + public partial class EditOffice + { + } +} diff --git a/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx new file mode 100644 index 00000000..b7971932 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx @@ -0,0 +1,81 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IndexOffice.aspx.cs" Inherits="WordEdit.IndexOffice" %> + + + + + + + + + 首页 - OFFICE文档控件演示示例 + + + + + + + +
+
+
重庆软航科技有限公司
+ +
+
+ + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.cs new file mode 100644 index 00000000..030f4343 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WordEdit +{ + public partial class IndexOffice : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.designer.cs b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.designer.cs new file mode 100644 index 00000000..d3896c5c --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx.designer.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WordEdit +{ + + + public partial class IndexOffice + { + } +} diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/NTKO控件安装程序-评测专用演示版本.exe b/SGGL/FineUIPro.Web/AttachFile/officecontrol/NTKO控件安装程序-评测专用演示版本.exe new file mode 100644 index 00000000..bc1f09b1 Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/NTKO控件安装程序-评测专用演示版本.exe differ diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControl.cab b/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControl.cab new file mode 100644 index 00000000..5df312fe Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControl.cab differ diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControlx64.cab b/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControlx64.cab new file mode 100644 index 00000000..a16112ce Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/OfficeControlx64.cab differ diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/edit_save_office.gif b/SGGL/FineUIPro.Web/AttachFile/officecontrol/edit_save_office.gif new file mode 100644 index 00000000..a97bafa4 Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/edit_save_office.gif differ diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/index.js b/SGGL/FineUIPro.Web/AttachFile/officecontrol/index.js new file mode 100644 index 00000000..fbd8f934 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/officecontrol/index.js @@ -0,0 +1,116 @@ +var datatochildcmd = ""; +var ntko;//控件对象 +var savecode = "save.aspx";//保存文档程序程序 +document.write("") +window.onbeforeunload = function (e) { + /*ntkocloseparentpage();*/ +} +function getQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + var r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); + + return null; + +} +function openhtml(url) { + intializePage(); + ntko = document.getElementById("TANGER_OCX"); + if (window.navigator.platform == "Win32") { + ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.1.0", "officecontrol/ntkooledocall.cab", 51, true); + } + if (window.navigator.platform == "Win64") { + ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.1.0", "officecontrol/ntkooledocallx64.cab", 51, true); + } + if (url != '') { + + ntko.OpenFromURL(url); + + } + /*if (cmd == 1) { + ntko.OpenFromURL("ntkocreatnew.docx"); + } + else { + ntko.OpenFromURL("aboutus.docx"); + }*/ +} + //保存office文档 +function saveFileToUrl(url) { + var fileName = url; + +/* if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域 + var result, filedot; + if (IsFileOpened) { + switch (ntko.doctype) { + case 1: + fileType = "Word.Document"; + filedot = ".doc"; + break; + case 2: + fileType = "Excel.Sheet"; + filedot = ".xls"; + break; + case 3: + fileType = "PowerPoint.Show"; + filedot = ".ppt"; + break; + case 4: + fileType = "Visio.Drawing"; + filedot = ".vso" + break; + case 5: + fileType = "MSProject.Project"; + filedot = ".pro"; + break; + case 6: + fileType = "WPS Doc"; + filedot = ".wps"; + break; + case 7: + fileType = "Kingsoft Sheet"; + filedot = ".et"; + break; + default: + fileType = "unkownfiletype"; + filedot = ".doc"; + }*/ + retHTML = ntko.saveToURL("save.aspx",//提交到的url地址 + "EDITFILE",//文件域的id,类似"); + var locationhref = retHTML.substring(indexa + 3, indexb); + window.location.href = editMScode + "?&url=" + locationhref; + break; + case 1: + erropen(retHTML); + break; + case 2: + erropen(retHTML); + break; + case 3: + erropen(retHTML); + break; + case 4: + erropen(retHTML); + break; + case 5: + erropen(retHTML); + break; + case 6: + erropen(retHTML); + break; + case 100: + erropen(retHTML); + break; + } +} + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js new file mode 100644 index 00000000..dd98acd5 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js @@ -0,0 +1,729 @@ +var ntko;//控件对象 +var savecode = "save.aspx";//保存文档程序程序 +window.onbeforeunload=function(e){ +ntkocloseparentpage(); +} + + +//初始化去打开文档 +function init(cmd) { + intializePage(); + ntko = document.getElementById("TANGER_OCX"); + if(window.navigator.platform=="Win32"){ + ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocall.cab",51,true); + } + if(window.navigator.platform=="Win64"){ + ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocallx64.cab",51,true); + } + if (cmd != "") { + alert(cmd); + ntko.OpenFromURL(cmd); + } + /*if (cmd == 1) + { + ntko.OpenFromURL("ntkocreatnew.docx"); + } + else + { + ntko.OpenFromURL("aboutus.docx"); + }*/ +} + + +//以下变量为JS公共变量 +var TANGER_OCX_bDocOpen = false; +var TANGER_OCX_filename;//文件名称 +var filetype;//文件类型 +var savetype;//文件保存类型 +var TANGER_OCX_actionURL; //For auto generate form fiields +var TANGER_OCX_OBJ; //控件对象 +var TANGER_OCX_Username = "匿名用户";//User Name +var TANGER_OCX_key = "";//设置加载印章的key +var IsFileOpened; //控件是否打开文档 +var svisble = true;//印章显示状态 +var url = "";//初始化URL值 +var newwin, newdoc; + +//创建新的文档 +function CreatNew(newofficetype) { + //根据传递文档类型参数新建文档 + switch (newofficetype) { + case "1": + openoffice(url, newofficetype) + break + case "2": + openoffice(url, newofficetype) + break + case "3": + openoffice(url, newofficetype) + break + case "4": + openoffice(url, newofficetype) + break + case "5": + openoffice(url, newofficetype) + break + default: + openoffice(url, "1") + break; + } +} +function openoffice(url, newofficetype) { + window.open(editMScode + "?newofficetype=" + newofficetype + "&url=" + url, "editoffice", "top=0,left=0,scrollbars=yes,resizable=yes"); +} +//当前表单不可编辑,当整个表单只读时调用 +function FormDisabled(bool) { + var formid = document.forms.item(0) + var elelength = formid.length; + for (var i = 0; i < elelength; i++) { formid.elements[i].disabled = bool; } + //下面是控件标题栏,状态栏,工具栏,菜单栏不显示 + TANGER_OCX_OBJ.TitleBar = !bool; + TANGER_OCX_OBJ.Statusbar = !bool; + TANGER_OCX_OBJ.ToolBars = !bool; + TANGER_OCX_OBJ.Menubar = !bool; + document.getElementById("editmain_left").style.display = "none"; + document.getElementById("editmain_right").style.width = "95%"; +} +//示例程序帮助文档 +function NtkoHelp() { + window.open("help.htm", "help"); +} +//编辑文档 +function editoffice(url, newofficetype) { + TANGER_OCX_OBJ = document.all.item("TANGER_OCX");//;初始化控件对象 + //根据文档URL和newofficetype编辑文档,如果有url是编辑已有文档,如果为空根据newofficetype新建文档 + if ((typeof (url) != "undefined") && (url != "")) { + var filename = document.all("filename").value; + // alert(filename); + try { TANGER_OCX_OBJ.BeginOpenFromURL("uploadOfficeFile/" + filename); } catch (err) { }; + } + else { + switch (newofficetype) { + //新建文档 + case "1": + TANGER_OCX_OBJ.CreateNew("word.document");//word文档 + break + case "2": + TANGER_OCX_OBJ.CreateNew("excel.sheet");//excel电子表格 + break + case "3": + TANGER_OCX_OBJ.CreateNew("PowerPoint.Show");//微软幻灯片 + break + case "4": + TANGER_OCX_OBJ.CreateNew("WPS.Document");//金山文档 + break + case "5": + TANGER_OCX_OBJ.CreateNew("ET.WorkBook");//金山电子表格 + break + default: + alert("文档编辑出错!") + break + } + } +} +function intializePage() { + TANGER_OCX_OBJ = document.getElementById("TANGER_OCX"); +} +//文档编辑页面关闭事件 +function onPageClose() { + if (IsFileOpened) { + if (!TANGER_OCX_OBJ.ActiveDocument.Saved) { + if (confirm("文档修改过,还没有保存,是否需要保存?")) { + saveFileToUrl(); + } + } + + } +} +function TANGER_OCX_OpenDoc(fileUrl) { + if (fileUrl != null || fileUrl != "") { + TANGER_OCX_OBJ.BeginOpenFromURL(fileUrl); + } + else { + alert("dd"); + TANGER_OCX_OBJ.BegingOpenFromURL("templateFile/newWordTemplate.doc") + } +} +//设置文件是打开还是关闭 +function setFileOpenedOrClosed(bool) { + IsFileOpened = bool; + //fileType = TANGER_OCX_OBJ.DocType; +} +function trim(str) { //删除左右两端的空格 + return str.replace(/(^\s*)|(\s*$)/g, ""); +} +function erropen(retHTML) { + newwin = window.open("", "_blank", "left=200,top=200,width=400,height=300,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,resizable=1", false); + newdoc = newwin.document; + newdoc.open(); + newdoc.write("返回的数据

") + newdoc.write(retHTML + "kdkd
"); + newdoc.write(""); + newdoc.write('
'); + newdoc.close(); +} +//保存office文档 +function saveFileToUrl() { + var fileName ="ntkocreatnew.docx" + /* + if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域 + var result, filedot; + if (IsFileOpened) { + switch (ntko.doctype) { + case 1: + fileType = "Word.Document"; + filedot = ".doc"; + break; + case 2: + fileType = "Excel.Sheet"; + filedot = ".xls"; + break; + case 3: + fileType = "PowerPoint.Show"; + filedot = ".ppt"; + break; + case 4: + fileType = "Visio.Drawing"; + filedot = ".vso" + break; + case 5: + fileType = "MSProject.Project"; + filedot = ".pro"; + break; + case 6: + fileType = "WPS Doc"; + filedot = ".wps"; + break; + case 7: + fileType = "Kingsoft Sheet"; + filedot = ".et"; + break; + default: + fileType = "unkownfiletype"; + filedot = ".doc"; + }*/ + retHTML = ntko.saveToURL("save.aspx",//提交到的url地址 + "EDITFILE",//文件域的id,类似"); + var locationhref = retHTML.substring(indexa + 3, indexb); + window.location.href = editMScode + "?&url=" + locationhref; + break; + case 1: + erropen(retHTML); + break; + case 2: + erropen(retHTML); + break; + case 3: + erropen(retHTML); + break; + case 4: + erropen(retHTML); + break; + case 5: + erropen(retHTML); + break; + case 6: + erropen(retHTML); + break; + case 100: + erropen(retHTML); + break; + } + } + else { + alert("不能执行保存,没有编辑文档!"); + }*/ +} +//保存office文档1 +function saveFileToUrl1() { + var fileName = "aboutus.docx"; + alert(fileName); + if (fileName.length == 0) { alert("请输入文件标题!"); return false; } //判断文件标题输入域 + var result, + retHTML = ntko.saveToURL(savecode, //提交到的url地址 + "EDITFILE", //文件域的id,类似
" + retHTML + "
"); + newdoc.close(); + window.opener.focus(); +} +//保存office文档1 +function saveFileToUrl2() { + var fileName = "test.doc"; + if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; } //判断文件标题输入域 + var result, + retHTML = ntko.saveToURL(savecode, //提交到的url地址 + "EDITFILE", //文件域的id,类似
" + retHTML + "
"); + newdoc.close(); + window.opener.focus(); +} +//保存文档为html文件到服务器 +function saveFileAsHtmlToUrl() { + var fileName = trim(document.all("filetitle").value); + if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域 + var result, filedot; + if (IsFileOpened) { + switch (TANGER_OCX_OBJ.doctype) { + case 1: + fileType = "Word.Document"; + filedot = ".doc"; + break; + case 2: + fileType = "Excel.Sheet"; + filedot = ".xls"; + break; + case 3: + fileType = "PowerPoint.Show"; + filedot = ".ppt"; + break; + case 4: + fileType = "Visio.Drawing"; + filedot = ".vso" + break; + case 5: + fileType = "MSProject.Project"; + filedot = ".pro"; + break; + case 6: + fileType = "WPS Doc"; + filedot = ".wps"; + break; + case 7: + fileType = "Kingsoft Sheet"; + filedot = ".et"; + break; + default: + fileType = "unkownfiletype"; + filedot = ".doc"; + } + retHTML = TANGER_OCX_OBJ.PublishAsHTMLToURL(savecode,//提交到的url地址 + "EDITFILE",//文件域的id,类似
" + retHTML + "
"); + newdoc.close(); + window.opener.focus(); + } + else { + alert("不能执行保存,没有编辑文档!"); + } +} +//保护文档为pdf格式 +function saveFileAsPdfToUrl() { + var fileName = trim(document.all("filetitle").value); + if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域 + var result, filedot; + if (IsFileOpened && TANGER_OCX_OBJ.IsPDFCreatorInstalled()) { + switch (TANGER_OCX_OBJ.doctype) { + case 1: + fileType = "Word.Document"; + filedot = ".doc"; + break; + case 2: + fileType = "Excel.Sheet"; + filedot = ".xls"; + break; + case 3: + fileType = "PowerPoint.Show"; + filedot = ".ppt"; + break; + case 4: + fileType = "Visio.Drawing"; + filedot = ".vso" + break; + case 5: + fileType = "MSProject.Project"; + filedot = ".pro"; + break; + case 6: + fileType = "WPS Doc"; + filedot = ".wps"; + break; + case 7: + fileType = "Kingsoft Sheet"; + filedot = ".et"; + break; + default: + fileType = "unkownfiletype"; + filedot = ".doc"; + } + TANGER_OCX_OBJ.PublishAsPDFToURL(savecode,//提交到的url地址 + "EDITFILE",//文件域的id,类似=45) + { + + var img; + img = new Image(); + img.src = "chrome-extension://lppkeogbkjlmmbjenbogdndlgmpiddda/icons/ntko.png"; + img.onload = function() { + bChromeExtensionInstalled = true; + }; + img.onerror = function() { + bChromeExtensionInstalled = false; + }; + } + if("edg"===browserMatch.browser){ + + var img; + img = new Image(); + img.src = "chrome-extension://miogdolpaknhgnfoghcmnooafkiafkcc/icons/ntko.png"; + img.onload = function() { + bChromeExtensionInstalled = true; + }; + img.onload = function() { + bChromeExtensionInstalled = true; + }; + } + +var ntkoBrowser = { +ntkoSendDataToChild:function( strURL, data) +{ + //console.log(strURL); + if ( typeof data === 'undefined' ){ + return; + } + var strURL=ntkoBrowser.NtkoStrURL(strURL); + var jsonValue = '{"SendDataToChild":1,"GUID":"'; + jsonValue += varNtkoGUID; + jsonValue += '","URLMD5":"'; + jsonValue += b64_md5(strURL); + jsonValue += '","ChildValue":"'; + jsonValue += data; + jsonValue += '"}'; + var ntkobr=ntkoBrowser.NtkoBrower(); + if(ntkobr){ + window.postMessage({ type: "FROM_NTKO_PAGE", text: jsonValue }, "*"); + }else{ + ntkoWinOpen.ntkoGetParentData(data); + } +}, +ExtensionInstalled:function() +{ + var ntkobr=ntkoBrowser.NtkoBrower(); + if(!ntkobr){ + if(browser=="IE"){ + return true; + }else{ + var mimetype=navigator.mimeTypes["application/ntko-plug"]; + if(mimetype){ + var plugin=mimetype.enabledPlugin; + if(plugin){ + return true; + }else{ + return false; + } + }else{ + return false; + } + } + } + else + { + if( "firefox" === browserMatch.browser ) + { + if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){ + + return true; + }else{ + var bInstalled = false; + if( "undefined" === typeof FirefoxInstalled ) + return ( bInstalled ); + else + return( window.FirefoxInstalled()); + } + } + else if( "chrome" === browserMatch.browser ) + { + + if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){ + + return true; + }else{ + return (bChromeExtensionInstalled); + } + } else if("edg" === browserMatch.browser){ + if(( typeof ntkoextensionmainifest != 'undefined' ) && ( ( null != ntkoextensionmainifest ) && ( "" != ntkoextensionmainifest ))){ + return true; + }else{ + return( bChromeExtensionInstalled ); + } + } + } +}, + +ntkoClose:function( strURL ) +{ + var strURL=ntkoBrowser.NtkoStrURL(strURL); + var jsonValue = '{"Close":1,"GUID":"'; + jsonValue += varNtkoGUID; + jsonValue += '","URLMD5":"'; + jsonValue += b64_md5(strURL); + jsonValue += '"}'; + var ntkobr=ntkoBrowser.NtkoBrower(); + if(ntkobr){ + window.postMessage({ type: "FROM_NTKO_PAGE", text: jsonValue }, "*"); + }else{ + ntkoWinOpen.close(); + } +}, +openWindow:function( strURL,IsShowOnExtendMonitor,ProductCaption, ntkoBrowserProductKey, ntkoBrowserNoExpireKey, ntkoBrowserOptions,varUrlData,ntkowidth,ntkoheight,cookiesDomainPath ) +{ + + if(varUrlData!=null&&varUrlData!=""){ + ntkoSendDataToChildSData=varUrlData; + } + var ntkowinscr= ntkoBrowser.NtkoWidthAndHeightWinScr(ntkowidth,ntkoheight); + if(!ntkowinscr){ + alert("设置窗口大小格式不正确"); + return; + } + + var strURL=ntkoBrowser.NtkoStrURL(strURL); + strURL1=strURL; + var ntkoSessionURL=""; + var jsonValue = '{"OpenWindow":1,"URL":"'; + jsonValue += strURL; + jsonValue += '","GUID":"'; + jsonValue += varNtkoGUID; + jsonValue += '","URLMD5":"'; + jsonValue +=b64_md5(strURL); + jsonValue += '","ntkobrowserMatch":"'; + jsonValue +=browserMatch.browser; + jsonValue += '","IsShowOnExtendMonitor":"'; + jsonValue += IsShowOnExtendMonitor; + jsonValue += '"'; + if( ( typeof ProductCaption != 'undefined' ) && ( ( null != ProductCaption ) && ( "" != ProductCaption ) ) ) + { + jsonValue += ',"ProductCaption":"'; + jsonValue += ProductCaption; + jsonValue += '"'; + } + + if( ( typeof ntkoBrowserProductKey != 'undefined' ) && ( ( null != ntkoBrowserProductKey ) && ( "" != ntkoBrowserProductKey ) ) ) + { + jsonValue += ',"ProductKey":"'; + jsonValue += ntkoBrowserProductKey; + jsonValue += '"'; + } + + if( ( typeof ntkoBrowserNoExpireKey != 'undefined' ) && ( ( null != ntkoBrowserNoExpireKey ) &&( "" != ntkoBrowserNoExpireKey ) ) ) + { + jsonValue += ',"NoExpireKey":"'; + jsonValue += ntkoBrowserNoExpireKey; + jsonValue += '"'; + } + if( typeof ntkoSessionURL != 'undefined' && ( ( null != ntkoSessionURL ) && ( "" != ntkoSessionURL ) ) ) + { + jsonValue += ',"SessionURL":"'; + jsonValue += ntkoSessionURL; + jsonValue += '"'; + } + + if( typeof ntkoBrowserOptions != 'undefined' && ( ( null != ntkoBrowserOptions ) && ( "" != ntkoBrowserOptions ) ) ) + { + jsonValue += ',"Options":"'; + jsonValue += ntkoBrowserOptions; + jsonValue += '"'; + } + + + + var LocalStorge = window.localStorage; + if( typeof LocalStorge != 'undefined' && ( 0 != LocalStorge.length ) ) + { + var varLocalDataList = []; + for( var i = 0; i < LocalStorge.length; i++ ) + { + var varLocalData = {}; + varLocalData["StorageKey"] = LocalStorge.key(i); + varLocalData["StorageValue"] = LocalStorge.getItem(LocalStorge.key(i)); + varLocalDataList[i] = varLocalData; + } + jsonValue += ',"LocalStorge":'; + jsonValue += JSON.stringify(varLocalDataList);; + jsonValue += ''; + } + + var SessionStorge = window.sessionStorage; + if( typeof SessionStorge != 'undefined' && ( 0 != SessionStorge.length ) ) + { + var varSessionDataList = []; + for( var i = 0; i < SessionStorge.length; i++ ) + { + var varSessionData = {}; + varSessionData["StorageKey"] = SessionStorge.key(i); + varSessionData["StorageValue"] = SessionStorge.getItem(SessionStorge.key(i)); + varSessionDataList[i] = varSessionData; + } + + jsonValue += ',"SessionStorge":'; + jsonValue += JSON.stringify(varSessionDataList); + jsonValue += ''; + } + if( typeof ntkowidth != 'undefined' && ( ( null != ntkowidth ) && ( "" != ntkowidth ) ) ) + { + jsonValue += ',"NtkoWidth":'; + jsonValue += ntkowidth; + jsonValue += ''; + } + + if( typeof ntkoheight != 'undefined' && ( ( null != ntkoheight ) && ( "" != ntkoheight ) ) ) + { + jsonValue += ',"NtkoHeight":'; + jsonValue += ntkoheight; + jsonValue += ''; + } + if( typeof cookiesDomainPath != 'undefined' && ( ( null != cookiesDomainPath ) && ( "" != cookiesDomainPath ) ) ) + { + jsonValue += ',"CookiesDomainPath":'; + jsonValue += cookiesDomainPath; + jsonValue += ''; + } + + jsonValue += '}'; + var ntkobr=ntkoBrowser.NtkoBrower(); + if(ntkobr){ + window.postMessage({type: "FROM_NTKO_PAGE", text: jsonValue}, "*"); + }else{ + ntkowin=b64_md5(strURL); + if(ntkowidth==null||ntkowidth=="" ||ntkowidth=="undefined"){ + ntkowidth=window.screen.width; + } + if(ntkoheight==null||ntkoheight==""||ntkoheight=="undefined"){ + ntkoheight=window.screen.height; + } + ntkoWinOpen=window.open(strURL,ntkowin,"height="+ntkoheight+", width="+ntkowidth+", top=0,left=0,titlebar=no,toolbar =no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no"); + ntkoWinOpen.resizeTo(ntkowidth,ntkoheight); + ntkoWinOpen.focus(); + } + }, + NtkoWShell:function(){ + + }, + NtkoiTop:function(){ + return (window.screen.height-30-300)/2; + }, + NtkoiLeft:function(){ + return (window.screen.width-10-400)/2; + }, + NtkoBrower:function(){ + if(browser=="IE"){ + return false; + } + if(browser=="firefox"){ + if(userAgent.indexOf("Windows NT 5.1") > -1){ + return false; + } + if(version>=50){ + return true; + }else{ + return false; + } + } + if(browser=="chrome"){ + if(userAgent.indexOf("Windows NT 5.1") > -1){ + return false; + } + if(version>=45){ + return true; + }else{ + return false; + } + } + if(browser=="edg"){ + return true; + } + }, +NtkoStrURL:function(strURL){ + var testurl =window.location.search; + var docUrl=document.location.toString(); + var wpathname= window.document.location.pathname; + var pos=docUrl.indexOf(wpathname); + var relUrl= docUrl.substring(0,pos); + if( ( null === strURL ) || ( "" === strURL ) ) + { + alert("打开路径的url为null"); + return; + } + var strLowser = strURL.toLowerCase(); + if( '/' != strURL.charAt(0) ) + { + if( ( "http://" === strLowser.substr(0,7) ) || ( "https://" === strLowser.substr(0,8) ) ) + {} + else + { + if(strURL.indexOf("../")==-1) + { + var pathName = window.location.href; + var varLength = pathName.lastIndexOf("/"); + strURL = pathName.substr( 0, varLength + 1 ) + strURL; + } + else + { + var strURLlen=strURL.length; + strURL=strURL.substring(2,strURLlen); + strURL = relUrl +strURL; + } + if(strURL.indexOf(testurl)==-1) + { + if(strURL.indexOf("?")==-1) + { + strURL=strURL+testurl + } + else + { + var docof= strURL.indexOf("?"); + var docend=strURL.length; + var docs=strURL.substring(0,docof); + var docsurl=strURL.substring(docof+1,docend); + strURL=docs+testurl+"&"+docsurl; + } + } + } + } + else + { + var strURLlen=strURL.length; + strURL=strURL.substring(0,strURLlen); + strURL = relUrl+ strURL; + } + return strURL; + }, +NtkoWidthAndHeightWinScr:function(ntkowidth,ntkoheight){ + + var regNtko=/^\s*$/; + if(typeof(ntkowidth)=="undefined"&&typeof(ntkoheight)=="undefined"){ + return true; + }else{ + if(regNtko.test(ntkowidth)||typeof(ntkowidth)!="number"){ + return false; + }else{ + if(regNtko.test(ntkoheight)||typeof(ntkoheight)!="number"){ + return false; + }else{ + return true; + } + } + } + }, +NtkoExtensionVersion:function(){ + if(browser=="firefox"){ + var ntkojsontext = JSON.parse(window.NtkoFireFoxVersion()); + var ntkofireforversion=ntkojsontext['ntkoversion']; + return ntkofireforversion; + }else{ + return ntkoextensionmainifest; + } +} +}; + +if(browser!="IE") +{ + window.addEventListener("message", function(event) + { + if ( event.source != window ) + return; + if (event.data.type && (event.data.type == "FROM_NTKO_CONTEXT_PAGE")) + { + var vJsonData = JSON.parse( event.data.text ); + var jsonData = vJsonData["ntkoData"]; + if( typeof jsonData !== "undefined" ) + { + if( varNtkoGUID === jsonData["ntkoGUID"] ) + { + if( "ntkoClose" === jsonData["functionName"] ) + { + // 调用关闭事件 + try + { + eval('ntkoCloseEvent()'); + } + catch(e) + {} + } + else if( "ntkoReturnValueToParentPage" === jsonData["functionName"] ) + { + // 调用返回值事件,解析值 + var varFunctionName = jsonData["parentExecutionFunction"]; // 要执行的函数名 + if( typeof varFunctionName != 'undefined' && ( ( null != varFunctionName ) && ( "" != varFunctionName ) ) ) + { + var varFunctionAgrvs = jsonData["FunctionArgs"]; // 传递过来的参数值 + if( typeof varFunctionAgrvs != 'undefined' && ( ( null != varFunctionAgrvs ) && ( "" != varFunctionAgrvs ) ) ) + { + // 调用eval执行函数 + eval( varFunctionName + "( varFunctionAgrvs[0], varFunctionAgrvs[1], varFunctionAgrvs[2], varFunctionAgrvs[3]," + + "varFunctionAgrvs[4],varFunctionAgrvs[5],varFunctionAgrvs[6],varFunctionAgrvs[7],varFunctionAgrvs[8]);" ); + } + } + }else if("NtkoError" === jsonData["functionName"]){ + //启动扩展报错信息 + alert(jsonData["NtkoReason"]) + + } + } + } + } + if(event.data.type && (event.data.type == "FROM_NTKO_MANIFEST")){ + var ntkojsontext = JSON.parse( event.data.text ); + ntkoextensionmainifest=ntkojsontext['ntkoversion']; + } + }, false); +} +function ieattachEventntko(data,varFunctionAgrvs) +{ + if( typeof data !== "undefined" ) + { + if( typeof varFunctionAgrvs != 'undefined' && ( ( null != varFunctionAgrvs ) && ( "" != varFunctionAgrvs ) ) ) + { + eval( data + "( varFunctionAgrvs[0], varFunctionAgrvs[1], varFunctionAgrvs[2], varFunctionAgrvs[3]," + + "varFunctionAgrvs[4],varFunctionAgrvs[5],varFunctionAgrvs[6],varFunctionAgrvs[7],varFunctionAgrvs[8]);" ); + } + } +} +function ntkoSendDataToChildtext(ntkoDataSendUrl) +{ + if(ntkoSendDataToChildSData!=null&&ntkoSendDataToChildSData!="") + { + ntkoBrowser.ntkoSendDataToChild(ntkoDataSendUrl,ntkoSendDataToChildSData); + } +} +/*___md5___*/ + +var hexcase = 0; +var b64pad = ""; +var chrsz = 8; +function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} +function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} +function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} +function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } +function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } +function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } +function md5_vm_test() +{ + return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; +} +function core_md5(x, len) +{ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); +} +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +function core_hmac_md5(key, data) +{ + var bkey = str2binl(key); + if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); + var ipad = Array(16), opad = Array(16); + for(var i = 0; i < 16; i++) + { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); + return core_md5(opad.concat(hash), 512 + 128); +} +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} +function str2binl(str) +{ + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); + return bin; +} +function binl2str(bin) +{ + var str = ""; + var mask = (1 << chrsz) - 1; + for(var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); + return str; +} +function binl2hex(binarray) +{ + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); + } + return str; +} +function binl2b64(binarray) +{ + + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i += 3) + { + var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) + | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) + | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); + for(var j = 0; j < 4; j++) + { + if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; + else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); + } + } + return str; +} diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkoofficecontrol.min.js b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkoofficecontrol.min.js new file mode 100644 index 00000000..cc70f4a2 --- /dev/null +++ b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkoofficecontrol.min.js @@ -0,0 +1,231 @@ +/*------------------------------------------------------*/ +/* 修改控件的配置信息 */ +/* version:3.6.3 */ +/* 2022.12.05版本 跟随 评测专用演示版本 产品 发送 */ +/*------------------------------------------------------*/ +//64位控件的calssid +var classidx64="A64E3073-2016-4baf-A89D-FFE1FAA10EE0"; +//32位控件的classid +var classid="A64E3073-2016-4baf-A89D-FFE1FAA10EC0"; +//32位控件包的路径 +var codebase="officecontrol/OfficeControl.cab#version=6.0.0.6"; +//64位控件包的路径 +var codebase64="officecontrol/OfficeControlx64.cab#version=6.0.0.6"; +//设置高度 +var height="800px"; +//设置宽度 +var width="100%"; +//买断授权密钥如果不是买断可以不用写 +var MakerCaption=""; +//买断授权密钥如果不是买断可以不用写 +var MakerKey=""; +//密钥 +var ProductCaption=""; +//密钥 +var ProductKey=""; +//解除时间密钥 +var NoExpireKey=""; + +/* +谷歌浏览器事件接管但此接管事件只支持低版本的谷歌(45以下版本不包含45)和火狐(52以下版本不包含52) +*/ +function ntkosavetourl(type,code,html) +{ + //alert("SaveToURL成功回调"); +} + + +function ntkopublishashtml(type,code,html){ + //alert("Onpublishashtmltourl成功回调"); +} +function ntkopublishaspdf(type,code,html){ +//alert("Onpublishaspdftourl成功回调"); +} +function ntkosaveasotherurl(type,code,html){ +//alert("SaveAsOtherformattourl成功回调"); +} + +function ntkoondocumentopened(type,code){ + //alert("Ondocumentopened成功回调"); + if(cmd==5){ + if(datavalue==1){ + ntko.ShowTipMessage("注意","已经接收到父页面传过来的值,请注意文档中内容的变化"); + ntkoDataToChild(datatext); + } + } +} + +function OnCustomButtonOnMenuCmd(btnPos, btnCaption, btnID){ + + if(0 == btnCmdid) //切换全屏 + { +//事件处理代码中可以直接引用控件属性或者方法, +//可以省略控件对象前缀 + FullScreenMode = !FullScreenMode; + } + else if(1 == btnCmdid) + { + DoHandSign2('tanger'); + } + else if(2 == btnCmdid) + { + + } + else if(3 == btnCmdid) + { + + } + +} + + + + +/*------------------------------------------------------*/ +/* 以下内容 请勿修改,否则可能出错 */ +/*------------------------------------------------------*/ + + var userAgent = navigator.userAgent, + rMsie = /(msie\s|trident.*rv:)([\w.]+)/, + rFirefox = /(firefox)\/([\w.]+)/, + rOpera = /(opera).+version\/([\w.]+)/, + rChrome = /(chrome)\/([\w.]+)/, + rSafari = /version\/([\w.]+).*(safari)/; + var browser; + var version; + var ua = userAgent.toLowerCase(); + function uaMatch(ua) { + var match = rMsie.exec(ua); + if (match != null) { + return { browser : "IE", version : match[2] || "0" }; + } + var match = rFirefox.exec(ua); + if (match != null) { + return { browser : match[1] || "", version : match[2] || "0" }; + } + var match = rOpera.exec(ua); + if (match != null) { + return { browser : match[1] || "", version : match[2] || "0" }; + } + var match = rChrome.exec(ua); + if (match != null) { + return { browser : match[1] || "", version : match[2] || "0" }; + } + var match = rSafari.exec(ua); + if (match != null) { + return { browser : match[2] || "", version : match[1] || "0" }; + } + if (match != null) { + return { browser : "", version : "0" }; + } + } + var browserMatch = uaMatch(userAgent.toLowerCase()); + if (browserMatch.browser) { + browser = browserMatch.browser; + version = browserMatch.version; + } + + +if (browser=="IE"){ + if(window.navigator.platform=="Win32"){ + + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write('不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。 '); + document.write(''); + } + if(window.navigator.platform=="Win64"){ + + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write(' '); + document.write('不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。 '); + document.write(''); + } +} +else if (browser=="firefox"){ + document.write(''); + document.write('尚未安装NTKO Web FireFox跨浏览器插件 '); + document.write(' '); +}else if(browser=="chrome"){ + document.write(''); + document.write('尚未安装NTKO Web Chrome跨浏览器插件 '); + document.write(''); + }else if (Sys.opera){ + alert("sorry,ntko web印章暂时不支持opera!"); + }else if (Sys.safari){ + alert("sorry,ntko web印章暂时不支持safari!"); + } +window.onunload =function(){ + var ntkojb= ntkoBrowser.NtkoJudgingBrowsers(); + if(ntkojb){ + window.opener.ntkoCloseEvent(); + } +} + +//ie,谷歌,火狐传值 +var ntkoBrowser={ + ntkoSetReturnValueToParentPage:function(data1,text1){ + var ntkojb= ntkoBrowser.NtkoJudgingBrowsers(); + if(ntkojb){ + window.opener.ieattachEventntko(data1,text1); + }else{ + window.external.SetReturnValueToParentPage(data1,text1); + } + }, + NtkoJudgingBrowsers:function(){ + try{ + var ntkobtop=window.opener.top.browser; + return true; + }catch(err){ + return false; + } + } +} +//触发父页面传值的功能 +var NtkoUrlTest = window.location.href; +if(NtkoUrlTest!=null&&NtkoUrlTest!=""){ + var ntkoarry=new Array(); + ntkoarry.push(NtkoUrlTest); + ntkoBrowser.ntkoSetReturnValueToParentPage("ntkoSendDataToChildtext",ntkoarry); +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocall.cab b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocall.cab new file mode 100644 index 00000000..cdc57490 Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocall.cab differ diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocallx64.cab b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocallx64.cab new file mode 100644 index 00000000..4b014501 Binary files /dev/null and b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntkooledocallx64.cab differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 091c8ffe..e85472ee 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -195,6 +195,17 @@ + + + + + + + + + + + @@ -288,8 +299,10 @@ + + @@ -1444,6 +1457,7 @@ + @@ -6075,6 +6089,13 @@ themes.aspx + + EditOffice.aspx + ASPXCodeBehind + + + EditOffice.aspx + Fastreport.aspx ASPXCodeBehind @@ -6089,6 +6110,13 @@ FlowOperateControl.ascx + + IndexOffice.aspx + ASPXCodeBehind + + + IndexOffice.aspx + QRCodePrint.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanFormation.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanFormation.aspx.cs index 8147f74e..32d34fae 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanFormation.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanFormation.aspx.cs @@ -397,354 +397,8 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement } string Id = Grid1.SelectedRowID; - Print(Id); + BLL.PHTGL_ActionPlanFormationService.PrintFile( Id); } - - /// - /// ActionPlanID - /// - /// - public void Print(string Id) - { - string rootPath = Server.MapPath("~/"); - string initTemplatePath = string.Empty; - string uploadfilepath = string.Empty; - string newUrl = string.Empty; - string filePath = string.Empty; - var lwfirwork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); - initTemplatePath = "File\\Word\\PHTGL\\施工招标实施计划审批表.docx"; - if (lwfirwork != null) - { - if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectID)) - { - initTemplatePath = "File\\Word\\PHTGL\\施工招标实施计划审批表LW.docx"; - - } - } - uploadfilepath = rootPath + initTemplatePath; - newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); - filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); - if (File.Exists(newUrl)) - { - File.Delete(newUrl); - } - File.Copy(uploadfilepath, newUrl); - ///更新书签 - var getFireWork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); - var Act = PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewByActionPlanID(Id); - var list = PHTGL_ActionPlanFormation_Sch1Service.GetListPHTGL_ActionPlanFormation_Sch1ById(Id); - - Document doc = new Aspose.Words.Document(newUrl); - Bookmark txtActionPlanCode = doc.Range.Bookmarks["ActionPlanCode"]; - Bookmark txtBidProject = doc.Range.Bookmarks["txtBidProject"]; - Bookmark txtName = doc.Range.Bookmarks["txtName"]; - Bookmark txtCreateTime = doc.Range.Bookmarks["CreateTime"]; - Bookmark txtProjectName = doc.Range.Bookmarks["txtProjectName"]; - Bookmark txtUnit = doc.Range.Bookmarks["txtUnit"]; - Bookmark txtConstructionSite = doc.Range.Bookmarks["txtConstructionSite"]; - Bookmark txtBiddingProjectScope = doc.Range.Bookmarks["txtBiddingProjectScope"]; - Bookmark txtBiddingProjectContent = doc.Range.Bookmarks["txtBiddingProjectContent"]; - Bookmark txtTimeRequirements = doc.Range.Bookmarks["txtTimeRequirements"]; - Bookmark txtQualityRequirement = doc.Range.Bookmarks["txtQualityRequirement"]; - Bookmark txtHSERequirement = doc.Range.Bookmarks["txtHSERequirement"]; - Bookmark txtTechnicalRequirement = doc.Range.Bookmarks["txtTechnicalRequirement"]; - Bookmark txtCurrentRequirement = doc.Range.Bookmarks["txtCurrentRequirement"]; - Bookmark txtSub_Selection = doc.Range.Bookmarks["txtSub_Selection"]; - Bookmark txtBid_Selection = doc.Range.Bookmarks["txtBid_Selection"]; - Bookmark txtContractingMode_Select = doc.Range.Bookmarks["txtContractingMode_Select"]; - Bookmark txtPriceMode_Select = doc.Range.Bookmarks["txtPriceMode_Select"]; - Bookmark txtMaterialsDifferentiate = doc.Range.Bookmarks["txtMaterialsDifferentiate"]; - Bookmark txtImportExplain = doc.Range.Bookmarks["txtImportExplain"]; - Bookmark txtShortNameList = doc.Range.Bookmarks["txtShortNameList"]; - Bookmark txtEvaluationMethods = doc.Range.Bookmarks["txtEvaluationMethods"]; - Bookmark txtEvaluationPlan = doc.Range.Bookmarks["txtEvaluationPlan"]; - Bookmark txtBiddingMethods_Select = doc.Range.Bookmarks["txtBiddingMethods_Select"]; - Bookmark txtSchedulePlan = doc.Range.Bookmarks["txtSchedulePlan"]; - #region 附件表 - Dictionary Dic_File = new Dictionary(); - for (int i = 1; i < 14; i++) - { - string txtPlanningContent = "txtPlanningContent" + Convert.ToString(i); - string txtRemarks = "txtRemarks" + Convert.ToString(i); - string value_ActionPlan = ""; - string value_Remarks = ""; - var model = list.Find(e => e.SortIndex == Convert.ToString(i)); - if (model != null) - { - value_ActionPlan = model.ActionPlan; - value_Remarks = model.Remarks; - } - string[] key = { txtPlanningContent, txtRemarks }; - object[] value = { value_ActionPlan, value_Remarks }; - doc.MailMerge.Execute(key, value); - - } - - #endregion - if (txtActionPlanCode != null) - { - if (getFireWork != null) - { - txtActionPlanCode.Text = getFireWork.ActionPlanCode; - } - } - if (txtName != null) - { - if (getFireWork != null) - { - txtName.Text = getFireWork.ProjectShortName; - } - - } - if (txtBidProject != null) - { - if (getFireWork != null) - { - - txtBidProject.Text = getFireWork.BidProject; - } - } - if (txtCreateTime != null) - { - if (getFireWork != null) - { - - txtCreateTime.Text = string.Format("{0:D}", getFireWork.CreateTime); - } - } - if (Act != null) - { - if (Act.State == Const.ContractReview_Complete) - { - - AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", Act.Approval_Construction, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", Act.ConstructionManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", Act.DeputyGeneralManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", Act.ProjectManager, ""); - } - } - - - if (txtProjectName != null) - { - if (getFireWork != null) - { - txtProjectName.Text = getFireWork.ProjectName; - } - } - if (txtUnit != null) - { - if (getFireWork != null) - { - txtUnit.Text = getFireWork.Unit; - - } - } - if (txtConstructionSite != null) - { - if (getFireWork != null) - { - txtConstructionSite.Text = getFireWork.ConstructionSite; - - } - } - if (txtBiddingProjectScope != null) - { - if (getFireWork != null) - { - txtBiddingProjectScope.Text = getFireWork.BiddingProjectScope; - - } - } - if (txtBiddingProjectContent != null) - { - if (getFireWork != null) - { - txtBiddingProjectContent.Text = getFireWork.BiddingProjectContent; - - } - } - if (txtTimeRequirements != null) - { - if (getFireWork != null) - { - txtTimeRequirements.Text = getFireWork.TimeRequirements; - - } - - } - if (txtQualityRequirement != null) - { - if (getFireWork != null) - { - txtQualityRequirement.Text = getFireWork.QualityRequirement; - - } - - } - if (txtHSERequirement != null) - { - if (getFireWork != null) - { - txtHSERequirement.Text = getFireWork.HSERequirement; - - } - - } - if (txtTechnicalRequirement != null) - { - if (getFireWork != null) - { - txtTechnicalRequirement.Text = getFireWork.TechnicalRequirement; - - } - - } - if (txtCurrentRequirement != null) - { - if (getFireWork != null) - { - txtCurrentRequirement.Text = getFireWork.CurrentRequirement; - - } - - } - if (txtSub_Selection != null) - { - if (getFireWork != null) - { - txtSub_Selection.Text = getFireWork.Sub_Selection; - - } - - } - if (txtBid_Selection != null) - { - if (getFireWork != null) - { - txtBid_Selection.Text = getFireWork.Bid_Selection; - - } - - } - if (txtContractingMode_Select != null) - { - if (getFireWork != null) - { - txtContractingMode_Select.Text = getFireWork.ContractingMode_Select; - - } - - } - if (txtPriceMode_Select != null) - { - if (getFireWork != null) - { - txtPriceMode_Select.Text = getFireWork.PriceMode_Select; - - } - - } - if (txtMaterialsDifferentiate != null) - { - if (getFireWork != null) - { - txtMaterialsDifferentiate.Text = getFireWork.MaterialsDifferentiate; - - } - - } - if (txtImportExplain != null) - { - if (getFireWork != null) - { - txtImportExplain.Text = getFireWork.ImportExplain; - - } - - } - if (txtShortNameList != null) - { - if (getFireWork != null) - { - txtShortNameList.Text = getFireWork.ShortNameList; - - } - - } - if (txtEvaluationMethods != null) - { - if (getFireWork != null) - { - txtEvaluationMethods.Text = getFireWork.EvaluationMethods; - - } - - } - if (txtEvaluationPlan != null) - { - if (getFireWork != null) - { - txtEvaluationPlan.Text = getFireWork.EvaluationPlan; - - } - - } - if (txtBiddingMethods_Select != null) - { - if (getFireWork != null) - { - txtBiddingMethods_Select.Text = getFireWork.BiddingMethods_Select; - - } - - } - if (txtSchedulePlan != null) - { - if (getFireWork != null) - { - txtSchedulePlan.Text = getFireWork.SchedulePlan; - - } - - } - if (!string.IsNullOrEmpty(getFireWork.AttachUrlContent)) - { - - var Path = newUrl.Replace(".docx", "编辑栏.docx"); //word文件保存路径 - AsposeWordHelper.HtmlIntoWord(getFireWork.AttachUrlContent, Path); - Document doc2 = new Document(Path); - DocumentBuilder builder = new DocumentBuilder(doc2); - //doc2.FirstSection.PageSetup.SectionStart = SectionStart.OddPage; - builder.PageSetup.PaperSize = PaperSize.A4; - doc.AppendDocument(doc2, ImportFormatMode.UseDestinationStyles); - doc.UpdateWordCount(); - File.Delete(Path); - } - - doc.Save(newUrl); - //生成PDF文件 - string pdfUrl = newUrl.Replace(".docx", ".pdf"); - BLL.AsposeWordHelper.WordIntoPdf(newUrl, pdfUrl); - //Document doc1 = new Aspose.Words.Document(newUrl); - ////验证参数 - //if (doc1 == null) { throw new Exception("Word文件无效"); } - //doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 - string fileName = Path.GetFileName(filePath).Replace("施工招标实施计划审批表", getFireWork.ActionPlanCode + "施工分包实施计划"); - FileInfo info = new FileInfo(pdfUrl); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); - File.Delete(newUrl); - File.Delete(pdfUrl); - } - - #endregion } diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanReview.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanReview.aspx.cs index 0ae4eec8..90d9d271 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanReview.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ActionPlanReview.aspx.cs @@ -435,8 +435,10 @@ return; } string ActionPlanID = Act.ActionPlanID; - ActionPlanFormation actionPlanFormation = new ActionPlanFormation(); - actionPlanFormation.Print(ActionPlanID); + //ActionPlanFormation actionPlanFormation = new ActionPlanFormation(); + //actionPlanFormation.Print(ActionPlanID); + BLL.PHTGL_ActionPlanFormationService.PrintFile( ActionPlanID); + } #endregion } diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ApproveUserReview.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ApproveUserReview.aspx.cs index 9eb5466b..fc9bc1ca 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ApproveUserReview.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/ApproveUserReview.aspx.cs @@ -378,91 +378,88 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement } #endregion - - - #region 打印 /// /// ApproveUserReviewById /// /// - public void Print(string Id) - { - string rootPath = Server.MapPath("~/"); - string initTemplatePath = string.Empty; - string uploadfilepath = string.Empty; - string newUrl = string.Empty; - string filePath = string.Empty; - initTemplatePath = "File\\Word\\PHTGL\\施工招标评标小组名单审批表.docx"; - uploadfilepath = rootPath + initTemplatePath; - newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); - filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); - if (File.Exists(newUrl)) - { - File.Delete(newUrl); - } - File.Copy(uploadfilepath, newUrl); - ///更新书签 - var getFireWork = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(Id); - var Bid = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(getFireWork.BidDocumentsReviewId); - var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Bid.ActionPlanID); - #region 评标小组成员名单 - string strSql = @" SELECT Number = row_number() over(order by ID) - ,APP.ApproveUserName as Name - ,APP.ApproveUserSpecial as Special - ,APP.ApproveUserUnit as Unit - ,APP.Remarks as Remarks" - + @" FROM PHTGL_BidApproveUserReview_Sch1 AS APP " - + @"where 1=1 AND ApproveUserReviewID = @ApproveUserReviewID "; - List listStr = new List(); - listStr.Add(new SqlParameter("@ApproveUserReviewID", Id)); + //public void Print(string Id) + //{ + // string rootPath = Server.MapPath("~/"); + // string initTemplatePath = string.Empty; + // string uploadfilepath = string.Empty; + // string newUrl = string.Empty; + // string filePath = string.Empty; + // initTemplatePath = "File\\Word\\PHTGL\\施工招标评标小组名单审批表.docx"; + // uploadfilepath = rootPath + initTemplatePath; + // newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + // filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + // if (File.Exists(newUrl)) + // { + // File.Delete(newUrl); + // } + // File.Copy(uploadfilepath, newUrl); + // ///更新书签 + // var getFireWork = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(Id); + // var Bid = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(getFireWork.BidDocumentsReviewId); + // var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Bid.ActionPlanID); + // #region 评标小组成员名单 + // string strSql = @" SELECT Number = row_number() over(order by ID) + // ,APP.ApproveUserName as Name + // ,APP.ApproveUserSpecial as Special + // ,APP.ApproveUserUnit as Unit + // ,APP.Remarks as Remarks" + // + @" FROM PHTGL_BidApproveUserReview_Sch1 AS APP " + // + @"where 1=1 AND ApproveUserReviewID = @ApproveUserReviewID "; + // List listStr = new List(); + // listStr.Add(new SqlParameter("@ApproveUserReviewID", Id)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - tb.TableName = "Table"; - Document doc = new Aspose.Words.Document(newUrl); - doc.MailMerge.ExecuteWithRegions(tb); - #endregion - Dictionary Dic_File = new Dictionary(); - Dic_File.Add("txtProjectName", Act.ProjectShortName); - Dic_File.Add("txtBidProject", getFireWork.BidProject); - Dic_File.Add("txtBidDocumentCode", Bid.BidDocumentsCode); - foreach (var item in Dic_File) - { - string[] key = { item.Key }; - object[] value = { item.Value }; - doc.MailMerge.Execute(key, value); + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // tb.TableName = "Table"; + // Document doc = new Aspose.Words.Document(newUrl); + // doc.MailMerge.ExecuteWithRegions(tb); + // #endregion + // Dictionary Dic_File = new Dictionary(); + // Dic_File.Add("txtProjectName", Act.ProjectShortName); + // Dic_File.Add("txtBidProject", getFireWork.BidProject); + // Dic_File.Add("txtBidDocumentCode", Bid.BidDocumentsCode); + // foreach (var item in Dic_File) + // { + // string[] key = { item.Key }; + // object[] value = { item.Value }; + // doc.MailMerge.Execute(key, value); - } + // } - if (getFireWork.State == Const.ContractReview_Complete) - { - AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + // if (getFireWork.State == Const.ContractReview_Complete) + // { + // AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); - } - doc.Save(newUrl); - //生成PDF文件 - string pdfUrl = newUrl.Replace(".doc", ".pdf"); - Document doc1 = new Aspose.Words.Document(newUrl); - //验证参数 - if (doc1 == null) { throw new Exception("Word文件无效"); } - doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 - string fileName = Path.GetFileName(filePath); - FileInfo info = new FileInfo(pdfUrl); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); - File.Delete(newUrl); - File.Delete(pdfUrl); - } + // } + // doc.Save(newUrl); + // //生成PDF文件 + // string pdfUrl = newUrl.Replace(".doc", ".pdf"); + // Document doc1 = new Aspose.Words.Document(newUrl); + // //验证参数 + // if (doc1 == null) { throw new Exception("Word文件无效"); } + // doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + // string fileName = Path.GetFileName(filePath); + // FileInfo info = new FileInfo(pdfUrl); + // long fileSize = info.Length; + // System.Web.HttpContext.Current.Response.Clear(); + // System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + // System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + // System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + // System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + // System.Web.HttpContext.Current.Response.Flush(); + // System.Web.HttpContext.Current.Response.Close(); + // File.Delete(newUrl); + // File.Delete(pdfUrl); + //} protected void btnPrinter_Click(object sender, EventArgs e) { @@ -472,7 +469,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement return; } string Id = Grid1.SelectedRowID; - Print(Id); + BLL.PHTGL_BidApproveUserReviewService.PrintFile( Id); } #endregion } diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReview.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReview.aspx.cs index 1dadcfa0..a93a1e4a 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReview.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReview.aspx.cs @@ -416,99 +416,99 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement /// BidDocumentsReviewId ///
/// - public void Print(string Id) - { - string rootPath = Server.MapPath("~/"); - string initTemplatePath = string.Empty; - string uploadfilepath = string.Empty; - string newUrl = string.Empty; - string filePath = string.Empty; - initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表.docx"; - var lwfirwork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); - if (lwfirwork != null) - { - if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectId)) - { - initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表LW.docx"; + //public void Print(string Id) + //{ + // string rootPath = Server.MapPath("~/"); + // string initTemplatePath = string.Empty; + // string uploadfilepath = string.Empty; + // string newUrl = string.Empty; + // string filePath = string.Empty; + // initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表.docx"; + // var lwfirwork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + // if (lwfirwork != null) + // { + // if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectId)) + // { + // initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表LW.docx"; - } - } - uploadfilepath = rootPath + initTemplatePath; - newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); - filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); - if (File.Exists(newUrl)) - { - File.Delete(newUrl); - } - File.Copy(uploadfilepath, newUrl); - Document doc = new Aspose.Words.Document(newUrl); + // } + // } + // uploadfilepath = rootPath + initTemplatePath; + // newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + // filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + // if (File.Exists(newUrl)) + // { + // File.Delete(newUrl); + // } + // File.Copy(uploadfilepath, newUrl); + // Document doc = new Aspose.Words.Document(newUrl); - ///更新书签 - var getFireWork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); - var Act = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(getFireWork.ActionPlanID); - var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); - var model_ControlManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ControlManager); - var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); - var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); + // ///更新书签 + // var getFireWork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + // var Act = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(getFireWork.ActionPlanID); + // var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); + // var model_ControlManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ControlManager); + // var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); + // var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); - Dictionary Dic_File = new Dictionary(); - Dic_File.Add("txtCode", string.Format("{0:yyyyMMdd}", Convert.ToDateTime(getFireWork.CreatTime))); - Dic_File.Add("txtBidDocumentCode", getFireWork.BidDocumentsCode); - Dic_File.Add("txtProjectName", Act.ProjectShortName); - Dic_File.Add("txtProjectCode", Act.ProjectCode); - Dic_File.Add("txtBidContent", getFireWork.BidContent); - Dic_File.Add("txtBidType", getFireWork.BidType); - Dic_File.Add("txtBidDocumentsName", getFireWork.BidDocumentsName); - Dic_File.Add("Bidding_SendTime", string.Format("{0:D}", getFireWork.Bidding_SendTime)); - Dic_File.Add("Bidding_StartTime", string.Format("{0:D}", getFireWork.Bidding_StartTime)); + // Dictionary Dic_File = new Dictionary(); + // Dic_File.Add("txtCode", string.Format("{0:yyyyMMdd}", Convert.ToDateTime(getFireWork.CreatTime))); + // Dic_File.Add("txtBidDocumentCode", getFireWork.BidDocumentsCode); + // Dic_File.Add("txtProjectName", Act.ProjectShortName); + // Dic_File.Add("txtProjectCode", Act.ProjectCode); + // Dic_File.Add("txtBidContent", getFireWork.BidContent); + // Dic_File.Add("txtBidType", getFireWork.BidType); + // Dic_File.Add("txtBidDocumentsName", getFireWork.BidDocumentsName); + // Dic_File.Add("Bidding_SendTime", string.Format("{0:D}", getFireWork.Bidding_SendTime)); + // Dic_File.Add("Bidding_StartTime", string.Format("{0:D}", getFireWork.Bidding_StartTime)); - if (getFireWork.State == Const.ContractReview_Complete) - { - Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); - Dic_File.Add("ControlManagerTime", string.Format("{0:D}", DateTime.Parse(model_ControlManager.ApproveDate))); - Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); - Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); + // if (getFireWork.State == Const.ContractReview_Complete) + // { + // Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); + // Dic_File.Add("ControlManagerTime", string.Format("{0:D}", DateTime.Parse(model_ControlManager.ApproveDate))); + // Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); + // Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); - AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ControlManager", getFireWork.ControlManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); - } - else - { - Dic_File.Add("ConstructionManagerTime", " 年 月 日"); - Dic_File.Add("ControlManagerTime", " 年 月 日"); - Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); - Dic_File.Add("ProjectManagerTime", " 年 月 日"); - } - foreach (var item in Dic_File) - { - string[] key = { item.Key }; - object[] value = { item.Value }; - doc.MailMerge.Execute(key, value); + // AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ControlManager", getFireWork.ControlManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + // } + // else + // { + // Dic_File.Add("ConstructionManagerTime", " 年 月 日"); + // Dic_File.Add("ControlManagerTime", " 年 月 日"); + // Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); + // Dic_File.Add("ProjectManagerTime", " 年 月 日"); + // } + // foreach (var item in Dic_File) + // { + // string[] key = { item.Key }; + // object[] value = { item.Value }; + // doc.MailMerge.Execute(key, value); - } + // } - doc.Save(newUrl); - //生成PDF文件 - string pdfUrl = newUrl.Replace(".doc", ".pdf"); - Document doc1 = new Aspose.Words.Document(newUrl); - //验证参数 - if (doc1 == null) { throw new Exception("Word文件无效"); } - doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 - string fileName = Path.GetFileName(filePath).Replace("招标文件审批表", getFireWork.BidDocumentsCode + "招标文件审批表"); - FileInfo info = new FileInfo(pdfUrl); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); - File.Delete(newUrl); - File.Delete(pdfUrl); - } + // doc.Save(newUrl); + // //生成PDF文件 + // string pdfUrl = newUrl.Replace(".doc", ".pdf"); + // Document doc1 = new Aspose.Words.Document(newUrl); + // //验证参数 + // if (doc1 == null) { throw new Exception("Word文件无效"); } + // doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + // string fileName = Path.GetFileName(filePath).Replace("招标文件审批表", getFireWork.BidDocumentsCode + "招标文件审批表"); + // FileInfo info = new FileInfo(pdfUrl); + // long fileSize = info.Length; + // System.Web.HttpContext.Current.Response.Clear(); + // System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + // System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + // System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + // System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + // System.Web.HttpContext.Current.Response.Flush(); + // System.Web.HttpContext.Current.Response.Close(); + // File.Delete(newUrl); + // File.Delete(pdfUrl); + //} protected void btnPrinter_Click(object sender, EventArgs e) { @@ -518,7 +518,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement return; } string Id = Grid1.SelectedRowID; - Print(Id); + BLL.PHTGL_BidDocumentsReviewService.PrintFile(Id); } #endregion diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReviewEdit.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReviewEdit.aspx.cs index 53e18949..d4225329 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReviewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/BidDocumentsReviewEdit.aspx.cs @@ -214,12 +214,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement private bool Save() { - if (DropDepart.SelectedValue == Const._Null) - { - ShowNotify("请选择部门!", MessageBoxIcon.Warning); - return false; - - } + //if (Approval_Construction.SelectedValue==Const._Null) //{ // ShowNotify("请选择施工管理部审批人员!", MessageBoxIcon.Warning); diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReview.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReview.aspx.cs index d2530fcb..ff167745 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReview.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReview.aspx.cs @@ -475,164 +475,164 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement /// SetSubReviewID /// /// - public void Print(string Id) - { - string rootPath = Server.MapPath("~/"); - string initTemplatePath = string.Empty; - string uploadfilepath = string.Empty; - string newUrl = string.Empty; - string filePath = string.Empty; - string strSql = ""; - var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(Id); - var BidUser = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(getFireWork.ApproveUserReviewID); - var BidDoc = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidUser.BidDocumentsReviewId); - var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(BidDoc.ActionPlanID); + //public void Print(string Id) + //{ + // string rootPath = Server.MapPath("~/"); + // string initTemplatePath = string.Empty; + // string uploadfilepath = string.Empty; + // string newUrl = string.Empty; + // string filePath = string.Empty; + // string strSql = ""; + // var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(Id); + // var BidUser = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(getFireWork.ApproveUserReviewID); + // var BidDoc = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidUser.BidDocumentsReviewId); + // var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(BidDoc.ActionPlanID); - switch (getFireWork.Type) - { - case PHTGL_SetSubReviewService.Type_ConEvaluation: - if (Act != null) - { - if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) - { - initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法)LW.docx"; + // switch (getFireWork.Type) + // { + // case PHTGL_SetSubReviewService.Type_ConEvaluation: + // if (Act != null) + // { + // if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + // { + // initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法)LW.docx"; - } - else - { - initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法).docx"; + // } + // else + // { + // initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于综合评估法).docx"; - } - } - strSql = @" SELECT - Sch2.Company as Company - ,Sch2.Price_ReviewResults as Price_ReviewResults - ,Sch2.Skill_ReviewResults as Skill_ReviewResults - ,Sch2.Business_ReviewResults as Business_ReviewResults - ,Sch2.Synthesize_ReviewResults as Synthesize_ReviewResults - ,Sch2.Remarks as Remarks " - + @" FROM PHTGL_SetSubReview_Sch2 AS Sch2 " - + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; - break; - case PHTGL_SetSubReviewService.Type_MinPrice: - if (Act != null) - { - if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) - { - initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法)LW.docx"; + // } + // } + // strSql = @" SELECT + // Sch2.Company as Company + // ,Sch2.Price_ReviewResults as Price_ReviewResults + // ,Sch2.Skill_ReviewResults as Skill_ReviewResults + // ,Sch2.Business_ReviewResults as Business_ReviewResults + // ,Sch2.Synthesize_ReviewResults as Synthesize_ReviewResults + // ,Sch2.Remarks as Remarks " + // + @" FROM PHTGL_SetSubReview_Sch2 AS Sch2 " + // + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; + // break; + // case PHTGL_SetSubReviewService.Type_MinPrice: + // if (Act != null) + // { + // if (PHTGL_ActionPlanReviewService.IsSpecialProject(Act.ProjectID)) + // { + // initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法)LW.docx"; - } - else - { - initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法).docx"; + // } + // else + // { + // initTemplatePath = "File\\Word\\PHTGL\\确定分包商审批表(用于经评审的最低投标报价法).docx"; - } - } - strSql = @" SELECT - Sch1.Company as Company - ,Sch1.ReviewResults as ReviewResults - ,Sch1.Remarks as Remarks " - + @" FROM PHTGL_SetSubReview_Sch1 AS Sch1 " - + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; - break; - default: /* 可选的 */ - Alert.ShowInTop("请先编制审批类型!", MessageBoxIcon.Warning); - return; - } - uploadfilepath = rootPath + initTemplatePath; - newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); - filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); - if (File.Exists(newUrl)) - { - File.Delete(newUrl); - } - File.Copy(uploadfilepath, newUrl); + // } + // } + // strSql = @" SELECT + // Sch1.Company as Company + // ,Sch1.ReviewResults as ReviewResults + // ,Sch1.Remarks as Remarks " + // + @" FROM PHTGL_SetSubReview_Sch1 AS Sch1 " + // + @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex "; + // break; + // default: /* 可选的 */ + // Alert.ShowInTop("请先编制审批类型!", MessageBoxIcon.Warning); + // return; + // } + // uploadfilepath = rootPath + initTemplatePath; + // newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx"); + // filePath = initTemplatePath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + // if (File.Exists(newUrl)) + // { + // File.Delete(newUrl); + // } + // File.Copy(uploadfilepath, newUrl); - List listStr = new List(); - listStr.Add(new SqlParameter("@SetSubReviewID", Id)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - tb.TableName = "Table"; - Document doc = new Aspose.Words.Document(newUrl); - doc.MailMerge.ExecuteWithRegions(tb); + // List listStr = new List(); + // listStr.Add(new SqlParameter("@SetSubReviewID", Id)); + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // tb.TableName = "Table"; + // Document doc = new Aspose.Words.Document(newUrl); + // doc.MailMerge.ExecuteWithRegions(tb); - var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); - var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); - var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); - var model_DeputyGeneralManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.DeputyGeneralManager); + // var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); + // var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); + // var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); + // var model_DeputyGeneralManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.DeputyGeneralManager); - Dictionary Dic_File = new Dictionary(); - Dic_File.Add("txtSetSubReviewCode", getFireWork.SetSubReviewCode); - Dic_File.Add("txtBidDocumentsCode", BidDoc.BidDocumentsCode); - Dic_File.Add("txtProjectName", Act.ProjectShortName); - Dic_File.Add("txtBidContent", BidDoc.BidContent); - Dic_File.Add("txtBidding_StartTime", string.Format("{0:D}", BidDoc.Bidding_StartTime)); + // Dictionary Dic_File = new Dictionary(); + // Dic_File.Add("txtSetSubReviewCode", getFireWork.SetSubReviewCode); + // Dic_File.Add("txtBidDocumentsCode", BidDoc.BidDocumentsCode); + // Dic_File.Add("txtProjectName", Act.ProjectShortName); + // Dic_File.Add("txtBidContent", BidDoc.BidContent); + // Dic_File.Add("txtBidding_StartTime", string.Format("{0:D}", BidDoc.Bidding_StartTime)); - if (getFireWork.State == Const.ContractReview_Complete) - { + // if (getFireWork.State == Const.ContractReview_Complete) + // { - Dic_File.Add("txtConstructionManagerIdea", model_ConstructionManager.ApproveIdea.Length > 3 ? model_ConstructionManager.ApproveIdea : "同意"); - Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); + // Dic_File.Add("txtConstructionManagerIdea", model_ConstructionManager.ApproveIdea.Length > 3 ? model_ConstructionManager.ApproveIdea : "同意"); + // Dic_File.Add("ConstructionManagerTime", string.Format("{0:D}", DateTime.Parse(model_ConstructionManager.ApproveDate))); - Dic_File.Add("txtApproval_ConstructionIdea", model_Approval_Construction.ApproveIdea.Length > 3 ? model_Approval_Construction.ApproveIdea : "同意"); - Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); + // Dic_File.Add("txtApproval_ConstructionIdea", model_Approval_Construction.ApproveIdea.Length > 3 ? model_Approval_Construction.ApproveIdea : "同意"); + // Dic_File.Add("Approval_ConstructionTime", string.Format("{0:D}", DateTime.Parse(model_Approval_Construction.ApproveDate))); - Dic_File.Add("ProjectManagerIdea", model_ProjectManager.ApproveIdea.Length > 3 ? model_ProjectManager.ApproveIdea : "同意"); - Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); + // Dic_File.Add("ProjectManagerIdea", model_ProjectManager.ApproveIdea.Length > 3 ? model_ProjectManager.ApproveIdea : "同意"); + // Dic_File.Add("ProjectManagerTime", string.Format("{0:D}", DateTime.Parse(model_ProjectManager.ApproveDate))); - Dic_File.Add("txtDeputyGeneralManagerIdea", model_DeputyGeneralManager.ApproveIdea.Length > 3 ? model_DeputyGeneralManager.ApproveIdea : "同意"); - Dic_File.Add("DeputyGeneralManagerTime", string.Format("{0:D}", DateTime.Parse(model_DeputyGeneralManager.ApproveDate))); + // Dic_File.Add("txtDeputyGeneralManagerIdea", model_DeputyGeneralManager.ApproveIdea.Length > 3 ? model_DeputyGeneralManager.ApproveIdea : "同意"); + // Dic_File.Add("DeputyGeneralManagerTime", string.Format("{0:D}", DateTime.Parse(model_DeputyGeneralManager.ApproveDate))); - AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); - AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "Approval_Construction", getFireWork.Approval_Construction, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ConstructionManager", getFireWork.ConstructionManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "DeputyGeneralManager", getFireWork.DeputyGeneralManager, ""); + // AsposeWordHelper.InsertImg(doc, rootPath, "ProjectManager", getFireWork.ProjectManager, ""); - } - else - { - Dic_File.Add("txtConstructionManagerIdea", ""); - Dic_File.Add("ConstructionManagerTime", " 年 月 日"); + // } + // else + // { + // Dic_File.Add("txtConstructionManagerIdea", ""); + // Dic_File.Add("ConstructionManagerTime", " 年 月 日"); - Dic_File.Add("txtApproval_ConstructionIdea", ""); - Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); + // Dic_File.Add("txtApproval_ConstructionIdea", ""); + // Dic_File.Add("Approval_ConstructionTime", " 年 月 日"); - Dic_File.Add("ProjectManagerIdea", ""); - Dic_File.Add("ProjectManagerTime", " 年 月 日"); + // Dic_File.Add("ProjectManagerIdea", ""); + // Dic_File.Add("ProjectManagerTime", " 年 月 日"); - Dic_File.Add("txtDeputyGeneralManagerIdea", ""); - Dic_File.Add("DeputyGeneralManagerTime", " 年 月 日"); + // Dic_File.Add("txtDeputyGeneralManagerIdea", ""); + // Dic_File.Add("DeputyGeneralManagerTime", " 年 月 日"); - } - foreach (var item in Dic_File) - { - string[] key = { item.Key }; - object[] value = { item.Value }; - doc.MailMerge.Execute(key, value); - } + // } + // foreach (var item in Dic_File) + // { + // string[] key = { item.Key }; + // object[] value = { item.Value }; + // doc.MailMerge.Execute(key, value); + // } - doc.Save(newUrl); - //生成PDF文件 - string pdfUrl = newUrl.Replace(".doc", ".pdf"); - Document doc1 = new Aspose.Words.Document(newUrl); - //验证参数 - if (doc1 == null) { throw new Exception("Word文件无效"); } - doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 - string fileName = Path.GetFileName(filePath); - FileInfo info = new FileInfo(pdfUrl); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); - File.Delete(newUrl); - File.Delete(pdfUrl); - } + // doc.Save(newUrl); + // //生成PDF文件 + // string pdfUrl = newUrl.Replace(".doc", ".pdf"); + // Document doc1 = new Aspose.Words.Document(newUrl); + // //验证参数 + // if (doc1 == null) { throw new Exception("Word文件无效"); } + // doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + // string fileName = Path.GetFileName(filePath); + // FileInfo info = new FileInfo(pdfUrl); + // long fileSize = info.Length; + // System.Web.HttpContext.Current.Response.Clear(); + // System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + // System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + // System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + // System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize); + // System.Web.HttpContext.Current.Response.Flush(); + // System.Web.HttpContext.Current.Response.Close(); + // File.Delete(newUrl); + // File.Delete(pdfUrl); + //} protected void btnPrinter_Click(object sender, EventArgs e) { @@ -642,7 +642,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement return; } string Id = Grid1.SelectedRowID; - Print(Id); + BLL.PHTGL_SetSubReviewService.PrintFile(Id); } #endregion diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview.aspx.cs index fd93a069..95f6e8f9 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview.aspx.cs @@ -419,7 +419,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile return; } string Id = Grid1.SelectedRowID; - BLL.PHTGL_ContractReviewService.Print(Id); + BLL.PHTGL_ContractReviewService.PrintFile(Id); } diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview_Countersign.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview_Countersign.aspx.cs index 2a83510d..7373f585 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview_Countersign.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractReview_Countersign.aspx.cs @@ -440,7 +440,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile string Id = Grid1.SelectedRowID; //ContractReview contractReview = new ContractReview(); //contractReview.Print(Id); - BLL.PHTGL_ContractReviewService.Print(Id); + BLL.PHTGL_ContractReviewService.PrintFile(Id); } diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ActionPlanFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/ActionPlanFile.aspx.cs index 9b11712d..1bf18146 100644 --- a/SGGL/FineUIPro.Web/PHTGL/Filing/ActionPlanFile.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ActionPlanFile.aspx.cs @@ -132,9 +132,11 @@ namespace FineUIPro.Web.PHTGL.Filing } if (e.CommandName == "export") { - ActionPlanFormation actionPlanFormation = new ActionPlanFormation(); + //ActionPlanFormation actionPlanFormation = new ActionPlanFormation(); var Act = BLL.PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewById(fileId); - actionPlanFormation.Print(Act.ActionPlanID); + //actionPlanFormation.Print(Act.ActionPlanID); + BLL.PHTGL_ActionPlanFormationService.PrintFile( Act.ActionPlanID); + return; } if (e.CommandName == "download") @@ -209,8 +211,8 @@ namespace FineUIPro.Web.PHTGL.Filing return; } string ActionPlanID = Act.ActionPlanID; - ActionPlanFormation actionPlanFormation = new ActionPlanFormation(); - actionPlanFormation.Print(ActionPlanID); + BLL.PHTGL_ActionPlanFormationService.PrintFile(ActionPlanID); + } #endregion diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ApproveUserFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/ApproveUserFile.aspx.cs index 03db131f..6a82b512 100644 --- a/SGGL/FineUIPro.Web/PHTGL/Filing/ApproveUserFile.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ApproveUserFile.aspx.cs @@ -105,8 +105,10 @@ namespace FineUIPro.Web.PHTGL.Filing } if (e.CommandName == "export") { - ApproveUserReview approveUserReview = new ApproveUserReview(); - approveUserReview.Print(fileId); + BLL.PHTGL_BidApproveUserReviewService.PrintFile( fileId); + + //ApproveUserReview approveUserReview = new ApproveUserReview(); + //approveUserReview.Print(fileId); return; } if (e.CommandName == "download") diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/BidDocumentsFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/BidDocumentsFile.aspx.cs index 0b4d5420..b89edbe8 100644 --- a/SGGL/FineUIPro.Web/PHTGL/Filing/BidDocumentsFile.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/Filing/BidDocumentsFile.aspx.cs @@ -135,8 +135,10 @@ namespace FineUIPro.Web.PHTGL.Filing } if (e.CommandName == "export") { - BidDocumentsReview bidDocumentsReview = new BidDocumentsReview(); - bidDocumentsReview.Print(fileId); + BLL.PHTGL_BidDocumentsReviewService.PrintFile(fileId); + + //BidDocumentsReview bidDocumentsReview = new BidDocumentsReview(); + //bidDocumentsReview.Print(fileId); return; } if (e.CommandName == "download") diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs index 8a4790f9..4a5ff4d8 100644 --- a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs @@ -193,7 +193,7 @@ namespace FineUIPro.Web.PHTGL.Filing return; } string Id = Grid1.SelectedRowID; - BLL.PHTGL_ContractReviewService.Print(Id); + BLL.PHTGL_ContractReviewService.PrintFile(Id); //BLL.Common.FastReport.ResetData(); //Dictionary keyValuePairs = new Dictionary(); diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/SetSubFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/SetSubFile.aspx.cs index 4808a207..eaaf8a48 100644 --- a/SGGL/FineUIPro.Web/PHTGL/Filing/SetSubFile.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/Filing/SetSubFile.aspx.cs @@ -145,8 +145,10 @@ namespace FineUIPro.Web.PHTGL.Filing if (e.CommandName == "export") { - SetSubReview setSubReview = new SetSubReview(); - setSubReview.Print(fileId); + BLL.PHTGL_SetSubReviewService.PrintFile(fileId); + + //SetSubReview setSubReview = new SetSubReview(); + //setSubReview.Print(fileId); return; } if (e.CommandName == "download")