From e12e7ed448fb786bc0d1faebd184f829e41b159e Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Fri, 27 Jun 2025 14:31:50 +0800 Subject: [PATCH] 1 --- SGGL/BLL/BaseInfo/CostTypeService.cs | 52 +++++++++ .../BLL/ZHGL/DataSync/HSSEData_HSSEService.cs | 48 ++++++-- SGGL/FineUIPro.Web/BaseInfo/CostType.aspx | 42 ++++++- SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.cs | 101 ++++++++++++++++- .../BaseInfo/CostType.aspx.designer.cs | 87 ++++++++++++--- SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx | 52 +++++++++ .../BaseInfo/CostTypeEdit.aspx.cs | 99 +++++++++++++++++ .../BaseInfo/CostTypeEdit.aspx.designer.cs | 96 ++++++++++++++++ .../BaseInfo/CostTypeItemEdit.aspx | 56 ++++++++++ .../BaseInfo/CostTypeItemEdit.aspx.cs | 100 +++++++++++++++++ .../CostTypeItemEdit.aspx.designer.cs | 105 ++++++++++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 +++ SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs | 4 + 13 files changed, 832 insertions(+), 26 deletions(-) create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.designer.cs diff --git a/SGGL/BLL/BaseInfo/CostTypeService.cs b/SGGL/BLL/BaseInfo/CostTypeService.cs index 649e3ffe..1f57548e 100644 --- a/SGGL/BLL/BaseInfo/CostTypeService.cs +++ b/SGGL/BLL/BaseInfo/CostTypeService.cs @@ -53,6 +53,43 @@ namespace BLL } } + /// + /// 添加费用类型明细 + /// + /// + public static void AddCostTypeItem(Model.Base_CostTypeItem costTypeItem) + { + Model.SGGLDB db = Funs.DB; + Model.Base_CostTypeItem newCostType = new Model.Base_CostTypeItem + { + CostTypeItemId= costTypeItem.CostTypeItemId, + CostTypeId = costTypeItem.CostTypeId, + SortIndex = costTypeItem.SortIndex, + CostTypeItemName = costTypeItem.CostTypeItemName, + Remark = costTypeItem.Remark + }; + db.Base_CostTypeItem.InsertOnSubmit(newCostType); + db.SubmitChanges(); + } + + /// + /// 修改费用类型明细 + /// + /// + public static void UpdateCostTypeItem(Model.Base_CostTypeItem costTypeItem) + { + Model.SGGLDB db = Funs.DB; + Model.Base_CostTypeItem newCostType = db.Base_CostTypeItem.FirstOrDefault(e => e.CostTypeId == costTypeItem.CostTypeId); + if (newCostType != null) + { + newCostType.CostTypeId = costTypeItem.CostTypeId; + newCostType.SortIndex = costTypeItem.SortIndex; + newCostType.CostTypeItemName = costTypeItem.CostTypeItemName; + newCostType.Remark = costTypeItem.Remark; + db.SubmitChanges(); + } + } + /// /// 根据主键删除费用类型 /// @@ -68,6 +105,21 @@ namespace BLL } } + /// + /// 根据主键删除费用类型 + /// + /// + public static void DeleteCostTypeItemById(string costTypeItemId) + { + Model.SGGLDB db = Funs.DB; + Model.Base_CostTypeItem costTypeItem = db.Base_CostTypeItem.FirstOrDefault(e => e.CostTypeItemId == costTypeItemId); + if (costTypeItem != null) + { + db.Base_CostTypeItem.DeleteOnSubmit(costTypeItem); + db.SubmitChanges(); + } + } + /// /// /// diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs index b42ef590..57eb0136 100644 --- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs @@ -4191,19 +4191,48 @@ namespace BLL /// public static List GetQualityPersonNum() { - var result = (from x in Funs.DB.QualityAudit_PersonQuality - join p in Funs.DB.SitePerson_Person on x.PersonId equals p.PersonId into pGroup - from p in pGroup.DefaultIfEmpty() - join pp in Funs.DB.Person_Persons on p.PersonId equals pp.PersonId into ppGroup - from pp in ppGroup.DefaultIfEmpty() + //var result = (from x in Funs.DB.QualityAudit_PersonQuality + // join p in Funs.DB.SitePerson_Person on x.PersonId equals p.PersonId into pGroup + // from p in pGroup.DefaultIfEmpty() + // join pp in Funs.DB.Person_Persons on p.PersonId equals pp.PersonId into ppGroup + // from pp in ppGroup.DefaultIfEmpty() + // join bp in Funs.DB.Base_Project on p.ProjectId equals bp.ProjectId into bpGroup + // from bp in bpGroup.DefaultIfEmpty() + // join u in Funs.DB.Base_Unit on p.UnitId equals u.UnitId into uGroup + // from u in uGroup.DefaultIfEmpty() + // join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId + // join m in Funs.DB.Base_WorkPost on p.WorkPostId equals m.WorkPostId into mGroup + // from m in mGroup.DefaultIfEmpty() + // where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2 && (x.LimitDate == null || x.LimitDate < DateTime.Now) + // select new Model.OfSafetySupervisorsOutput + // { + // ProjectId = p.ProjectId, + // ProjectName = bp.ProjectName, + // UnitId = u.UnitId, + // UnitName = u.UnitName, + // Name = p.PersonName, + // Sex = pp.Sex == null ? "" : (pp.Sex == "1" ? "男" : "女"), + // IdentityCard = p.IdentityCard, + // WorkPostName = m.WorkPostName == null ? "" : m.WorkPostName, + // Phone = pp.Telephone + // }).ToList(); + //return result; + var result = (from p in Funs.DB.SitePerson_Person join bp in Funs.DB.Base_Project on p.ProjectId equals bp.ProjectId into bpGroup from bp in bpGroup.DefaultIfEmpty() join u in Funs.DB.Base_Unit on p.UnitId equals u.UnitId into uGroup from u in uGroup.DefaultIfEmpty() - join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId + join q in Funs.DB.QualityAudit_PersonQuality on p.PersonId equals q.PersonId into qGroup + from q in qGroup.DefaultIfEmpty() join m in Funs.DB.Base_WorkPost on p.WorkPostId equals m.WorkPostId into mGroup from m in mGroup.DefaultIfEmpty() - where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2 && (x.LimitDate == null || x.LimitDate < DateTime.Now) + join su in Funs.DB.Person_Persons on q.CompileMan equals su.PersonId into suGroup + from su in suGroup.DefaultIfEmpty() + join bc in Funs.DB.Base_Certificate on q.CertificateId equals bc.CertificateId into bcGroup + from bc in bcGroup.DefaultIfEmpty() + join su1 in Funs.DB.Person_Persons on q.AuditorId equals su1.PersonId into su1Group + from su1 in su1Group.DefaultIfEmpty() + where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2 select new Model.OfSafetySupervisorsOutput { ProjectId = p.ProjectId, @@ -4211,12 +4240,13 @@ namespace BLL UnitId = u.UnitId, UnitName = u.UnitName, Name = p.PersonName, - Sex = pp.Sex == null ? "" : (pp.Sex == "1" ? "男" : "女"), + Sex = su.Sex == null ? "" : (su.Sex == "1" ? "男" : "女"), IdentityCard = p.IdentityCard, WorkPostName = m.WorkPostName == null ? "" : m.WorkPostName, - Phone = pp.Telephone + Phone = su.Telephone }).ToList(); return result; + } /// /// 获取在岗特种作业人员数量(异步) diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx index c911d38a..dcecf735 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx @@ -16,8 +16,20 @@ runat="server" BoxFlex="1" AllowPaging="false" DataKeyNames="ID" EnableTree="true" TreeColumn="Name" DataIDField="ID" DataParentIDField="ParentId" IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange" AllowSorting="true" SortField="Code" OnSort="Grid1_Sort" SortDirection="ASC" EnableColumnLines="true" - EnableTextSelection="True" ExpandAllTreeNodes="true"> - + EnableTextSelection="True" ExpandAllTreeNodes="true" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"> + + + + + + + + + @@ -25,7 +37,10 @@ - + + + + @@ -38,11 +53,32 @@ + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.cs index 5b5362ac..8cc2b416 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.cs @@ -21,6 +21,9 @@ namespace FineUIPro.Web.BaseInfo { Funs.DropDownPageSize(this.ddlPageSize); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + btnNew.OnClientClick = Window1.GetShowReference("CostTypeEdit.aspx") + "return false;"; + btnNewItem.OnClientClick = Window1.GetShowReference("CostTypeItemEdit.aspx") + "return false;"; + GetButtonPower(); // 绑定表格 BindGrid(); } @@ -112,6 +115,102 @@ namespace FineUIPro.Web.BaseInfo } #endregion - + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CostTypeMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + this.btnNewItem.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + } + } + #endregion + + //右键编辑 + protected void btnMenuModify_Click(object sender, EventArgs e) + { + EditData(); + } + + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + /// + /// 编辑数据方法 + /// + private void EditData() + { + + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + Model.Base_CostType costType = BLL.CostTypeService.GetCostTypeById(Grid1.SelectedRowID); + if (costType != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CostTypeEdit.aspx?CostTypeId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CostTypeItemEdit.aspx?CostTypeItemId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + } + //右键删除 + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var item = BLL.CostTypeService.GetCostTypeById(rowID); + if (item != null) + { + BLL.CostTypeService.DeleteCostTypeById(rowID); + } + else + { + BLL.CostTypeService.DeleteCostTypeItemById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + + /// + /// 窗体关闭 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.designer.cs index 6a020fcf..3bde2d14 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/CostType.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.BaseInfo -{ - - - public partial class CostType - { - +namespace FineUIPro.Web.BaseInfo { + + + public partial class CostType { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -49,7 +47,34 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnNewItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNewItem; + /// /// ToolbarSeparator1 控件。 /// @@ -58,7 +83,7 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -67,7 +92,7 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -76,5 +101,41 @@ namespace FineUIPro.Web.BaseInfo /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; } } diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx new file mode 100644 index 00000000..628858f5 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx @@ -0,0 +1,52 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostTypeEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CostTypeEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.cs new file mode 100644 index 00000000..ae950d83 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.cs @@ -0,0 +1,99 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class CostTypeEdit : PageBase + { + #region 定义项 + /// + /// 问题巡检类型主键 + /// + public string CostTypeId + { + get + { + return (string)ViewState["CostTypeId"]; + } + set + { + ViewState["CostTypeId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + + this.CostTypeId = Request.QueryString["CostTypeId"]; + if (!string.IsNullOrEmpty(this.CostTypeId)) + { + var getTypes = BLL.CostTypeService.GetCostTypeById(this.CostTypeId); + if (getTypes != null) + { + this.txtCostTypeCode.Text = getTypes.CostTypeCode.ToString(); + this.txtCostTypeName.Text = getTypes.CostTypeName; + this.txtRemark.Text = getTypes.Remark; + } + } + else + { + int code = 1; + var maxCode = (from x in Funs.DB.Base_CostType orderby x.CostTypeCode descending select x.CostTypeCode).FirstOrDefault(); + if (maxCode != null) + { + code = maxCode.Value + 1; + } + this.txtCostTypeCode.Text = code.ToString(); + } + } + } + #endregion + + #region 保存数据 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.CostTypeMenuId, Const.BtnSave)) + { + Model.Base_CostType title = new Model.Base_CostType(); + title.CostTypeCode = Funs.GetNewIntOrZero(this.txtCostTypeCode.Text.Trim()); + title.CostTypeName = this.txtCostTypeName.Text.Trim(); + title.Remark = this.txtRemark.Text.Trim(); + if (string.IsNullOrEmpty(this.CostTypeId)) + { + this.CostTypeId = SQLHelper.GetNewID(typeof(Model.Base_CostType)); + title.CostTypeId = this.CostTypeId; + BLL.CostTypeService.AddCostType(title); + BLL.LogService.AddSys_Log(this.CurrUser, title.CostTypeCode.ToString(), title.CostTypeId, BLL.Const.CostTypeMenuId, BLL.Const.BtnAdd); + } + else + { + title.CostTypeId = this.CostTypeId; + BLL.CostTypeService.UpdateCostType(title); + BLL.LogService.AddSys_Log(this.CurrUser, title.CostTypeCode.ToString(), title.CostTypeId, BLL.Const.CostTypeMenuId, BLL.Const.BtnModify); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!"); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.designer.cs new file mode 100644 index 00000000..f4051293 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeEdit.aspx.designer.cs @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo { + + + public partial class CostTypeEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtCostTypeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCostTypeCode; + + /// + /// txtCostTypeName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCostTypeName; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx new file mode 100644 index 00000000..c2057a18 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx @@ -0,0 +1,56 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostTypeItemEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CostTypeItemEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.cs new file mode 100644 index 00000000..708d67be --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.cs @@ -0,0 +1,100 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class CostTypeItemEdit : PageBase + { + #region 定义项 + /// + /// 问题巡检类型主键 + /// + public string CostTypeItemId + { + get + { + return (string)ViewState["CostTypeItemId"]; + } + set + { + ViewState["CostTypeItemId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + CostTypeService.InitCostTypeDropDownList(drpCostType, true); + this.CostTypeItemId = Request.QueryString["CostTypeItemId"]; + if (!string.IsNullOrEmpty(this.CostTypeItemId)) + { + var getTypes = BLL.CostTypeService.GetCostTypeItemById(this.CostTypeItemId); + if (getTypes != null) + { + this.drpCostType.SelectedValue = getTypes.CostTypeId; + this.txtSortIndex.Text = getTypes.SortIndex.ToString(); + this.txtCostTypeItemName.Text = getTypes.CostTypeItemName; + this.txtRemark.Text = getTypes.Remark; + } + } + else + { + + } + } + } + #endregion + + #region 保存数据 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.CostTypeMenuId, Const.BtnSave)) + { + if (this.drpCostType.SelectedValue == BLL.Const._Null) + { + ShowNotify("请选择费用类型!"); + return; + } + Model.Base_CostTypeItem title = new Model.Base_CostTypeItem(); + title.CostTypeId = this.drpCostType.SelectedValue; + title.SortIndex = Funs.GetNewIntOrZero(this.txtSortIndex.Text.Trim()); + title.CostTypeItemName = this.txtCostTypeItemName.Text.Trim(); + title.Remark = this.txtRemark.Text.Trim(); + if (string.IsNullOrEmpty(this.CostTypeItemId)) + { + this.CostTypeItemId = SQLHelper.GetNewID(typeof(Model.Base_CostType)); + title.CostTypeItemId = this.CostTypeItemId; + BLL.CostTypeService.AddCostTypeItem(title); + BLL.LogService.AddSys_Log(this.CurrUser, title.CostTypeItemId, title.CostTypeItemId, BLL.Const.CostTypeMenuId, BLL.Const.BtnAdd); + } + else + { + title.CostTypeItemId = this.CostTypeItemId; + BLL.CostTypeService.UpdateCostTypeItem(title); + BLL.LogService.AddSys_Log(this.CurrUser, title.CostTypeItemId, title.CostTypeItemId, BLL.Const.CostTypeMenuId, BLL.Const.BtnModify); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!"); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.designer.cs new file mode 100644 index 00000000..7d232321 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/CostTypeItemEdit.aspx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo { + + + public partial class CostTypeItemEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpCostType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCostType; + + /// + /// txtSortIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSortIndex; + + /// + /// txtCostTypeItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCostTypeItemName; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index bfe75920..028f77fb 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -269,6 +269,8 @@ + + @@ -7832,6 +7834,20 @@ CostType.aspx + + CostTypeEdit.aspx + ASPXCodeBehind + + + CostTypeEdit.aspx + + + CostTypeItemEdit.aspx + ASPXCodeBehind + + + CostTypeItemEdit.aspx + CQMSTrainObject.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs index 31e53a76..38c3d348 100644 --- a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs @@ -23,6 +23,10 @@ namespace FineUIPro.Web.Person UnitService.InitUnitDropDownList(this.drpUnit, string.Empty, false); Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN; + if (this.CurrUser.UnitId != null && this.CurrUser.UnitId != BLL.Const.UnitId_SEDIN) + { + this.drpUnit.Enabled = false; + } DepartService.InitDepartDropDownList(this.drpDepart, false); Funs.FineUIPleaseSelect(drpDepart, "按部门查询"); ProjectService.InitAllProjectDropDownList(this.drpProject, false);