From 22f12bca02b5c4a6e847229a6ecd6492ae8f24e7 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Thu, 29 Jun 2023 11:26:33 +0800 Subject: [PATCH] =?UTF-8?q?20230628=20=E6=96=B0=E5=A2=9E=E6=9C=AC=E9=83=A8?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=A1=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-06-29.sql | 12 ++ .../0-0系统设置(Menu_SysSet).sql | 13 ++ SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/BaseInfo/CheckTemplateService.cs | 160 +++++++++++++++ SGGL/BLL/Common/Const.cs | 12 +- .../FineUIPro.Web/BaseInfo/CheckTemplate.aspx | 108 ++++++++++ .../BaseInfo/CheckTemplate.aspx.cs | 187 ++++++++++++++++++ .../BaseInfo/CheckTemplate.aspx.designer.cs | 143 ++++++++++++++ .../BaseInfo/CheckTemplateEdit.aspx | 74 +++++++ .../BaseInfo/CheckTemplateEdit.aspx.cs | 107 ++++++++++ .../CheckTemplateEdit.aspx.designer.cs | 143 ++++++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 18 +- SGGL/FineUIPro.Web/common/Menu_SysSet.xml | 1 + 13 files changed, 975 insertions(+), 4 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-06-29.sql create mode 100644 SGGL/BLL/BaseInfo/CheckTemplateService.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-06-29.sql b/DataBase/版本日志/SGGLDB_V2023-06-29.sql new file mode 100644 index 00000000..5364f0c4 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-06-29.sql @@ -0,0 +1,12 @@ +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('F004D9B0-6E6A-41E0-88F1-2306BB6397C6','','BaseInfo/CheckTemplate.aspx',130,'8A2CEE72-2793-49C6-9E2E-E83B2676E2DD','Menu_SysSet',1,1,1) +GO +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('FBB8C0B9-0CA6-445A-B682-4AC3FFBE232A','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','',1) +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('7190D868-0CE6-4FAC-944F-07032176E101','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','޸',2) +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('6077EBFF-3905-4D1E-959B-0795E9A1627C','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','ɾ',3) +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('0E2074B0-53AF-4075-8C69-2F5E10A1E791','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','',4) +GO diff --git a/DataBase/菜单初始化脚本/0-0系统设置(Menu_SysSet).sql b/DataBase/菜单初始化脚本/0-0系统设置(Menu_SysSet).sql index 844eab08..9a4c5112 100644 --- a/DataBase/菜单初始化脚本/0-0系统设置(Menu_SysSet).sql +++ b/DataBase/菜单初始化脚本/0-0系统设置(Menu_SysSet).sql @@ -578,6 +578,19 @@ GO VALUES('7F9EAADC-69F4-4D97-8E0B-B6DB4919225E','3EC2676A-70EB-400E-BE17-EEBBA0B7E9D7','',4) GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('F004D9B0-6E6A-41E0-88F1-2306BB6397C6','','BaseInfo/CheckTemplate.aspx',130,'8A2CEE72-2793-49C6-9E2E-E83B2676E2DD','Menu_SysSet',1,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('FBB8C0B9-0CA6-445A-B682-4AC3FFBE232A','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('7190D868-0CE6-4FAC-944F-07032176E101','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('6077EBFF-3905-4D1E-959B-0795E9A1627C','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('0E2074B0-53AF-4075-8C69-2F5E10A1E791','F004D9B0-6E6A-41E0-88F1-2306BB6397C6','',4) + GO + ------------------------------------------------ӻϢ-------------------------------------------- INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('85DFE1D3-9E68-46B5-87E5-A525698F2F5F','','',40,'D363BD9D-4DEC-45D8-89C8-B0E49DEF61B4','Menu_SysSet',1,0,1) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 8d1969fe..7a509cd3 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -210,6 +210,7 @@ + diff --git a/SGGL/BLL/BaseInfo/CheckTemplateService.cs b/SGGL/BLL/BaseInfo/CheckTemplateService.cs new file mode 100644 index 00000000..c499c867 --- /dev/null +++ b/SGGL/BLL/BaseInfo/CheckTemplateService.cs @@ -0,0 +1,160 @@ +using FineUIPro; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 本部检查项 + /// + public static class CheckTemplateService + { + public static Model.SGGLDB db = Funs.DB; + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + + /// + /// 定义变量 + /// + private static IQueryable getDataLists = from x in db.ProjectSupervision_CheckTemplate + select x; + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Grid Grid1) + { + var q = getDataLists; + count = q.Count(); + if (count == 0) + { + return null; + } + q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.ID, + x.SortIndex, + x.CheckItem, + x.CheckStandard, + x.CheckMethod, + x.BaseScore, + x.Type, + x.Indexs, + }; + } + #endregion + + /// + /// 根据主键获取本部检查项 + /// + /// + /// + public static Model.ProjectSupervision_CheckTemplate GetCheckTemplateById(string ID) + { + return Funs.DB.ProjectSupervision_CheckTemplate.FirstOrDefault(e => e.ID == ID); + } + + /// + /// 添加本部检查项 + /// + /// + public static void AddCheckTemplate(Model.ProjectSupervision_CheckTemplate CheckTemplate) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ProjectSupervision_CheckTemplate newCheckTemplate = new Model.ProjectSupervision_CheckTemplate + { + ID = CheckTemplate.ID, + SortIndex = CheckTemplate.SortIndex, + CheckItem = CheckTemplate.CheckItem, + CheckStandard = CheckTemplate.CheckStandard, + CheckMethod = CheckTemplate.CheckMethod, + BaseScore = CheckTemplate.BaseScore, + Type = "1",// CheckTemplate.Type, //// 1-现场安全检查 + Indexs = CheckTemplate.Indexs, + }; + db.ProjectSupervision_CheckTemplate.InsertOnSubmit(newCheckTemplate); + db.SubmitChanges(); + } + } + + /// + /// 修改本部检查项 + /// + /// + public static void UpdateCheckTemplate(Model.ProjectSupervision_CheckTemplate CheckTemplate) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ProjectSupervision_CheckTemplate newCheckTemplate = db.ProjectSupervision_CheckTemplate.FirstOrDefault(e => e.ID == CheckTemplate.ID); + if (newCheckTemplate != null) + { + newCheckTemplate.SortIndex = CheckTemplate.SortIndex; + newCheckTemplate.CheckItem = CheckTemplate.CheckItem; + newCheckTemplate.CheckStandard = CheckTemplate.CheckStandard; + newCheckTemplate.CheckMethod = CheckTemplate.CheckMethod; + newCheckTemplate.BaseScore = CheckTemplate.BaseScore; + newCheckTemplate.Indexs = CheckTemplate.Indexs; + db.SubmitChanges(); + } + } + } + + /// + /// 根据主键删除本部检查项 + /// + /// + public static void DeleteCheckTemplateById(string ID) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.ProjectSupervision_CheckTemplate CheckTemplate = db.ProjectSupervision_CheckTemplate.FirstOrDefault(e => e.ID == ID); + if (CheckTemplate != null) + { + db.ProjectSupervision_CheckTemplate.DeleteOnSubmit(CheckTemplate); + db.SubmitChanges(); + } + } + } + + /// + /// 获取本部检查项下拉列表项 + /// + /// + public static List GetCheckTemplateList() + { + return (from x in Funs.DB.ProjectSupervision_CheckTemplate orderby x.Indexs select x).ToList(); + } + + /// + /// 应急响应类型下拉框 + /// + /// 下拉框名字 + /// 项目id + /// 是否显示请选择 + public static void InitCheckTemplateDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "ID"; + dropName.DataTextField = "CheckTemplateName"; + dropName.DataSource = GetCheckTemplateList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index f5e2fc5d..b8934340 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -805,12 +805,10 @@ /// public const string ServerCheckTwolevelMenuId = "6CBF1000-5E3C-4FBD-A7EC-965765F6F52D"; - /// /// 发起检查 /// - public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6"; - public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30"; + public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6"; /// /// 实业 @@ -1152,6 +1150,14 @@ /// 执业资格证书证书 /// public const string PracticeCertificateMenuId = "1390195D8-874B-4E7B-8DBF-D81A5984E973"; + /// + /// + /// + public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30"; + /// + /// 本部检查项 + /// + public const string CheckTemplateMenuId = "F004D9B0-6E6A-41E0-88F1-2306BB6397C6"; #endregion #region 质量基础信息 diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx new file mode 100644 index 00000000..cd96fe63 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx @@ -0,0 +1,108 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckTemplate.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CheckTemplate" %> + + + + + + + + 本部检查项 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.cs new file mode 100644 index 00000000..fd4e23a9 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.cs @@ -0,0 +1,187 @@ +using BLL; +using System; +using System.Text; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class CheckTemplate : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + Funs.DropDownPageSize(this.ddlPageSize); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + var tb = BLL.CheckTemplateService.getListData( Grid1); + Grid1.RecordCount = CheckTemplateService.count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckTemplateEdit.aspx?CheckTemplateID={0}", string.Empty, "增加 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckTemplateEdit.aspx?CheckTemplateID={0}", Grid1.SelectedRowID, "编辑 - "))); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + 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(); + BLL.CheckTemplateService.DeleteCheckTemplateById(rowID); + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CheckTemplateMenuId); + 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 导出按钮 + /// 导出按钮 + /// + /// + /// + 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 = this.Grid1.RecordCount; + //this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.designer.cs new file mode 100644 index 00000000..300b8fde --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplate.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class CheckTemplate + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx new file mode 100644 index 00000000..a6c48865 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx @@ -0,0 +1,74 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckTemplateEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CheckTemplateEdit" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.cs new file mode 100644 index 00000000..1fc1fbcf --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.cs @@ -0,0 +1,107 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class CheckTemplateEdit : PageBase + { + #region + /// + /// 主键 + /// + public string CheckTemplateID + { + get + { + return (string)ViewState["CheckTemplateID"]; + } + set + { + ViewState["CheckTemplateID"] = value; + } + } + #endregion + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + ////权限按钮方法 + this.GetButtonPower(); + this.CheckTemplateID = Request.Params["CheckTemplateID"]; + if (!string.IsNullOrEmpty(this.ID)) + { + var getData = BLL.CheckTemplateService.GetCheckTemplateById(this.CheckTemplateID); + if (getData != null) + { + this.txtSortIndex.Text = getData.SortIndex.ToString(); + this.txtCheckItem.Text = getData.CheckItem; + this.txtCheckStandard.Text = getData.CheckStandard; + this.txtCheckMethod.Text = getData.CheckMethod; + this.txtBaseScore.Text = getData.BaseScore.ToString(); + this.txtIndexs.Text = getData.Indexs.ToString(); + } + } + else + { + this.txtIndexs.Text= ((Funs.DB.ProjectSupervision_CheckTemplate.Max(x => x.Indexs) ?? 0) + 1).ToString(); + } + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Model.ProjectSupervision_CheckTemplate newCheckTemplate = new Model.ProjectSupervision_CheckTemplate + { + ID = this.CheckTemplateID, + SortIndex = Funs.GetNewInt( this.txtSortIndex.Text), + CheckItem = this.txtCheckItem.Text.Trim(), + CheckStandard = this.txtCheckStandard.Text.Trim(), + CheckMethod = this.txtCheckMethod.Text.Trim(), + BaseScore = Funs.GetNewDecimal(this.txtBaseScore.Text.Trim()), + Indexs = Funs.GetNewInt(this.txtIndexs.Text), + }; + + if (string.IsNullOrEmpty(this.CheckTemplateID)) + { + newCheckTemplate.ID = SQLHelper.GetNewID(); + BLL.CheckTemplateService.AddCheckTemplate(newCheckTemplate); + + } + else + { + newCheckTemplate.ID = this.CheckTemplateID; + BLL.CheckTemplateService.UpdateCheckTemplate(newCheckTemplate); + } + + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CheckTemplateMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.designer.cs new file mode 100644 index 00000000..accc639b --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CheckTemplateEdit.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class CheckTemplateEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtIndexs 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtIndexs; + + /// + /// txtSortIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSortIndex; + + /// + /// txtCheckItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckItem; + + /// + /// txtCheckStandard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCheckStandard; + + /// + /// txtCheckMethod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCheckMethod; + + /// + /// txtBaseScore 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtBaseScore; + + /// + /// lb 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lb; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 9c77fe04..7cc8f2c9 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -242,7 +242,9 @@ + + @@ -5824,6 +5826,13 @@ AccidentType.aspx + + CheckTemplate.aspx + ASPXCodeBehind + + + CheckTemplate.aspx + BaseFactory.aspx ASPXCodeBehind @@ -5831,6 +5840,13 @@ BaseFactory.aspx + + CheckTemplateEdit.aspx + ASPXCodeBehind + + + CheckTemplateEdit.aspx + BaseFactoryEdit.aspx ASPXCodeBehind @@ -13927,7 +13943,7 @@ True 0 / - http://localhost:8392/ + http://localhost:5423/ False False diff --git a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml index 71acb007..fa21c6d3 100644 --- a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml +++ b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml @@ -48,6 +48,7 @@ +