20230307 质量在线文档编辑修改

This commit is contained in:
2023-03-07 11:24:59 +08:00
parent f42d330b00
commit 1bbab53e2f
22 changed files with 532 additions and 104 deletions
@@ -0,0 +1,2 @@
alter table Plan_MainPlan add FilePath varchar(200)
alter table Plan_SubPlan add FilePath varchar(200)
@@ -30,6 +30,7 @@ namespace BLL
newMainPlan.State = MainPlan.State; newMainPlan.State = MainPlan.State;
newMainPlan.CompileMan = MainPlan.CompileMan; newMainPlan.CompileMan = MainPlan.CompileMan;
newMainPlan.CompileDate = MainPlan.CompileDate; newMainPlan.CompileDate = MainPlan.CompileDate;
newMainPlan.FilePath = MainPlan.FilePath;
db.Plan_MainPlan.InsertOnSubmit(newMainPlan); db.Plan_MainPlan.InsertOnSubmit(newMainPlan);
db.SubmitChanges(); db.SubmitChanges();
} }
@@ -47,6 +48,7 @@ namespace BLL
newMainPlan.PlanCode = MainPlan.PlanCode; newMainPlan.PlanCode = MainPlan.PlanCode;
newMainPlan.FileName = MainPlan.FileName; newMainPlan.FileName = MainPlan.FileName;
newMainPlan.State = MainPlan.State; newMainPlan.State = MainPlan.State;
newMainPlan.FilePath = MainPlan.FilePath;
db.SubmitChanges(); db.SubmitChanges();
} }
} }
@@ -60,6 +60,7 @@ namespace BLL
newSubPlan.CompileDate = SubPlan.CompileDate; newSubPlan.CompileDate = SubPlan.CompileDate;
newSubPlan.State = SubPlan.State; newSubPlan.State = SubPlan.State;
newSubPlan.Edition = SubPlan.Edition; newSubPlan.Edition = SubPlan.Edition;
newSubPlan.FilePath=SubPlan.FilePath;
db.Plan_SubPlan.InsertOnSubmit(newSubPlan); db.Plan_SubPlan.InsertOnSubmit(newSubPlan);
db.SubmitChanges(); db.SubmitChanges();
} }
@@ -78,6 +79,7 @@ namespace BLL
newSubPlan.CNProfessionalCodes = SubPlan.CNProfessionalCodes; newSubPlan.CNProfessionalCodes = SubPlan.CNProfessionalCodes;
newSubPlan.State = SubPlan.State; newSubPlan.State = SubPlan.State;
newSubPlan.Edition = SubPlan.Edition; newSubPlan.Edition = SubPlan.Edition;
newSubPlan.FilePath = SubPlan.FilePath;
db.SubmitChanges(); db.SubmitChanges();
} }
+4
View File
@@ -4093,6 +4093,10 @@
/// 质量共检通知单的虚拟路径 /// 质量共检通知单的虚拟路径
/// </summary> /// </summary>
public const string SpotCheckTemplateUrl = "File\\Word\\CQMS\\Check\\质量共检通知单.doc"; public const string SpotCheckTemplateUrl = "File\\Word\\CQMS\\Check\\质量共检通知单.doc";
/// <summary>
/// 项目施工质量计划模板
/// </summary>
public const string CQMSPlanTemplateUrl = "File\\Word\\CQMS\\Solution\\项目施工质量计划模板.doc";
#endregion #endregion
#endregion #endregion
@@ -1,4 +1,5 @@
using FineUIPro; using BLL;
using FineUIPro;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -19,7 +20,21 @@ namespace WordEdit
if (!IsPostBack) if (!IsPostBack)
{ {
url = "http://localhost:8899/File/Word/集团公司安全监督检查管理办法.doc"; string cmd= Request.QueryString["cmd"];
var a = cmd.Split('|');
if (a[1] == "CQMSMainPlan")
{
var model = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(a[0]);
string filepath = model.FilePath;
url = Funs.SGGLUrl + filepath;
}
else if (a[1]== "CQMSSubPlan")
{
var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(a[0]);
string filepath = model.FilePath;
url = Funs.SGGLUrl + filepath;
}
} }
@@ -20,6 +20,11 @@
return null; return null;
} }
function custom_close() {
window.opener = null;
window.open('', '_self');
window.close();(strHello);
}
function openhtml(cmd) { function openhtml(cmd) {
//判断插件是否安装 //判断插件是否安装
datatochildcmd = cmd; datatochildcmd = cmd;
@@ -54,7 +59,7 @@
//在父页面定义的跨浏览器插件应用程序关闭事件响应方法,且方法名不能自定义,必须是ntkoCloseEvent //在父页面定义的跨浏览器插件应用程序关闭事件响应方法,且方法名不能自定义,必须是ntkoCloseEvent
function ntkoCloseEvent() { function ntkoCloseEvent() {
if (CLOSEVENT) alert("跨浏览器插件应用程序窗口已关闭!"); if (CLOSEVENT) { custom_close(); }
} }
//在父页面固定OnDataParentText方法名来获取子页面传过来的数据 //在父页面固定OnDataParentText方法名来获取子页面传过来的数据
@@ -0,0 +1,51 @@
<html>
<head>
<meta content="IE=10" http-equiv="X-UA-Compatible" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>跨浏览器插件检测</title>
<style>
.info
{
margin:30px auto auto auto; width:300px; font-family:'微软雅黑'; height:30px; text-align:center;
}
.info_img
{
float:left; width:30px; height:30px; background-color:#ff0000; color:#ffffff; line-height:30px; font-weight:bold; font-size:18px
}
.info_text
{
float:left; width:270px; height:30px; line-height:30px; font-size:18px
}
.butbar
{
margin:30px auto auto auto; width:300px; font-family:'微软雅黑'; height:60px; text-align:center;
}
.but
{
width:200px; height:60px; border:1px #e0e0e0 solid; line-height:60px; font-size:18px; margin-left:50px; cursor:pointer; color:#b0b0b0;
}
.but:hover
{
border:1px #bebebe solid; background-color:#f8f8f8;
}
</style>
</head>
<body>
<div class="info">
<div class="info_img">
!
</div>
<div class="info_text">
本机尚未安装跨浏览器插件。
</div>
</div>
<div class="butbar">
<div class="but" onclick="location.href='officecontrol/NTKO控件安装程序-评测专用演示版本.exe'">
点击下载安装插件
</div>
</div>
</body>
</html>
@@ -1,5 +1,6 @@
var ntko;//控件对象 var ntko;//控件对象
var savecode = "save.aspx";//保存文档程序程序 var savecode = "save.aspx";//保存文档程序程序
var fileName = "";
window.onbeforeunload=function(e){ window.onbeforeunload=function(e){
ntkocloseparentpage(); ntkocloseparentpage();
} }
@@ -16,8 +17,8 @@ function init(cmd) {
ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocallx64.cab",51,true); ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocallx64.cab",51,true);
} }
if (cmd != "") { if (cmd != "") {
alert(cmd);
ntko.OpenFromURL(cmd); ntko.OpenFromURL(cmd);
fileName = cmd;
} }
/*if (cmd == 1) /*if (cmd == 1)
{ {
@@ -164,7 +165,7 @@ function erropen(retHTML) {
} }
//保存office文档 //保存office文档
function saveFileToUrl() { function saveFileToUrl() {
var fileName ="ntkocreatnew.docx"
/* /*
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域 if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
var result, filedot; var result, filedot;
@@ -202,10 +203,11 @@ function saveFileToUrl() {
fileType = "unkownfiletype"; fileType = "unkownfiletype";
filedot = ".doc"; filedot = ".doc";
}*/ }*/
retHTML = ntko.saveToURL("save.aspx",//提交到的url地址 retHTML = ntko.saveToURL("save.aspx",//提交到的url地址
"EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id "EDITFILE",//文件域的id,类似<input type=file id=upLoadFile 中的id
"savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型 "savetype=1&fileType=Word.Document", //与控件一起提交的参数,savetype参数为要保存的文件格式office,html,pdf。filetype参数保存文件类型
"aboutus.docx", //上传文件的名称,类似<input type=file 的value fileName, //上传文件的名称,类似<input type=file 的value
0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0. 0 //与控件一起提交的表单id,也可以是form的序列号,这里应该是0.
); );
/*switch (ntko.StatusCode) { /*switch (ntko.StatusCode) {
+1
View File
@@ -0,0 +1 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="save.aspx.cs" Inherits="WordEdit.save" %>
@@ -0,0 +1,82 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WordEdit
{
public partial class save : System.Web.UI.Page
{
//参数savetype定义要另存的文档格式office,html,pdf
//参数filetype定义要保存的文档的文件内型
public string savetype, filetype, fid, title, fother, fname, fname1;
//定义文件上传路径目录
public string filepath, htmlpath, pdfpath, attachpath, delcount;
protected void Page_Load(object sender, EventArgs e)
{
//Response.Write("ok");
//Response.End();
fid = Request.Form["fileid"];//获取文件ID
fname = Request.Form["filename"];//获取已有文件的名称
title = Request.Form["filetitle"];//获取文件的标题
savetype = Request.Form["savetype"];//获取文件另存为格式类型
filetype = Request.Form["filetype"];//获取当前文件的文件格式
fother = Request.Form["fileother"];
//filepath = db.getofficepath();
//htmlpath = db.gethtmlpath();
//pdfpath = db.getpdfpath();
//attachpath = db.getattachpath();
filepath = "D:\\我的代码\\在线文档编辑\\WordEdit\\WordEdit";
htmlpath = "";
pdfpath = "";
attachpath = "";
//根据保存类型调用相应处理方法
switch (savetype)
{
case "1":
saveoffice();
break;
default:
saveoffice();
break;
}
}
//保存文档为office
public void saveoffice()
{
string uploadoffiepath = Server.MapPath("~/");//上传文件的路径
// string uploadoffiepath = filepath;//上传文件的路径
string attpath = Server.MapPath(attachpath);//上传附件文件路径
System.Web.HttpFileCollection uploadFiles = Request.Files;
System.Web.HttpPostedFile theFile;
theFile = uploadFiles[0];
if (uploadFiles.GetKey(0).ToUpper() == "EDITFILE")//上传文档控件中的文档
{
/* string time = System.DateTime.Now.ToString();
if (fname == "" || fname == null)
{
fname = time + "." + theFile.FileName.Substring(theFile.FileName.LastIndexOf('\\') + 1);
}
fname = fname.Replace(":", ".");//上传文件到磁盘,文件名中不允许带:符号*/
// theFile.SaveAs(uploadoffiepath + @"\" + fname);
var path = theFile.FileName.Replace(Funs.SGGLUrl, "");
theFile.SaveAs(uploadoffiepath + path);
}
}
}
}
+17
View File
@@ -0,0 +1,17 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace WordEdit
{
public partial class save
{
}
}
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -240,6 +241,11 @@ namespace FineUIPro.Web.CQMS.Plan
} }
string id = Grid1.SelectedRowID; string id = Grid1.SelectedRowID;
var ins = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(id); var ins = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(id);
if (File.Exists(Funs.RootPath+ins.FilePath))
{
File.Delete(Funs.RootPath + ins.FilePath);
}
////删除附件表 ////删除附件表
BLL.CommonService.DeleteAttachFileById(id); BLL.CommonService.DeleteAttachFileById(id);
BLL.CQMS_MaterialTestService.DeleteMaterialTestById(id); BLL.CQMS_MaterialTestService.DeleteMaterialTestById(id);
@@ -20,7 +20,7 @@
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" <f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right"> BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows> <Rows>
@@ -57,6 +57,9 @@
<f:Button ID="imgBtnFile" Text="文件" ToolTip="上传及查看" Icon="TableCell" runat="server" <f:Button ID="imgBtnFile" Text="文件" ToolTip="上传及查看" Icon="TableCell" runat="server"
OnClick="imgBtnFile_Click"> OnClick="imgBtnFile_Click">
</f:Button> </f:Button>
<f:Button ID="btnEditWord" Icon="PageWhiteWord" OnClick="btnEditWord_Click" runat="server" Text="编辑文档" ToolTip="编辑文档" >
</f:Button>
</Items> </Items>
</f:Panel> </f:Panel>
</Items> </Items>
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using AspNet = System.Web.UI.WebControls; using AspNet = System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.CQMS.Plan namespace FineUIPro.Web.CQMS.Plan
{ {
@@ -46,6 +47,7 @@ namespace FineUIPro.Web.CQMS.Plan
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
MainPlanId = Request.Params["MainPlanId"]; MainPlanId = Request.Params["MainPlanId"];
this.drpHandleType.DataTextField = "Text"; this.drpHandleType.DataTextField = "Text";
this.drpHandleType.DataValueField = "Value"; this.drpHandleType.DataValueField = "Value";
@@ -62,6 +64,7 @@ namespace FineUIPro.Web.CQMS.Plan
hdId.Text = this.MainPlanId; hdId.Text = this.MainPlanId;
txtPlanCode.Text = MainPlan.PlanCode; txtPlanCode.Text = MainPlan.PlanCode;
txtFileName.Text = MainPlan.FileName; txtFileName.Text = MainPlan.FileName;
List<string> list = BLL.CQMS_MainPlanApproveService.GetAudit3PersonIds(MainPlanId); List<string> list = BLL.CQMS_MainPlanApproveService.GetAudit3PersonIds(MainPlanId);
if (list.Count > 0) if (list.Count > 0)
{ {
@@ -107,6 +110,7 @@ namespace FineUIPro.Web.CQMS.Plan
this.btnSubmit.Visible = false; this.btnSubmit.Visible = false;
this.next.Hidden = true; this.next.Hidden = true;
} }
drpHandleType_SelectedIndexChanged(null, null); drpHandleType_SelectedIndexChanged(null, null);
} }
else else
@@ -323,6 +327,7 @@ namespace FineUIPro.Web.CQMS.Plan
MainPlan.ProjectId = this.CurrUser.LoginProjectId; MainPlan.ProjectId = this.CurrUser.LoginProjectId;
MainPlan.PlanCode = this.txtPlanCode.Text.Trim(); MainPlan.PlanCode = this.txtPlanCode.Text.Trim();
MainPlan.FileName = this.txtFileName.Text.Trim(); MainPlan.FileName = this.txtFileName.Text.Trim();
MainPlan.FilePath = "FileUpload/CQMSMainPlan/" + txtPlanCode.Text + ".doc";
if (saveType == "submit") if (saveType == "submit")
{ {
MainPlan.State = this.drpHandleType.SelectedValue; MainPlan.State = this.drpHandleType.SelectedValue;
@@ -373,6 +378,7 @@ namespace FineUIPro.Web.CQMS.Plan
if (string.IsNullOrEmpty(hdId.Text)) if (string.IsNullOrEmpty(hdId.Text))
{ {
MainPlan.MainPlanId = SQLHelper.GetNewID(); MainPlan.MainPlanId = SQLHelper.GetNewID();
MainPlanId = MainPlan.MainPlanId;
} }
else else
{ {
@@ -408,8 +414,11 @@ namespace FineUIPro.Web.CQMS.Plan
} }
} }
LogService.AddSys_Log(CurrUser, MainPlan.PlanCode, MainPlan.MainPlanId, Const.MainPlanMenuId, "修改总包施工质量计划"); LogService.AddSys_Log(CurrUser, MainPlan.PlanCode, MainPlan.MainPlanId, Const.MainPlanMenuId, "修改总包施工质量计划");
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); if (saveType== "submit")
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
} }
/// <summary> /// <summary>
/// 表格数据验证 /// 表格数据验证
@@ -464,5 +473,70 @@ namespace FineUIPro.Web.CQMS.Plan
} }
return str; return str;
} }
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
string rootPath = Funs.RootPath;
var model = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
string filepath = model.FilePath;
string path = rootPath + filepath;
DirectoryInfo pathInfo = new DirectoryInfo(path);
string newPath = pathInfo.Parent.FullName;
if (!Directory.Exists(newPath))
{
Directory.CreateDirectory(newPath);
}
if (e.EventArgument == "Yes")
{
if (!File.Exists(path))
{
File.Copy(rootPath + Const.CQMSPlanTemplateUrl, path);
}
}
else if (e.EventArgument == "No")
{
if (!File.Exists(path))
{
var stream= File.Create(path);
stream.Close();
}
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSMainPlan", MainPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
protected void btnEditWord_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(MainPlanId))
{
Model.Plan_MainPlan MainPlan = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
if (!File.Exists(Funs.RootPath + MainPlan.FilePath))
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSMainPlan", MainPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
}
else
{
SaveMainPlan("save");
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
//PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -")));
}
} }
} }
+13 -2
View File
@@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Plan { namespace FineUIPro.Web.CQMS.Plan
{
public partial class MainPlanEdit { public partial class MainPlanEdit
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -111,6 +113,15 @@ namespace FineUIPro.Web.CQMS.Plan {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button imgBtnFile; protected global::FineUIPro.Button imgBtnFile;
/// <summary>
/// btnEditWord 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEditWord;
/// <summary> /// <summary>
/// next 控件。 /// next 控件。
/// </summary> /// </summary>
@@ -5,6 +5,7 @@ using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net;
namespace FineUIPro.Web.CQMS.Plan namespace FineUIPro.Web.CQMS.Plan
{ {
@@ -291,6 +292,11 @@ namespace FineUIPro.Web.CQMS.Plan
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.SubPlanMenuId, Const.BtnDelete)) if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.SubPlanMenuId, Const.BtnDelete))
{ {
var subPlan = CQMS_SubPlanService.GetSubPlanBySubPlanId(id); var subPlan = CQMS_SubPlanService.GetSubPlanBySubPlanId(id);
if (File.Exists(Funs.RootPath + subPlan.FilePath))
{
File.Delete(Funs.RootPath + subPlan.FilePath);
}
CQMS_SubPlanApproveService.DeleteSubPlanApprovesBySubPlanId(id); CQMS_SubPlanApproveService.DeleteSubPlanApprovesBySubPlanId(id);
CQMS_SubPlanService.DeleteSubPlan(id); CQMS_SubPlanService.DeleteSubPlan(id);
LogService.AddSys_Log(CurrUser, subPlan.Code, id, Const.SubPlanMenuId, "删除分包施工质量计划"); LogService.AddSys_Log(CurrUser, subPlan.Code, id, Const.SubPlanMenuId, "删除分包施工质量计划");
@@ -29,7 +29,7 @@
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" <f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right"> BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows> <Rows>
@@ -117,6 +117,8 @@
<f:Label runat="server" Text="<span style='color:red;'>*</span>附件:" EncodeText="false" ShowRedStar="true" Label="附件:" CssStyle="padding-left:48px" Width="110px" CssClass="marginr" ShowLabel="false" ></f:Label> <f:Label runat="server" Text="<span style='color:red;'>*</span>附件:" EncodeText="false" ShowRedStar="true" Label="附件:" CssStyle="padding-left:48px" Width="110px" CssClass="marginr" ShowLabel="false" ></f:Label>
<f:Button ID="imgBtnFile" Text="附件" ToolTip="上传及查看" Icon="TableCell" OnClick="imgBtnFile_Click" runat="server"> <f:Button ID="imgBtnFile" Text="附件" ToolTip="上传及查看" Icon="TableCell" OnClick="imgBtnFile_Click" runat="server">
</f:Button> </f:Button>
<f:Button ID="btnEditWord" Icon="PageWhiteWord" OnClick="btnEditWord_Click" runat="server" Text="编辑文档" ToolTip="编辑文档" >
</f:Button>
</Items> </Items>
</f:Panel> </f:Panel>
</Items> </Items>
@@ -1,6 +1,8 @@
using BLL; using BLL;
using FineUIPro.Web.ZHGL.Plan;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
namespace FineUIPro.Web.CQMS.Plan namespace FineUIPro.Web.CQMS.Plan
@@ -74,6 +76,7 @@ namespace FineUIPro.Web.CQMS.Plan
HFSubPlanId.Text = SubPlanId; HFSubPlanId.Text = SubPlanId;
Model.Plan_SubPlan SubPlan = CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId); Model.Plan_SubPlan SubPlan = CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
txtCode.Text = SubPlan.Code; txtCode.Text = SubPlan.Code;
if (!string.IsNullOrEmpty(SubPlan.UnitId)) if (!string.IsNullOrEmpty(SubPlan.UnitId))
{ {
drpUnit.SelectedValue = SubPlan.UnitId; drpUnit.SelectedValue = SubPlan.UnitId;
@@ -166,6 +169,7 @@ namespace FineUIPro.Web.CQMS.Plan
} }
else else
{ {
agree.Hidden = true; agree.Hidden = true;
txtEdition.Text = "0"; txtEdition.Text = "0";
options.Hidden = true; options.Hidden = true;
@@ -483,6 +487,8 @@ namespace FineUIPro.Web.CQMS.Plan
SubPlan.UnitId = drpUnit.SelectedValue; SubPlan.UnitId = drpUnit.SelectedValue;
} }
SubPlan.PlanName = txtPlanName.Text.Trim(); SubPlan.PlanName = txtPlanName.Text.Trim();
SubPlan.FilePath = "FileUpload/CQMSSupPlan/" + SubPlan.Code + ".doc";
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim())) if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
{ {
SubPlan.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); SubPlan.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
@@ -504,18 +510,23 @@ namespace FineUIPro.Web.CQMS.Plan
{ {
SubPlan.State = Const.SubPlan_Compile; SubPlan.State = Const.SubPlan_Compile;
} }
SubPlan.CompileMan = CurrUser.PersonId;
SubPlan.Edition = Convert.ToInt32(txtEdition.Text);
if (!string.IsNullOrEmpty(HFSubPlanId.Text)) if (!string.IsNullOrEmpty(HFSubPlanId.Text))
{ {
SubPlan.SubPlanId = HFSubPlanId.Text; SubPlan.SubPlanId = HFSubPlanId.Text;
SubPlanId = SubPlan.SubPlanId;
CQMS_SubPlanService.UpdateSubPlan(SubPlan);
} }
else else
{ {
SubPlan.SubPlanId = SQLHelper.GetNewID(typeof(Model.Plan_SubPlan)); SubPlan.SubPlanId = SQLHelper.GetNewID(typeof(Model.Plan_SubPlan));
} SubPlanId = SubPlan.SubPlanId;
SubPlan.CompileMan = CurrUser.PersonId; CQMS_SubPlanService.AddSubPlan(SubPlan);
SubPlan.Edition = Convert.ToInt32(txtEdition.Text);
}
CQMS_SubPlanService.AddSubPlan(SubPlan);
if (saveType == "submit") if (saveType == "submit")
{ {
Model.Plan_SubPlanApprove approve1 = new Model.Plan_SubPlanApprove(); Model.Plan_SubPlanApprove approve1 = new Model.Plan_SubPlanApprove();
@@ -781,5 +792,70 @@ namespace FineUIPro.Web.CQMS.Plan
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}", String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
-1, fileId, Const.SubPlanMenuId))); -1, fileId, Const.SubPlanMenuId)));
} }
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
string rootPath = Funs.RootPath;
var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
string filepath = model.FilePath;
string path = rootPath + filepath;
DirectoryInfo pathInfo = new DirectoryInfo(path);
string newPath = pathInfo.Parent.FullName;
if (!Directory.Exists(newPath))
{
Directory.CreateDirectory(newPath);
}
if (e.EventArgument == "Yes")
{
if (!File.Exists(path))
{
File.Copy(rootPath + Const.CQMSPlanTemplateUrl, path);
}
}
else if (e.EventArgument == "No")
{
if (!File.Exists(path))
{
var stream = File.Create(path);
stream.Close();
}
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSSubPlan", SubPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
protected void btnEditWord_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(SubPlanId))
{
var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
if (!File.Exists(Funs.RootPath + model.FilePath))
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSSubPlan", SubPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
}
else
{
SaveSubPlan("save");
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
//PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -")));
}
} }
} }
+13 -2
View File
@@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Plan { namespace FineUIPro.Web.CQMS.Plan
{
public partial class SubPlanEdit { public partial class SubPlanEdit
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -156,6 +158,15 @@ namespace FineUIPro.Web.CQMS.Plan {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button imgBtnFile; protected global::FineUIPro.Button imgBtnFile;
/// <summary>
/// btnEditWord 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEditWord;
/// <summary> /// <summary>
/// Panel2 控件。 /// Panel2 控件。
/// </summary> /// </summary>
+8
View File
@@ -210,6 +210,7 @@
<Content Include="AttachFile\res\webuploader\Uploader.swf" /> <Content Include="AttachFile\res\webuploader\Uploader.swf" />
<Content Include="AttachFile\res\webuploader\webuploader.nolog.js" /> <Content Include="AttachFile\res\webuploader\webuploader.nolog.js" />
<Content Include="AttachFile\res\webuploader\webuploader.nolog.min.js" /> <Content Include="AttachFile\res\webuploader\webuploader.nolog.min.js" />
<Content Include="AttachFile\save.aspx" />
<Content Include="AttachFile\uploader.aspx" /> <Content Include="AttachFile\uploader.aspx" />
<Content Include="AttachFile\webuploader.aspx" /> <Content Include="AttachFile\webuploader.aspx" />
<Content Include="BaseInfo\AccidentType.aspx" /> <Content Include="BaseInfo\AccidentType.aspx" />
@@ -5627,6 +5628,13 @@
<Compile Include="AttachFile\player.aspx.designer.cs"> <Compile Include="AttachFile\player.aspx.designer.cs">
<DependentUpon>player.aspx</DependentUpon> <DependentUpon>player.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="AttachFile\save.aspx.cs">
<DependentUpon>save.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="AttachFile\save.aspx.designer.cs">
<DependentUpon>save.aspx</DependentUpon>
</Compile>
<Compile Include="AttachFile\uploader.aspx.cs"> <Compile Include="AttachFile\uploader.aspx.cs">
<DependentUpon>uploader.aspx</DependentUpon> <DependentUpon>uploader.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
+57 -9
View File
@@ -73403,7 +73403,7 @@ namespace Model
OnCreated(); OnCreated();
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string MaterialCode public string MaterialCode
{ {
get get
@@ -73507,7 +73507,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(3000)")]
public string MaterialDef public string MaterialDef
{ {
get get
@@ -78097,7 +78097,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15)")]
public string MaterialCode public string MaterialCode
{ {
get get
@@ -82445,7 +82445,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")]
public string CanWelderCode public string CanWelderCode
{ {
get get
@@ -121814,7 +121814,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(100)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(50)")]
public string MaterialName public string MaterialName
{ {
get get
@@ -121834,7 +121834,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(200)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(50)")]
public string SpecificationAndModel public string SpecificationAndModel
{ {
get get
@@ -121854,7 +121854,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(100)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")]
public string MaterialCode public string MaterialCode
{ {
get get
@@ -121874,7 +121874,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(100)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(50)")]
public string Material public string Material
{ {
get get
@@ -157703,6 +157703,8 @@ namespace Model
private string _State; private string _State;
private string _FilePath;
private EntityRef<Base_Project> _Base_Project; private EntityRef<Base_Project> _Base_Project;
private EntitySet<Plan_MainPlanApprove> _Plan_MainPlanApprove; private EntitySet<Plan_MainPlanApprove> _Plan_MainPlanApprove;
@@ -157725,6 +157727,8 @@ namespace Model
partial void OnCompileDateChanged(); partial void OnCompileDateChanged();
partial void OnStateChanging(string value); partial void OnStateChanging(string value);
partial void OnStateChanged(); partial void OnStateChanged();
partial void OnFilePathChanging(string value);
partial void OnFilePathChanged();
#endregion #endregion
public Plan_MainPlan() public Plan_MainPlan()
@@ -157878,6 +157882,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FilePath", DbType="VarChar(200)")]
public string FilePath
{
get
{
return this._FilePath;
}
set
{
if ((this._FilePath != value))
{
this.OnFilePathChanging(value);
this.SendPropertyChanging();
this._FilePath = value;
this.SendPropertyChanged("FilePath");
this.OnFilePathChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Plan_MainPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Plan_MainPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project public Base_Project Base_Project
{ {
@@ -158233,6 +158257,8 @@ namespace Model
private System.Nullable<int> _Edition; private System.Nullable<int> _Edition;
private string _FilePath;
private EntityRef<Base_Project> _Base_Project; private EntityRef<Base_Project> _Base_Project;
private EntityRef<Base_Unit> _Base_Unit; private EntityRef<Base_Unit> _Base_Unit;
@@ -158265,6 +158291,8 @@ namespace Model
partial void OnStateChanged(); partial void OnStateChanged();
partial void OnEditionChanging(System.Nullable<int> value); partial void OnEditionChanging(System.Nullable<int> value);
partial void OnEditionChanged(); partial void OnEditionChanged();
partial void OnFilePathChanging(string value);
partial void OnFilePathChanged();
#endregion #endregion
public Plan_SubPlan() public Plan_SubPlan()
@@ -158503,6 +158531,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FilePath", DbType="VarChar(200)")]
public string FilePath
{
get
{
return this._FilePath;
}
set
{
if ((this._FilePath != value))
{
this.OnFilePathChanging(value);
this.SendPropertyChanging();
this._FilePath = value;
this.SendPropertyChanged("FilePath");
this.OnFilePathChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Plan_SubPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Plan_SubPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project public Base_Project Base_Project
{ {
@@ -234659,7 +234707,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")]
public string CanWelderCode public string CanWelderCode
{ {
get get