2023-03-14 增加公司模板设置界面
This commit is contained in:
@@ -71,6 +71,8 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
//CommonService.GetAllButtonList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.SubPlanMenuId);
|
||||
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
SubPlanId = Request.Params["SubPlanId"];
|
||||
BLL.Base_CompanytemplateService.InitBase_CompanyTemplateDownList(drpCompanyTemplate, true);
|
||||
IsHiddendrpCompanyTemplate();
|
||||
if (!string.IsNullOrWhiteSpace(SubPlanId))
|
||||
{
|
||||
HFSubPlanId.Text = SubPlanId;
|
||||
@@ -832,11 +834,8 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
if (!File.Exists(Funs.RootPath + model.FilePath))
|
||||
{
|
||||
|
||||
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
|
||||
String.Empty,
|
||||
MessageBoxIcon.Question,
|
||||
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
|
||||
PageManager1.GetCustomEventReference("No")));
|
||||
GetCompanyTemplate();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -849,13 +848,54 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
{
|
||||
SaveSubPlan("save");
|
||||
|
||||
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
|
||||
String.Empty,
|
||||
MessageBoxIcon.Question,
|
||||
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
|
||||
PageManager1.GetCustomEventReference("No")));
|
||||
GetCompanyTemplate();
|
||||
|
||||
}
|
||||
//PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -")));
|
||||
}
|
||||
|
||||
private void GetCompanyTemplate()
|
||||
{
|
||||
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 (drpCompanyTemplate.SelectedValue != Const._Null)
|
||||
{
|
||||
var template = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(drpCompanyTemplate.SelectedValue);
|
||||
File.Copy(rootPath + template.FilePath, path);
|
||||
|
||||
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSSubPlan", SubPlanId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
|
||||
|
||||
}
|
||||
protected void IsHiddendrpCompanyTemplate()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(SubPlanId))
|
||||
{
|
||||
Model.Plan_SubPlan SubPlan = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
|
||||
if (!File.Exists(Funs.RootPath + SubPlan.FilePath))
|
||||
{
|
||||
|
||||
drpCompanyTemplate.Hidden = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drpCompanyTemplate.Hidden = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user