2023-03-14 增加公司模板设置界面
This commit is contained in:
@@ -34,6 +34,12 @@ namespace WordEdit
|
||||
string filepath = model.FilePath;
|
||||
url = Funs.SGGLUrl + filepath;
|
||||
}
|
||||
else if (a[1]== "Companytemplate")
|
||||
{
|
||||
var model = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(a[0]);
|
||||
string filepath = model.FilePath;
|
||||
url = Funs.SGGLUrl + filepath;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Companytemplate.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.Companytemplate" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
.f-grid-row.yellow
|
||||
{
|
||||
background-color: YellowGreen;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.f-grid-row.red
|
||||
{
|
||||
background-color: Yellow;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" AutoScroll="true"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="TemplateId" AllowCellEditing="true"
|
||||
ClicksToEdit="2" DataIDField="TemplateId" AllowSorting="true" SortField="TemplateId"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Text="新增" Hidden="true" Icon="Add" runat="server"
|
||||
OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="imgBtnFile" Text="文件" ToolTip="查看" Icon="PageWhiteWord" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
<%-- <f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button> --%>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
||||
<f:RenderField Width="150px" ColumnID="Code" DataField="Code" SortField="Code"
|
||||
FieldType="String" HeaderText="模板编码" TextAlign="Left" HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Name" DataField="Name" SortField="Name"
|
||||
FieldType="String" HeaderText="模板名称" TextAlign="Left" HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Remarks" DataField="Remarks" SortField="Remarks"
|
||||
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="10" Value="10" />
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="所有行" Value="100000" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
|
||||
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
|
||||
Title="编辑" EnableIFrame="true" Height="650px"
|
||||
Width="1200px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑" Icon="TableEdit" >
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using AspNet=System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class Companytemplate : PageBase
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
Model.Base_CompanyTemplate table = new Model.Base_CompanyTemplate();
|
||||
var tb = BLL.Base_CompanytemplateService.getListData(table, Grid1);
|
||||
Grid1.RecordCount = Base_CompanytemplateService.count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GV 数据操作
|
||||
/// <summary>
|
||||
/// 过滤表头
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
//protected void Grid1_FilterChange(object sender, EventArgs e)
|
||||
//{
|
||||
// this.BindGrid();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
this.Grid1.PageIndex = e.NewPageIndex;
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
this.Grid1.SortDirection = e.SortDirection;
|
||||
this.Grid1.SortField = e.SortField;
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 数据编辑事件
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CompanytemplateEdit.aspx?TemplateId={0}", string.Empty, "增加 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string ID = Grid1.SelectedRowID;
|
||||
var model = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(ID);
|
||||
if (model != null) ///已上报时不能删除
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CompanytemplateEdit.aspx?TemplateId={0}", ID, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
protected void imgBtnFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|Companytemplate", Grid1.SelectedRowID, "查看 -")));
|
||||
PageContext.RegisterStartupScript(Window1.GetHideReference());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.btnEdit_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var model = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(rowID);
|
||||
if (model != null)
|
||||
{
|
||||
BLL.Base_CompanytemplateService.DeleteBase_CompanyTemplateById(rowID);
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗
|
||||
/// <summary>
|
||||
/// 关闭弹出窗
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取权限按钮
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CompanyTemplateMenuId);
|
||||
if (buttonList.Count > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = 500;
|
||||
this.BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
string html = row.Values[column.ColumnIndex].ToString();
|
||||
if (column.ColumnID == "tfNumber")
|
||||
{
|
||||
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
|
||||
}
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class Companytemplate
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// imgBtnFile 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CompanytemplateEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CompanytemplateEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCode" runat="server" Label="模板编号" MaxLength="200" LabelWidth="100">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtName" runat="server" Label="模板名称" MaxLength="200" LabelWidth="100">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemarks" runat="server" Label="备注" MaxLength="200" LabelWidth="100">
|
||||
</f:TextBox>
|
||||
<f:Button ID="btnEditWord" Icon="PageWhiteWord" OnClick="btnEditWord_Click" runat="server" Text="编辑文档" ToolTip="编辑文档" >
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class CompanytemplateEdit : PageBase
|
||||
{
|
||||
#region
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string TemplateId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["TemplateId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["TemplateId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.TemplateId = Request.Params["TemplateId"];
|
||||
if (!string.IsNullOrEmpty(this.TemplateId))
|
||||
{
|
||||
Model.Base_CompanyTemplate model = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(this.TemplateId);
|
||||
if (model != null)
|
||||
{
|
||||
this.txtCode.Text = model.Code;
|
||||
this.txtName.Text = model.Name;
|
||||
this.txtRemarks.Text = model.Remarks;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Save())
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private bool Save()
|
||||
{
|
||||
bool result=true;
|
||||
var q = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateByCode(this.txtCode.Text);
|
||||
if (q != null && q.TemplateId != this.TemplateId)
|
||||
{
|
||||
ShowNotify("文件编号不能重复", MessageBoxIcon.Warning);
|
||||
result = false;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
Model.Base_CompanyTemplate table = new Model.Base_CompanyTemplate();
|
||||
table.Code = this.txtCode.Text;
|
||||
table.Name = this.txtName.Text;
|
||||
table.FilePath = "FileUpload/Companytemplate/" + txtCode.Text + ".doc";
|
||||
table.Remarks = this.txtRemarks.Text;
|
||||
if (!File.Exists(Funs.RootPath + table.FilePath))
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
string filepath = table.FilePath;
|
||||
string path = rootPath + filepath;
|
||||
DirectoryInfo pathInfo = new DirectoryInfo(path);
|
||||
string newPath = pathInfo.Parent.FullName;
|
||||
if (!Directory.Exists(newPath))
|
||||
{
|
||||
Directory.CreateDirectory(newPath);
|
||||
}
|
||||
var stream = File.Create(path);
|
||||
stream.Close();
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.TemplateId))
|
||||
{
|
||||
table.TemplateId = SQLHelper.GetNewID(typeof(Model.Base_CompanyTemplate));
|
||||
TemplateId = table.TemplateId;
|
||||
BLL.Base_CompanytemplateService.AddBase_CompanyTemplate(table);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
table.TemplateId = this.TemplateId;
|
||||
BLL.Base_CompanytemplateService.UpdateBase_CompanyTemplate(table);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CompanyTemplateMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnEditWord_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TemplateId))
|
||||
{
|
||||
Save();
|
||||
}
|
||||
|
||||
Model.Base_CompanyTemplate table = BLL.Base_CompanytemplateService.GetBase_CompanyTemplateById(TemplateId);
|
||||
if (!File.Exists(Funs.RootPath + table.FilePath))
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
string filepath = table.FilePath;
|
||||
string path = rootPath + filepath;
|
||||
DirectoryInfo pathInfo = new DirectoryInfo(path);
|
||||
string newPath = pathInfo.Parent.FullName;
|
||||
if (!Directory.Exists(newPath))
|
||||
{
|
||||
Directory.CreateDirectory(newPath);
|
||||
}
|
||||
var stream = File.Create(path);
|
||||
stream.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|Companytemplate", TemplateId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(Window1.GetHideReference());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class CompanytemplateEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemarks 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemarks;
|
||||
|
||||
/// <summary>
|
||||
/// btnEditWord 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEditWord;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" Hidden="true"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="imgBtnFile" Text="文件" ToolTip="查看" Icon="PageWhiteWord" runat="server"
|
||||
<f:Button ID="imgBtnFile" Text="查看文件" ToolTip="查看" Icon="PageWhiteWord" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
<f:Button ID="imgBtnFile" Text="文件" ToolTip="上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
|
||||
<f:DropDownList ID="drpCompanyTemplate" runat="server" Width="300px" Hidden="true" Label="公司模板" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="btnEditWord" Icon="PageWhiteWord" OnClick="btnEditWord_Click" runat="server" Text="编辑文档" ToolTip="编辑文档" >
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
||||
@@ -58,6 +58,8 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
this.drpPerson.DataSource = (from x in Funs.DB.Person_Persons where x.UnitId == Const.UnitId_SEDIN && x.DepartId == Const.Depart_constructionId select x).ToList();
|
||||
this.drpPerson.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpPerson);
|
||||
BLL.Base_CompanytemplateService.InitBase_CompanyTemplateDownList(drpCompanyTemplate, true);
|
||||
IsHiddendrpCompanyTemplate();
|
||||
if (!string.IsNullOrEmpty(MainPlanId))
|
||||
{
|
||||
Model.Plan_MainPlan MainPlan = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
|
||||
@@ -484,25 +486,61 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
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 (drpCompanyTemplate.SelectedValue!=Const._Null)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
var stream= File.Create(path);
|
||||
stream.Close();
|
||||
}
|
||||
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}|CQMSMainPlan", MainPlanId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
|
||||
}
|
||||
private void GetCompanyTemplate()
|
||||
{
|
||||
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 (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}|CQMSMainPlan", MainPlanId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否隐藏选择模板
|
||||
/// </summary>
|
||||
protected void IsHiddendrpCompanyTemplate()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MainPlanId))
|
||||
{
|
||||
Model.Plan_MainPlan MainPlan = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
|
||||
if (!File.Exists(Funs.RootPath + MainPlan.FilePath))
|
||||
{
|
||||
|
||||
drpCompanyTemplate.Hidden= false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drpCompanyTemplate.Hidden = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
protected void btnEditWord_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -512,12 +550,12 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
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")));
|
||||
GetCompanyTemplate();
|
||||
//PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
|
||||
// String.Empty,
|
||||
// MessageBoxIcon.Question,
|
||||
// PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
|
||||
// PageManager1.GetCustomEventReference("No")));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -529,14 +567,9 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
else
|
||||
{
|
||||
SaveMainPlan("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, "查看 -")));
|
||||
}
|
||||
//PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,6 +113,15 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// drpCompanyTemplate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCompanyTemplate;
|
||||
|
||||
/// <summary>
|
||||
/// btnEditWord 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="编制" Icon="Add" EnablePostBack="false" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="imgBtnFile" Text="文件" ToolTip="查看" Icon="PageWhiteWord" runat="server"
|
||||
<f:Button ID="imgBtnFile" Text="查看文件" ToolTip="查看" Icon="PageWhiteWord" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
<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>
|
||||
|
||||
<f:DropDownList ID="drpCompanyTemplate" runat="server" Width="300px" Hidden="true" Label="公司模板" LabelAlign="Right" EnableEdit="true" >
|
||||
</f:DropDownList>
|
||||
<f:Button ID="btnEditWord" Icon="PageWhiteWord" OnClick="btnEditWord_Click" runat="server" Text="编辑文档" ToolTip="编辑文档" >
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -158,6 +158,15 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// drpCompanyTemplate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCompanyTemplate;
|
||||
|
||||
/// <summary>
|
||||
/// btnEditWord 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -225,6 +225,8 @@
|
||||
<Content Include="BaseInfo\CompanyModelEdit.aspx" />
|
||||
<Content Include="BaseInfo\CompanyModelKind.aspx" />
|
||||
<Content Include="BaseInfo\CompanyModelKindEdit.aspx" />
|
||||
<Content Include="BaseInfo\Companytemplate.aspx" />
|
||||
<Content Include="BaseInfo\CompanytemplateEdit.aspx" />
|
||||
<Content Include="BaseInfo\ConstructionTestType.aspx" />
|
||||
<Content Include="BaseInfo\CostType.aspx" />
|
||||
<Content Include="BaseInfo\CQMSTrainObject.aspx" />
|
||||
@@ -5731,6 +5733,20 @@
|
||||
<Compile Include="BaseInfo\CompanyModelKindEdit.aspx.designer.cs">
|
||||
<DependentUpon>CompanyModelKindEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\Companytemplate.aspx.cs">
|
||||
<DependentUpon>Companytemplate.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\Companytemplate.aspx.designer.cs">
|
||||
<DependentUpon>Companytemplate.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\CompanytemplateEdit.aspx.cs">
|
||||
<DependentUpon>CompanytemplateEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\CompanytemplateEdit.aspx.designer.cs">
|
||||
<DependentUpon>CompanytemplateEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\ConstructionTestType.aspx.cs">
|
||||
<DependentUpon>ConstructionTestType.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<TreeNode id="CCD45D20-EA3F-47E7-8176-AB085778539E" Text="告知和监检类型定义" NavigateUrl="BaseInfo/NoticeAndSupervisionType.aspx"></TreeNode>
|
||||
<TreeNode id="B9372A07-8A93-4EC0-9374-FDE1ED958DAE" Text="公司质量样板类别" NavigateUrl="BaseInfo/CompanyModelKind.aspx"></TreeNode>
|
||||
<TreeNode id="99C99DF8-103F-4CA4-83CB-A6C924B5A698" Text="公司质量样板" NavigateUrl="BaseInfo/CompanyModel.aspx"></TreeNode>
|
||||
<TreeNode id="FBE29945-515F-4CE0-B36E-444E4E3C047C" Text="公司文件模板" NavigateUrl="BaseInfo/Companytemplate.aspx"></TreeNode>
|
||||
<TreeNode id="164CDCED-E794-4177-AADE-23CA8E1AA1B8" Text="培训类别" NavigateUrl="BaseInfo/CQMSTrainType.aspx"></TreeNode>
|
||||
<TreeNode id="D2027C3D-ECE9-445E-8DBE-AF0DA10005FC" Text="培训对象" NavigateUrl="BaseInfo/CQMSTrainObject.aspx"></TreeNode>
|
||||
<TreeNode id="E20647B6-315D-483B-8E5D-4810DBECE79E" Text="质量奖惩定义" NavigateUrl=""><TreeNode id="84DB3C33-8828-407B-8B8A-5E98AD610FA6" Text="奖励定义" NavigateUrl="BaseInfo/RewardType.aspx"></TreeNode>
|
||||
|
||||
Reference in New Issue
Block a user