2023-03-03 合同打印修改,在线编辑文档控件增加
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
@@ -226,6 +227,366 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ActionPlanID
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
/// </summary>
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ namespace BLL
|
||||
/// 合同评审、审批表
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
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()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 分包合同协议书
|
||||
@@ -969,8 +1017,6 @@ namespace BLL
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 附件
|
||||
public static Document sch1(string AttachUrlId, int schnumber)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
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;
|
||||
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;
|
||||
if (!string.IsNullOrEmpty(person.SignatureUrl))
|
||||
{
|
||||
newPerson.SignatureUrl = person.SignatureUrl;
|
||||
|
||||
}
|
||||
newPerson.IsForeign = person.IsForeign;
|
||||
newPerson.PersonType = person.PersonType;
|
||||
newPerson.MaritalStatus = person.MaritalStatus;
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditOffice.aspx.cs" Inherits="WordEdit.EditOffice" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta content="IE=10" http-equiv="X-UA-Compatible" />
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||||
<title>首页 - OFFICE文档控件演示示例</title>
|
||||
<link href="officecontrol/ntkoStyle.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script language="javascript" type="text/javascript" src="officecontrol/ntko.js"></script>
|
||||
<script type="text/javascript" >
|
||||
var cmd; //命令类型
|
||||
var datavalue;
|
||||
|
||||
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 CurentTime() {
|
||||
var now = new Date();
|
||||
|
||||
var year = now.getFullYear(); //年
|
||||
var month = now.getMonth() + 1; //月
|
||||
var day = now.getDate(); //日
|
||||
|
||||
var hh = now.getHours(); //时
|
||||
var mm = now.getMinutes(); //分
|
||||
var ss = now.getSeconds(); //分
|
||||
|
||||
var clock = year + "-";
|
||||
|
||||
if (month < 10)
|
||||
clock += "0";
|
||||
|
||||
clock += month + "-";
|
||||
|
||||
if (day < 10)
|
||||
clock += "0";
|
||||
|
||||
clock += day + " ";
|
||||
|
||||
if (hh < 10)
|
||||
clock += "0";
|
||||
|
||||
clock += hh + ":";
|
||||
if (mm < 10) clock += '0';
|
||||
clock += mm + ":";
|
||||
if (ss < 10) clock += '0';
|
||||
clock += ss;
|
||||
return (clock);
|
||||
}
|
||||
|
||||
//在子页面定义的向父页面回传值的方法,方法名可以自定义
|
||||
function ntkoSendDataToParentPage() {
|
||||
var varData = new Array();
|
||||
varData.push(ntko.docsize);
|
||||
varData.push(CurentTime());
|
||||
ntkoBrowser.ntkoSetReturnValueToParentPage("OnData", varData);
|
||||
|
||||
}
|
||||
|
||||
function ntkoDataToChild(data) {
|
||||
ntko.SetBookmarkValue("ntko", data);
|
||||
var ntkoc = ntko.ActiveDocument.bookMarks.count;
|
||||
for (var i = 1; i <= ntkoc; i++) {
|
||||
var ntkoname = ntko.ActiveDocument.bookMarks.item(i).name;
|
||||
if (ntkoname == "ntko") {
|
||||
ntko.ActiveDocument.bookMarks.item(i).select();
|
||||
ntko.ActiveDocument.Application.Selection.Font.Color = 255;
|
||||
ntko.ActiveDocument.Application.Selection.Font.Bold = 9999998;
|
||||
ntko.ActiveDocument.Application.Selection.Font.Size = 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ntkocloseparentpage() {
|
||||
if (cmd == 4) {
|
||||
ntkoSendDataToParentPage();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body onload='init("<%=url %>");'>
|
||||
<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(File, Document)">
|
||||
if (cmd == 5) {
|
||||
ntko.ShowTipMessage("注意", "已经接收到父页面传过来的值,请注意文档中内容的变化");
|
||||
var datext = localStorage.getItem('ntkoSendDataToChildSData');
|
||||
ntkoDataToChild(datext);
|
||||
}
|
||||
</script>
|
||||
<div class="divTop">
|
||||
<div class="divTopInner">
|
||||
<div class="divTopInnerCaption">重庆软航科技有限公司</div>
|
||||
<div class="divTopInnerNtko"><a href="http://www.ntko.com" title="点击访问NTKO官网">官网</a></div>
|
||||
</div>
|
||||
<div>
|
||||
<form id="form1" action="save.aspx" enctype="multipart/form-data" method="post">
|
||||
<div>
|
||||
<!--引用NTKO OFFICE文档控件-->
|
||||
<img alt="保存office文档" src="officecontrol/edit_save_office.gif" onclick="saveFileToUrl();" />
|
||||
<script type="text/javascript" src="officecontrol/ntkoofficecontrol.min.js"></script>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divBody">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WordEdit
|
||||
{
|
||||
|
||||
|
||||
public partial class EditOffice
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IndexOffice.aspx.cs" Inherits="WordEdit.IndexOffice" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta content="IE=10" http-equiv="X-UA-Compatible" />
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||||
<title>首页 - OFFICE文档控件演示示例</title>
|
||||
<link href="officecontrol/ntkoStyle.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
var CLOSEVENT = false;
|
||||
var datatochildcmd = "";
|
||||
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(cmd) {
|
||||
//判断插件是否安装
|
||||
datatochildcmd = cmd;
|
||||
var ntkoed = ntkoBrowser.ExtensionInstalled();
|
||||
var ntkoversion = ntkoBrowser.NtkoExtensionVersion();
|
||||
var ntkotext = '欢迎使用NTKO OFFICE文档控件平台版PLUS(2019)'
|
||||
if (ntkoed) {
|
||||
ntkoBrowser.openWindow("EditOffice.aspx?cmd=" + cmd, false);
|
||||
CLOSEVENT = true;
|
||||
|
||||
|
||||
/* if (cmd == 5) {
|
||||
ntkoBrowser.openWindow("EditOffice.aspx?cmd=" + cmd, false, "", "", "", "", ntkotext, 800, 800, true);
|
||||
} else {
|
||||
ntkoBrowser.openWindow("EditOffice.aspx?cmd=" + cmd, false);
|
||||
if (cmd == 3) {
|
||||
CLOSEVENT = true;
|
||||
} else {
|
||||
CLOSEVENT = false;
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
|
||||
var iTop = ntkoBrowser.NtkoiTop(); //获得窗口的垂直位置;
|
||||
var iLeft = ntkoBrowser.NtkoiLeft(); //获得窗口的水平位置;
|
||||
window.open("exeindex.html", "", "height=200px,width=500px,top=" + iTop + "px,left=" + iLeft +
|
||||
"px,titlebar=no,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//在父页面定义的跨浏览器插件应用程序关闭事件响应方法,且方法名不能自定义,必须是ntkoCloseEvent
|
||||
function ntkoCloseEvent() {
|
||||
if (CLOSEVENT) alert("跨浏览器插件应用程序窗口已关闭!");
|
||||
}
|
||||
|
||||
//在父页面固定OnDataParentText方法名来获取子页面传过来的数据
|
||||
function OnData(argv1, argv2) {
|
||||
alert("请注意示例右侧单元格两个信息的变化。");
|
||||
document.getElementById("spDocSize").innerHTML = argv1 + " byte";
|
||||
document.getElementById("spUpdateTime").innerHTML = argv2;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="cmd=getQueryString('cmd');openhtml(cmd);">
|
||||
<script type="text/javascript" src="officecontrol/ntkobackground.min.js"></script>
|
||||
<div class="divTop">
|
||||
<div class="divTopInner">
|
||||
<div class="divTopInnerCaption">重庆软航科技有限公司</div>
|
||||
<div class="divTopInnerNtko"><a href="http://www.ntko.com" title="点击访问NTKO官网">官网</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WordEdit
|
||||
{
|
||||
|
||||
|
||||
public partial class IndexOffice
|
||||
{
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,116 @@
|
||||
var datatochildcmd = "";
|
||||
var ntko;//控件对象
|
||||
var savecode = "save.aspx";//保存文档程序程序
|
||||
document.write("<script src='ntkoofficecontrol.min.js'></script>")
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
switch (ntko.StatusCode) {
|
||||
case 0:
|
||||
alert("文件保存成功");
|
||||
ntko.ActiveDocument.Saved = true;
|
||||
window.opener.location.reload();
|
||||
var indexa = retHTML.indexOf("ID:");
|
||||
var indexb = retHTML.indexOf("</br>");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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("<html><head><title>返回的数据</title></head><body><center><hr>")
|
||||
newdoc.write(retHTML + "kdkd<hr>");
|
||||
newdoc.write("<input type=button VALUE='关闭窗口' onclick='window.close();'>");
|
||||
newdoc.write('</center></body></html>');
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
"aboutus.docx", //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
/*switch (ntko.StatusCode) {
|
||||
case 0:
|
||||
alert("文件保存成功");
|
||||
ntko.ActiveDocument.Saved = true;
|
||||
window.opener.location.reload();
|
||||
var indexa = retHTML.indexOf("ID:");
|
||||
var indexb = retHTML.indexOf("</br>");
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=doc", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
alert(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("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=1&fileType=doc", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
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("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=2&fileType=" + fileType, //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName, //上传文件的名称,类似<input type=file 的value
|
||||
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
);
|
||||
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("<center><hr>" + retHTML + "<hr><input type=button VALUE='关闭窗口' onclick='window.close();if(window.opener){window.opener.location.reload()};'></center>");
|
||||
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,类似<input type=file id=upLoadFile 中的id
|
||||
"savetype=3&fileType=" + fileType, //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
|
||||
fileName + filedot, //上传文件的名称,类似<input type=file 的value
|
||||
0, //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
|
||||
null, //sheetname,保存excel的哪个表格
|
||||
true, //IsShowUI,是否显示保存界面
|
||||
false, // IsShowMsg,是否显示保存成功信息
|
||||
false, // IsUseSecurity,是否使用安全特性
|
||||
null, // OwnerPass,安全密码.可直接传值
|
||||
false,//IsPermitPrint,是否允许打印
|
||||
true //IsPermitCopy,是否允许拷贝
|
||||
);
|
||||
}
|
||||
else {
|
||||
alert("不能执行保存,没有编辑文档或者没有安装PDF虚拟打印机!");
|
||||
}
|
||||
}
|
||||
|
||||
function testFunction() {
|
||||
alert(IsFileOpened);
|
||||
}
|
||||
function addServerSecSign() {
|
||||
var signUrl = document.all("secSignFileUrl").options[document.all("secSignFileUrl").selectedIndex].value;
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try {
|
||||
alert("正式版本用户请插入EKEY!\r\n\r\n此为电子印章系统演示功能,请购买正式版本!");
|
||||
TANGER_OCX_OBJ.AddSecSignFromURL("ntko", signUrl);
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addLocalSecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecSignFromLocal("ntko", ""); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addEkeySecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecSignFromEkey("ntko"); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addHandSecSign() {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try { TANGER_OCX_OBJ.AddSecHandSign("ntko"); }
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
|
||||
function addServerSign(signUrl) {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddSignFromURL("ntko",//印章的用户名
|
||||
signUrl,//印章所在服务器相对url
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
"ntko",//调用DoCheckSign函数签名印章信息,用来验证印章的字符串
|
||||
3, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
|
||||
function addLocalSign() {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddSignFromLocal("ntko",//印章的用户名
|
||||
"",//缺省文件名
|
||||
true,//是否提示选择
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
"ntko",//调用DoCheckSign函数签名印章信息,用来验证印章的字符串
|
||||
3, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
function addPicFromUrl(picURL) {
|
||||
if (IsFileOpened) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1 || TANGER_OCX_OBJ.doctype == 2) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddPicFromURL(picURL,//图片的url地址可以时相对或者绝对地址
|
||||
false,//是否浮动,此参数设置为false时,top和left无效
|
||||
100,//left 左边距
|
||||
100,//top 上边距 根据Relative的设定选择不同参照对象
|
||||
1, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
else { alert("不能在该类型文档中使用安全签名印章."); }
|
||||
}
|
||||
}
|
||||
function addPicFromLocal() {
|
||||
if (IsFileOpened) {
|
||||
try {
|
||||
TANGER_OCX_OBJ.AddPicFromLocal("",//印章的用户名
|
||||
true,//缺省文件名
|
||||
false,//是否提示选择
|
||||
100,//左边距
|
||||
100,//上边距 根据Relative的设定选择不同参照对象
|
||||
1, //Relative,取值1-4。设置左边距和上边距相对以下对象所在的位置 1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落
|
||||
100,//缩放印章,默认100%
|
||||
1); //0印章位于文字下方,1位于上方
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
|
||||
function TANGER_OCX_AddDocHeader(strHeader) {
|
||||
if (!IsFileOpened) { return; }
|
||||
var i, cNum = 30;
|
||||
var lineStr = "";
|
||||
try {
|
||||
for (i = 0; i < cNum; i++) lineStr += "_"; //生成下划线
|
||||
with (TANGER_OCX_OBJ.ActiveDocument.Application) {
|
||||
Selection.HomeKey(6, 0); // go home
|
||||
Selection.TypeText(strHeader);
|
||||
Selection.TypeParagraph(); //换行
|
||||
Selection.TypeText(lineStr); //插入下划线
|
||||
// Selection.InsertSymbol(95,"",true); //插入下划线
|
||||
Selection.TypeText("★");
|
||||
Selection.TypeText(lineStr); //插入下划线
|
||||
Selection.TypeParagraph();
|
||||
//Selection.MoveUp(5, 2, 1); //上移两行,且按住Shift键,相当于选择两行
|
||||
Selection.HomeKey(6, 1); //选择到文件头部所有文本
|
||||
Selection.ParagraphFormat.Alignment = 1; //居中对齐
|
||||
with (Selection.Font) {
|
||||
NameFarEast = "宋体";
|
||||
Name = "宋体";
|
||||
Size = 12;
|
||||
Bold = false;
|
||||
Italic = false;
|
||||
Underline = 0;
|
||||
UnderlineColor = 0;
|
||||
StrikeThrough = false;
|
||||
DoubleStrikeThrough = false;
|
||||
Outline = false;
|
||||
Emboss = false;
|
||||
Shadow = false;
|
||||
Hidden = false;
|
||||
SmallCaps = false;
|
||||
AllCaps = false;
|
||||
Color = 255;
|
||||
Engrave = false;
|
||||
Superscript = false;
|
||||
Subscript = false;
|
||||
Spacing = 0;
|
||||
Scaling = 100;
|
||||
Position = 0;
|
||||
Kerning = 0;
|
||||
Animation = 0;
|
||||
DisableCharacterSpaceGrid = false;
|
||||
EmphasisMark = 0;
|
||||
}
|
||||
Selection.MoveDown(5, 3, 0); //下移3行
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
alert("错误:" + err.number + ":" + err.description);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
function insertRedHeadFromUrl(headFileURL) {
|
||||
if (TANGER_OCX_OBJ.doctype != 1)//TANGER_OCX_OBJ.doctype=1为word文档
|
||||
{ return; }
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.HomeKey(6, 0);//光标移动到文档开头
|
||||
TANGER_OCX_OBJ.addtemplatefromurl(headFileURL);//在光标位置插入红头文档
|
||||
}
|
||||
function insertRedButtomFromUrl(headFileURL) {
|
||||
if (TANGER_OCX_OBJ.doctype != 1)//TANGER_OCX_OBJ.doctype=1为word文档
|
||||
{ return; }
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.EndKey(6, 0);
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.TypeParagraph();
|
||||
TANGER_OCX_OBJ.addtemplatefromurl(headFileURL);//在光标位置插入红头文档
|
||||
}
|
||||
function openTemplateFileFromUrl(templateUrl) {
|
||||
TANGER_OCX_OBJ.openFromUrl(templateUrl);
|
||||
}
|
||||
function doHandSign() {
|
||||
/*if(TANGER_OCX_OBJ.doctype==1||TANGER_OCX_OBJ.doctype==2)//此处设置只允许在word和excel中盖章.doctype=1是"word"文档,doctype=2是"excel"文档
|
||||
{*/
|
||||
TANGER_OCX_OBJ.DoHandSign2(
|
||||
"ntko",//手写签名用户名称
|
||||
"ntko",//signkey,DoCheckSign(检查印章函数)需要的验证密钥。
|
||||
0,//left
|
||||
0,//top
|
||||
1,//relative,设定签名位置的参照对象.0:表示按照屏幕位置插入,此时,Left,Top属性不起作用。1:光标位置;2:页边距;3:页面距离 4:默认设置栏,段落(为兼容以前版本默认方式)
|
||||
100);
|
||||
//}
|
||||
}
|
||||
function SetReviewMode(boolvalue) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.TrackRevisions = boolvalue;//设置是否保留痕迹
|
||||
}
|
||||
}
|
||||
|
||||
function setShowRevisions(boolevalue) {
|
||||
if (TANGER_OCX_OBJ.doctype == 1) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.ShowRevisions = boolevalue;//设置是否显示痕迹
|
||||
}
|
||||
}
|
||||
//接受或者取消所有修订
|
||||
function TANGER_OCX_AllRevisions(bool) {
|
||||
if (bool) {
|
||||
TANGER_OCX_OBJ.ActiveDocument.AcceptAllRevisions();//接受所有的痕迹修订
|
||||
}
|
||||
else {
|
||||
TANGER_OCX_OBJ.ActiveDocument.Application.WordBasic.RejectAllChangesInDoc();//拒绝所有的痕迹修订
|
||||
}
|
||||
}
|
||||
function setFilePrint(boolvalue) {
|
||||
TANGER_OCX_OBJ.fileprint = boolvalue;//是否允许打印
|
||||
}
|
||||
function setFileNew(boolvalue) {
|
||||
TANGER_OCX_OBJ.FileNew = boolvalue;//是否允许新建
|
||||
}
|
||||
function setFileSaveAs(boolvalue) {
|
||||
TANGER_OCX_OBJ.FileSaveAs = boolvalue;//是否允许另存为
|
||||
}
|
||||
|
||||
function setIsNoCopy(boolvalue) {
|
||||
TANGER_OCX_OBJ.IsNoCopy = boolvalue;//是否禁止粘贴
|
||||
}
|
||||
function DoCheckSign() {
|
||||
if (IsFileOpened) {
|
||||
var ret = TANGER_OCX_OBJ.DoCheckSign
|
||||
(
|
||||
false,/*可选参数 IsSilent 缺省为FAlSE,表示弹出验证对话框,否则,只是返回验证结果到返回值*/
|
||||
"ntko"//使用盖章时的signkey,这里为"ntko"
|
||||
);//返回值,验证结果字符串
|
||||
//alert(ret);
|
||||
}
|
||||
}
|
||||
function setToolBar() {
|
||||
TANGER_OCX_OBJ.ToolBars = !TANGER_OCX_OBJ.ToolBars;
|
||||
}
|
||||
function setMenubar() {
|
||||
TANGER_OCX_OBJ.Menubar = !TANGER_OCX_OBJ.Menubar;
|
||||
}
|
||||
function setInsertMemu() {
|
||||
TANGER_OCX_OBJ.IsShowInsertMenu = !TANGER_OCX_OBJ.IsShowInsertMenu;
|
||||
}
|
||||
function setEditMenu() {
|
||||
TANGER_OCX_OBJ.IsShowEditMenu = !TANGER_OCX_OBJ.IsShowEditMenu;
|
||||
}
|
||||
function setToolMenu() {
|
||||
TANGER_OCX_OBJ.IsShowToolMenu = !TANGER_OCX_OBJ.IsShowToolMenu;
|
||||
}
|
||||
|
||||
//增加自定义菜单
|
||||
function initCustomMenus1() {
|
||||
var myobj = TANGER_OCX_OBJ;
|
||||
for (var menuPos = 0; menuPos < 1; menuPos++) {
|
||||
myobj.AddCustomMenu2(menuPos, "常用功能" + "(&" + menuPos + ")");
|
||||
for (var submenuPos = 0; submenuPos < 1; submenuPos++) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, -1, true, "打印设置", false);
|
||||
//增加子菜单项目
|
||||
for (var subsubmenuPos = 0; subsubmenuPos < 3; subsubmenuPos++) {
|
||||
if (0 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"设置打印区域", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (1 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"取消打印区域", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (2 == subsubmenuPos) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"手写批注", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//控件控制
|
||||
function controlStyle() {
|
||||
var myobj = TANGER_OCX_OBJ;
|
||||
for (var menuPos = 0; menuPos < 1; menuPos++) {
|
||||
myobj.AddCustomMenu2(menuPos, "控件样式" + "(&" + menuPos + ")");
|
||||
for (var submenuPos = 0; submenuPos < 1; submenuPos++) {
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, -1, true, "改变大小", false);
|
||||
//增加子菜单项目
|
||||
for (var subsubmenuPos = 0; subsubmenuPos < 2; subsubmenuPos++) {
|
||||
if (0 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"全网页查看", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
if (1 == subsubmenuPos)//增加子菜单项目
|
||||
{
|
||||
myobj.AddCustomMenuItem2(menuPos, submenuPos, subsubmenuPos, false,
|
||||
"恢复原大小", false, menuPos * 100 + submenuPos * 20 + subsubmenuPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//改变控件大小为当前网页可见区域
|
||||
function objside() {
|
||||
document.all.officecontrol.style.position = "absolute";
|
||||
document.all.officecontrol.style.left = "0px";
|
||||
document.all.officecontrol.style.top = "0px";
|
||||
document.all.officecontrol.style.width = document.body.clientWidth;//网页可见区域宽
|
||||
document.all.officecontrol.style.height = document.body.clientHeight;//网页可见区域高
|
||||
}
|
||||
//恢复控件显示大小
|
||||
function objside2() {
|
||||
document.all.officecontrol.style.position = "relative";
|
||||
document.all.officecontrol.style.left = "0px";
|
||||
document.all.officecontrol.style.top = "0px";
|
||||
document.all.officecontrol.style.width = "100%";
|
||||
document.all.officecontrol.style.height = "980px";
|
||||
}
|
||||
//显示或隐藏文档控件对象
|
||||
function ObjectDisplay(boolvalue) {
|
||||
var obj = document.getElementById("objside");
|
||||
if (!boolvalue) {
|
||||
obj.style.display = "none";
|
||||
}
|
||||
else {
|
||||
obj.style.display = "block";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
body{
|
||||
text-align:center;
|
||||
font-family:"微软雅黑";
|
||||
letter-spacing:0.05em;
|
||||
color:#575757;
|
||||
font-size:16px;
|
||||
margin:0px;
|
||||
}
|
||||
a{
|
||||
text-decoration:none;
|
||||
cursor:pointer;
|
||||
color:#299ceb;
|
||||
}
|
||||
a:hover{
|
||||
text-decoration:underline;
|
||||
color:#c60000;
|
||||
}
|
||||
hr{
|
||||
border:0px;
|
||||
border-bottom:1px #b0b0b0 solid;
|
||||
margin:50px 0px 30px 0px;
|
||||
}
|
||||
p{
|
||||
text-align:left;
|
||||
line-height:1.6;
|
||||
text-indent:2em;
|
||||
}
|
||||
|
||||
.divTop{
|
||||
width:100%;
|
||||
height:70px;
|
||||
text-align:center;
|
||||
background-color:#000000;
|
||||
top:0;
|
||||
}
|
||||
.divTopInner{
|
||||
width:1200px;
|
||||
text-align:left;
|
||||
color:#ffffff;
|
||||
line-height:70px;
|
||||
margin:auto;
|
||||
}
|
||||
.divTopInnerCaption{
|
||||
width:1150px;
|
||||
font-size:20px;
|
||||
float:left;
|
||||
}
|
||||
.divTopInnerNtko{
|
||||
width:50px;
|
||||
font-size:14px;
|
||||
text-align:center;
|
||||
float:left;
|
||||
cursor:pointer;
|
||||
}
|
||||
.divTopInnerNtko:hover{
|
||||
background-color:#c60000;
|
||||
}
|
||||
.divTopInner a{
|
||||
color:#ffffff;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.divTitle{
|
||||
width:100%;
|
||||
height:80px;
|
||||
line-height:80px;
|
||||
border-bottom:1px #bababa solid;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.divTitle_body{
|
||||
width:1200px;
|
||||
text-align:left;
|
||||
margin:auto;
|
||||
}
|
||||
.divTitle_caption{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#c60000;
|
||||
font-size:36px;
|
||||
font-weight:bold;
|
||||
|
||||
}
|
||||
.divTitle_caption_small{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#c60000;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
height:50px;
|
||||
line-height:50px;
|
||||
}
|
||||
.divTitle_Information{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
height:auto;
|
||||
line-height:24px;
|
||||
margin:20px 0px 30px 0px;
|
||||
}
|
||||
.divTitle_Information_Left{
|
||||
width:40px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
background-color:#ffde00;
|
||||
float:left;
|
||||
text-align:center;
|
||||
font-size:20px;
|
||||
font-weight:bolder;
|
||||
color:#ffffff;
|
||||
margin:auto 20px auto auto;
|
||||
}
|
||||
.divTitle_Information_Right{
|
||||
width:1140px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
float:left;
|
||||
font-size:16px;
|
||||
}
|
||||
.divTitle_introduction{
|
||||
width:100%;
|
||||
float:left;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
height:auto;
|
||||
line-height:24px;
|
||||
}
|
||||
|
||||
.divBody{
|
||||
width:1200px;
|
||||
margin:10px auto;
|
||||
text-align:left;
|
||||
}
|
||||
.divBody_Title{
|
||||
width:100%;
|
||||
height:40px;
|
||||
font-size:16px;
|
||||
margin:40px 0px 0px 0px;
|
||||
}
|
||||
.divBody_Title_Flag{
|
||||
width:5px;
|
||||
height:40px;
|
||||
font-size:16px;
|
||||
float:left;
|
||||
background-color:#a10000;
|
||||
margin:0px 20px 10px 0px;
|
||||
}
|
||||
.divBody_Table_Caption{
|
||||
width:1175px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
font-size:24px;
|
||||
font-weight:bolder;
|
||||
color:#999999;
|
||||
float:left;
|
||||
}
|
||||
table{
|
||||
border-collapse:collapse;
|
||||
width:100%;
|
||||
}
|
||||
td{
|
||||
border:1px #e0e0e0 solid;
|
||||
height:60px;
|
||||
text-align:center;
|
||||
color:#999999;
|
||||
font-size:14px;
|
||||
padding:20px;
|
||||
}
|
||||
.divBody_Table_RowTitle{
|
||||
font-size:18px;
|
||||
font-weight:bolder;
|
||||
color:#ffffff;
|
||||
background-color:#e0e0e0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,690 @@
|
||||
/**
|
||||
* version: 3.6.3
|
||||
*
|
||||
* 2022.04.11版本 跟随 上海市教育考试院20221130 产品发送
|
||||
*/
|
||||
"use strict";
|
||||
var varNtkoGUID = Math.random().toString(36);
|
||||
var ntkoWinOpen;
|
||||
var ntkoJsonIe;
|
||||
var timer;
|
||||
var ntkoSendDataToChildStrUrl;
|
||||
var ntkoSendDataToChildSData;
|
||||
var ntkowin;
|
||||
var ntkoextensionmainifest;
|
||||
var strURL1;
|
||||
var userAgent = navigator.userAgent,
|
||||
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
|
||||
rFirefox = /(firefox)\/([\w.]+)/,
|
||||
rOpera = /(opera).+versi1on\/([\w.]+)/,
|
||||
rChrome = /(chrome)\/([\w.]+)/,
|
||||
rEdge = /(edg)\/([\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) {
|
||||
var matchedge= rEdge.exec(ua);
|
||||
if(matchedge!=null){
|
||||
return { browser : matchedge[1] || "", version : matchedge[2] || "0" };
|
||||
}else{
|
||||
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;
|
||||
}
|
||||
var mimeTypes = navigator.mimeTypes;
|
||||
var bChromeExtensionInstalled = false;
|
||||
version=parseInt(version);
|
||||
if( "chrome" === browserMatch.browser && version>=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;
|
||||
}
|
||||
@@ -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('<!-- 用来产生编辑状态的ActiveX控件的JS脚本--> ');
|
||||
document.write('<!-- 因为微软的ActiveX新机制,需要一个外部引入的js--> ');
|
||||
document.write('<object id="TANGER_OCX" classid="clsid:'+classid+'"');
|
||||
document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'"> ');
|
||||
document.write('<param name="MakerCaption" value="'+MakerCaption+'"> ');
|
||||
document.write('<param name="MakerKey" value="'+MakerKey+'"> ');
|
||||
document.write('<param name="ProductCaption" value="'+ProductCaption+'"> ');
|
||||
document.write('<param name="ProductKey" value="'+ProductKey+'"> ');
|
||||
document.write('<param name="NoExpireKey" value="'+NoExpireKey+'"> ');
|
||||
document.write('<param name="IsUseUTF8URL" value="-1"> ');
|
||||
document.write('<param name="IsUseUTF8Data" value="-1"> ');
|
||||
document.write('<param name="Caption" value="NTKO OFFICE文档控件示例演示 http://www.ntko.com"> ');
|
||||
document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。</SPAN> ');
|
||||
document.write('</object>');
|
||||
}
|
||||
if(window.navigator.platform=="Win64"){
|
||||
|
||||
document.write('<!-- 用来产生编辑状态的ActiveX控件的JS脚本--> ');
|
||||
document.write('<!-- 因为微软的ActiveX新机制,需要一个外部引入的js--> ');
|
||||
document.write('<object id="TANGER_OCX" classid="clsid:'+classidx64+'"');
|
||||
document.write('codebase="'+codebase64+'" width="'+width+'" height="'+height+'"> ');
|
||||
document.write('<param name="MakerCaption" value="'+MakerCaption+'"> ');
|
||||
document.write('<param name="MakerKey" value="'+MakerKey+'"> ');
|
||||
document.write('<param name="ProductCaption" value="'+ProductCaption+'"> ');
|
||||
document.write('<param name="ProductKey" value="'+ProductKey+'"> ');
|
||||
document.write('<param name="NoExpireKey" value="'+NoExpireKey+'"> ');
|
||||
document.write('<param name="IsUseUTF8URL" value="-1"> ');
|
||||
document.write('<param name="IsUseUTF8Data" value="-1"> ');
|
||||
document.write('<param name="Caption" value="NTKO OFFICE文档控件示例演示 http://www.ntko.com"> ');
|
||||
document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。</SPAN> ');
|
||||
document.write('</object>');
|
||||
}
|
||||
}
|
||||
else if (browser=="firefox"){
|
||||
document.write('<object id="TANGER_OCX" type="application/ntko-plug" codebase="'+codebase+'" width="'+width+'" height="'+height+'" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"');
|
||||
document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
|
||||
document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
|
||||
document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
|
||||
document.write('_MakerCaption="'+MakerCaption+'" ');
|
||||
document.write('_MakerKey="'+MakerKey+'" ');
|
||||
document.write('_ProductCaption="'+ProductCaption+'" ');
|
||||
document.write('_ProductKey="'+ProductKey+'" ');
|
||||
document.write('_NoExpireKey="'+NoExpireKey+'" ');
|
||||
document.write('clsid="{'+classid+'}" >');
|
||||
document.write('<SPAN STYLE="color:red">尚未安装NTKO Web FireFox跨浏览器插件</SPAN> ');
|
||||
document.write('</object> ');
|
||||
}else if(browser=="chrome"){
|
||||
document.write('<object id="TANGER_OCX" clsid="{'+classid+'}" ForOnSaveToURL="ntkosavetourl" ForOndocumentopened="ntkoondocumentopened"');
|
||||
document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
|
||||
document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
|
||||
document.write('ForOnCustomButtonOnMenuCmd="OnCustomButtonOnMenuCmd"');
|
||||
document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
|
||||
document.write('_IsUseUTF8URL="-1" ');
|
||||
document.write('_IsUseUTF8Data="-1" ');
|
||||
document.write('_MakerCaption="'+MakerCaption+'" ');
|
||||
document.write('_MakerKey="'+MakerKey+'" ');
|
||||
document.write('_ProductCaption="'+ProductCaption+'" ');
|
||||
document.write('_NoExpireKey="'+NoExpireKey+'" ');
|
||||
document.write('_ProductKey="'+ProductKey+'" ');
|
||||
document.write('codebase="'+codebase+'" width="'+width+'" height="'+height+'" type="application/ntko-plug" >');
|
||||
document.write('<SPAN STYLE="color:red">尚未安装NTKO Web Chrome跨浏览器插件</SPAN> ');
|
||||
document.write('</object>');
|
||||
}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);
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -195,6 +195,17 @@
|
||||
<Content Include="AttachFile\lib\popcorn.player.js" />
|
||||
<Content Include="AttachFile\lib\popcorn.subtitle.js" />
|
||||
<Content Include="AttachFile\Look.aspx" />
|
||||
<Content Include="AttachFile\officecontrol\edit_save_office.gif" />
|
||||
<Content Include="AttachFile\officecontrol\index.js" />
|
||||
<Content Include="AttachFile\officecontrol\ntko.js" />
|
||||
<Content Include="AttachFile\officecontrol\ntkobackground.min.js" />
|
||||
<Content Include="AttachFile\officecontrol\ntkoofficecontrol.min.js" />
|
||||
<Content Include="AttachFile\officecontrol\ntkooledocall.cab" />
|
||||
<Content Include="AttachFile\officecontrol\ntkooledocallx64.cab" />
|
||||
<Content Include="AttachFile\officecontrol\ntkoStyle.css" />
|
||||
<Content Include="AttachFile\officecontrol\NTKO控件安装程序-评测专用演示版本.exe" />
|
||||
<Content Include="AttachFile\officecontrol\OfficeControl.cab" />
|
||||
<Content Include="AttachFile\officecontrol\OfficeControlx64.cab" />
|
||||
<Content Include="AttachFile\player.aspx" />
|
||||
<Content Include="AttachFile\res\webuploader\Uploader.swf" />
|
||||
<Content Include="AttachFile\res\webuploader\webuploader.nolog.js" />
|
||||
@@ -288,8 +299,10 @@
|
||||
<Content Include="common\Menu_TestRun.xml" />
|
||||
<Content Include="common\Menu_ZHGL.xml" />
|
||||
<Content Include="common\themes.aspx" />
|
||||
<Content Include="AttachFile\EditOffice.aspx" />
|
||||
<Content Include="Controls\Fastreport.aspx" />
|
||||
<Content Include="Controls\FlowOperateControl.ascx" />
|
||||
<Content Include="AttachFile\IndexOffice.aspx" />
|
||||
<Content Include="Controls\QRCodePrint.aspx" />
|
||||
<Content Include="Controls\SeeQRImage.aspx" />
|
||||
<Content Include="Controls\ShowQRImage.aspx" />
|
||||
@@ -1444,6 +1457,7 @@
|
||||
<Content Include="ZHGL\RealName\OnPost.aspx" />
|
||||
<Content Include="ZHGL\RealName\SynchroRecord.aspx" />
|
||||
<Content Include="ZHGL\RealName\SynchroSet.aspx" />
|
||||
<Content Include="AttachFile\officecontrol\2222.docx" />
|
||||
<None Include="Doc\help1.doc" />
|
||||
<None Include="Doc\危险源因素辨识及评价方法说明.doc" />
|
||||
<None Include="Doc\危险源清单导入说明.doc" />
|
||||
@@ -6075,6 +6089,13 @@
|
||||
<Compile Include="common\themes.aspx.designer.cs">
|
||||
<DependentUpon>themes.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AttachFile\EditOffice.aspx.cs">
|
||||
<DependentUpon>EditOffice.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AttachFile\EditOffice.aspx.designer.cs">
|
||||
<DependentUpon>EditOffice.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\Fastreport.aspx.cs">
|
||||
<DependentUpon>Fastreport.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -6089,6 +6110,13 @@
|
||||
<Compile Include="Controls\FlowOperateControl.ascx.designer.cs">
|
||||
<DependentUpon>FlowOperateControl.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AttachFile\IndexOffice.aspx.cs">
|
||||
<DependentUpon>IndexOffice.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AttachFile\IndexOffice.aspx.designer.cs">
|
||||
<DependentUpon>IndexOffice.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\QRCodePrint.aspx.cs">
|
||||
<DependentUpon>QRCodePrint.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -397,354 +397,8 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
|
||||
Print(Id);
|
||||
BLL.PHTGL_ActionPlanFormationService.PrintFile( Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ActionPlanID
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -378,91 +378,88 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 打印
|
||||
/// <summary>
|
||||
/// ApproveUserReviewById
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// 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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -416,99 +416,99 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement
|
||||
/// BidDocumentsReviewId
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
// 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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -475,164 +475,164 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement
|
||||
/// SetSubReviewID
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// 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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
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<string, object> Dic_File = new Dictionary<string, object>();
|
||||
// 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
|
||||
|
||||
@@ -419,7 +419,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
BLL.PHTGL_ContractReviewService.Print(Id);
|
||||
BLL.PHTGL_ContractReviewService.PrintFile(Id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user