From dc8a8ad1939e84098ef5be8a77326395234a57b6 Mon Sep 17 00:00:00 2001
From: xiaju <1784803958@qq.com>
Date: Fri, 20 Mar 2026 19:34:45 +0800
Subject: [PATCH] 20260320
---
.../版本日志/SUBQHSE_V2026-03-20-xiaj.sql | 97 ++++
SGGL/BLL/BLL.csproj | 2 +
SGGL/BLL/BaseInfo/MaterialUnitService.cs | 137 +++++
.../MaterialInAndOutRecordService.cs | 131 +++++
SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx | 156 ++++++
.../BaseInfo/MaterialUnit.aspx.cs | 284 ++++++++++
.../BaseInfo/MaterialUnit.aspx.designer.cs | 206 +++++++
.../BaseInfo/RewardAndPunishManager.aspx | 175 +++---
.../BaseInfo/RewardAndPunishManager.aspx.cs | 44 +-
.../RewardAndPunishManager.aspx.designer.cs | 2 +-
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 +
SGGL/Model/Model.cs | 506 ++++++++++++++++++
.../PublishProfiles/FolderProfile.pubxml.user | 22 +-
SGGL/WebAPI/WebAPI.csproj.user | 2 +-
14 files changed, 1650 insertions(+), 122 deletions(-)
create mode 100644 DataBase/版本日志/SUBQHSE_V2026-03-20-xiaj.sql
create mode 100644 SGGL/BLL/BaseInfo/MaterialUnitService.cs
create mode 100644 SGGL/BLL/HSSE/InApproveManager/MaterialInAndOutRecordService.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.designer.cs
diff --git a/DataBase/版本日志/SUBQHSE_V2026-03-20-xiaj.sql b/DataBase/版本日志/SUBQHSE_V2026-03-20-xiaj.sql
new file mode 100644
index 00000000..bce6992c
--- /dev/null
+++ b/DataBase/版本日志/SUBQHSE_V2026-03-20-xiaj.sql
@@ -0,0 +1,97 @@
+
+
+
+
+CREATE TABLE [dbo].[Base_MaterialUnit](
+ [MaterialUnitId] [nvarchar](50) NOT NULL,
+ [MaterialUnitName] [nvarchar](100) NULL,
+ [MaterialUnitCode] [nvarchar](50) NULL,
+ [Remark] [nvarchar](200) NULL,
+ CONSTRAINT [PK_Base_MaterialUnit] PRIMARY KEY CLUSTERED
+(
+ [MaterialUnitId] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitName'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitCode'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'Remark'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵλ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit'
+GO
+
+
+
+
+
+
+CREATE TABLE [dbo].[MaterialInAndOutRecord](
+ [Id] [nvarchar](50) NOT NULL,
+ [ProjectId] [nvarchar](50) NULL,
+ [GoodsCategoryId] [nvarchar](50) NULL,
+ [GoodsCategoryName] [nvarchar](100) NULL,
+ [MaterialModel] [nvarchar](100) NULL,
+ [InOutDate] [datetime] NULL,
+ [UnitId] [nvarchar](50) NULL,
+ [InOrOut] [nvarchar](10) NULL,
+ [Number] [decimal](18, 2) NULL,
+ [MaterialUnitId] [nvarchar](50) NULL,
+ [Remark] [nvarchar](200) NULL,
+ [CompileMan] [nvarchar](50) NULL,
+ [CompileDate] [datetime] NULL,
+ CONSTRAINT [PK_MaterialInAndOutRecord] PRIMARY KEY CLUSTERED
+(
+ [Id] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Id'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'GoodsCategoryId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'GoodsCategoryName'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'MaterialModel'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'InOutDate'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'UnitId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'/' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'InOrOut'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Number'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵλ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'MaterialUnitId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Remark'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'CompileMan'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'CompileDate'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵλ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord'
+GO
+
+
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 0a2f1a0c..9163306f 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -133,6 +133,7 @@
+
@@ -484,6 +485,7 @@
+
diff --git a/SGGL/BLL/BaseInfo/MaterialUnitService.cs b/SGGL/BLL/BaseInfo/MaterialUnitService.cs
new file mode 100644
index 00000000..ebbb0f9f
--- /dev/null
+++ b/SGGL/BLL/BaseInfo/MaterialUnitService.cs
@@ -0,0 +1,137 @@
+namespace BLL;
+using System.Collections.Generic;
+using System.Linq;
+public class MaterialUnitService
+{
+ ///
+ /// 根据主键获取信息
+ ///
+ ///
+ ///
+ public static Model.Base_MaterialUnit GetMaterialUnitById(string materialUnitId)
+ {
+ return Funs.DB.Base_MaterialUnit.FirstOrDefault(e => e.MaterialUnitId == materialUnitId);
+ }
+
+ ///
+ /// 根据名称获取信息
+ ///
+ ///
+ ///
+ public static Model.Base_MaterialUnit GetMaterialUnitByName(string materialUnitName)
+ {
+ return Funs.DB.Base_MaterialUnit.FirstOrDefault(e => e.MaterialUnitName == materialUnitName);
+ }
+
+ #region 根据职称ID得到职称名称
+ ///
+ /// 根据职称ID得到职称名称
+ ///
+ ///
+ ///
+ public static string GetMaterialUnitNameById(string MaterialUnitId)
+ {
+ string MaterialUnitName = string.Empty;
+ if (!string.IsNullOrEmpty(MaterialUnitId))
+ {
+ var q = GetMaterialUnitById(MaterialUnitId);
+ if (q != null)
+ {
+ MaterialUnitName = q.MaterialUnitName;
+ }
+ }
+
+ return MaterialUnitName;
+ }
+ #endregion
+
+ ///
+ /// 添加职称信息
+ ///
+ ///
+ public static void AddMaterialUnit(Model.Base_MaterialUnit postTitle)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Base_MaterialUnit newMaterialUnit = new Model.Base_MaterialUnit
+ {
+ MaterialUnitId = postTitle.MaterialUnitId,
+ MaterialUnitCode = postTitle.MaterialUnitCode,
+ MaterialUnitName = postTitle.MaterialUnitName,
+ Remark = postTitle.Remark
+ };
+
+ db.Base_MaterialUnit.InsertOnSubmit(newMaterialUnit);
+ db.SubmitChanges();
+ }
+
+ ///
+ /// 修改职称信息
+ ///
+ ///
+ public static void UpdateMaterialUnit(Model.Base_MaterialUnit postTitle)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Base_MaterialUnit newMaterialUnit = db.Base_MaterialUnit.FirstOrDefault(e => e.MaterialUnitId == postTitle.MaterialUnitId);
+ if (newMaterialUnit != null)
+ {
+ newMaterialUnit.MaterialUnitCode = postTitle.MaterialUnitCode;
+ newMaterialUnit.MaterialUnitName = postTitle.MaterialUnitName;
+ newMaterialUnit.Remark = postTitle.Remark;
+ db.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 根据职称主键删除对应职称信息
+ ///
+ ///
+ public static void DeleteMaterialUnitById(string materialUnitId)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Base_MaterialUnit postTitle = db.Base_MaterialUnit.FirstOrDefault(e => e.MaterialUnitId == materialUnitId);
+ {
+ db.Base_MaterialUnit.DeleteOnSubmit(postTitle);
+ db.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 获取类别下拉项
+ ///
+ ///
+ public static List GetMaterialUnitList()
+ {
+ var list = (from x in Funs.DB.Base_MaterialUnit orderby x.MaterialUnitCode select x).ToList();
+ return list;
+ }
+
+ ///
+ /// 获取职称下拉选项
+ ///
+ ///
+ public static List GetMaterialUnitDropDownList()
+ {
+ var list = (from x in Funs.DB.Base_MaterialUnit orderby x.MaterialUnitCode select x).ToList();
+ return list;
+ }
+
+ #region 表下拉框
+ ///
+ /// 表下拉框
+ ///
+ /// 下拉框名字
+ /// 是否显示请选择
+ public static void InitMaterialUnitDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
+ {
+ dropName.DataValueField = "MaterialUnitId";
+ dropName.DataTextField = "MaterialUnitName";
+ dropName.DataSource = BLL.MaterialUnitService.GetMaterialUnitList();
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+ #endregion
+
+}
\ No newline at end of file
diff --git a/SGGL/BLL/HSSE/InApproveManager/MaterialInAndOutRecordService.cs b/SGGL/BLL/HSSE/InApproveManager/MaterialInAndOutRecordService.cs
new file mode 100644
index 00000000..92448bfb
--- /dev/null
+++ b/SGGL/BLL/HSSE/InApproveManager/MaterialInAndOutRecordService.cs
@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace BLL
+{
+ public class MaterialInAndOutRecordService
+ {
+ ///
+ /// 根据主键获取物资进出记录
+ ///
+ ///
+ ///
+ public static Model.MaterialInAndOutRecord GetMaterialInAndOutRecordById(string id)
+ {
+ return Funs.DB.MaterialInAndOutRecord.FirstOrDefault(e => e.Id == id);
+ }
+
+ ///
+ /// 添加物资进出记录
+ ///
+ ///
+ public static void AddMaterialInAndOutRecord(Model.MaterialInAndOutRecord materialInAndOutRecord)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.MaterialInAndOutRecord newMaterialInAndOutRecord =
+ new Model.MaterialInAndOutRecord
+ {
+ Id = materialInAndOutRecord.Id,
+ ProjectId = materialInAndOutRecord.ProjectId,
+ GoodsCategoryId = materialInAndOutRecord.GoodsCategoryId,
+ GoodsCategoryName = materialInAndOutRecord.GoodsCategoryName,
+ MaterialModel = materialInAndOutRecord.MaterialModel,
+ InOutDate = materialInAndOutRecord.InOutDate,
+ UnitId = materialInAndOutRecord.UnitId,
+ InOrOut = materialInAndOutRecord.InOrOut,
+ Number = materialInAndOutRecord.Number,
+ MaterialUnitId = materialInAndOutRecord.MaterialUnitId,
+ Remark = materialInAndOutRecord.Remark,
+ CompileMan = materialInAndOutRecord.CompileMan,
+ CompileDate = materialInAndOutRecord.CompileDate
+ };
+ db.MaterialInAndOutRecord.InsertOnSubmit(newMaterialInAndOutRecord);
+ db.SubmitChanges();
+ }
+
+ ///
+ /// 修改物资进出记录
+ ///
+ ///
+ public static void UpdateMaterialInAndOutRecord(Model.MaterialInAndOutRecord materialInAndOutRecord)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.MaterialInAndOutRecord newMaterialInAndOutRecord =
+ db.MaterialInAndOutRecord.FirstOrDefault(e => e.Id == materialInAndOutRecord.Id);
+ if (newMaterialInAndOutRecord != null)
+ {
+ newMaterialInAndOutRecord.GoodsCategoryId = materialInAndOutRecord.GoodsCategoryId;
+ newMaterialInAndOutRecord.GoodsCategoryName = materialInAndOutRecord.GoodsCategoryName;
+ newMaterialInAndOutRecord.MaterialModel = materialInAndOutRecord.MaterialModel;
+ newMaterialInAndOutRecord.InOutDate = materialInAndOutRecord.InOutDate;
+ newMaterialInAndOutRecord.UnitId = materialInAndOutRecord.UnitId;
+ newMaterialInAndOutRecord.InOrOut = materialInAndOutRecord.InOrOut;
+ newMaterialInAndOutRecord.Number = materialInAndOutRecord.Number;
+ newMaterialInAndOutRecord.MaterialUnitId = materialInAndOutRecord.MaterialUnitId;
+ newMaterialInAndOutRecord.Remark = materialInAndOutRecord.Remark;
+ newMaterialInAndOutRecord.CompileMan = materialInAndOutRecord.CompileMan;
+ newMaterialInAndOutRecord.CompileDate = materialInAndOutRecord.CompileDate;
+ db.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 根据主键删除物资进出记录
+ ///
+ ///
+ public static void DeleteMaterialInAndOutRecordById(string id)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.MaterialInAndOutRecord materialInAndOutRecord =
+ db.MaterialInAndOutRecord.FirstOrDefault(e => e.Id == id);
+ if (materialInAndOutRecord != null)
+ {
+ CodeRecordsService.DeleteCodeRecordsByDataId(id); //删除编号
+ CommonService.DeleteAttachFileById(id); //删除附件
+ db.MaterialInAndOutRecord.DeleteOnSubmit(materialInAndOutRecord);
+ db.SubmitChanges();
+ }
+ }
+
+
+ ///
+ /// 取物资进出记录列表
+ ///
+ ///
+ public static IEnumerable GetMaterialInAndOutRecordList()
+ {
+ var result = (from record in Funs.DB.MaterialInAndOutRecord
+ join materialUnit in Funs.DB.Base_MaterialUnit on record.MaterialUnitId equals materialUnit
+ .MaterialUnitId into MaterialUnitGroup
+ from materialUnit in MaterialUnitGroup.DefaultIfEmpty()
+ join unit in Funs.DB.Base_Unit on record.UnitId equals unit.UnitId into UnitGroup
+ from unit in UnitGroup.DefaultIfEmpty()
+ join users in Funs.DB.Sys_User on record.CompileMan equals users.UserId into UsersGroup
+ from users in UsersGroup.DefaultIfEmpty()
+ select new
+ {
+ record.Id,
+ record.ProjectId,
+ record.GoodsCategoryId,
+ record.GoodsCategoryName,
+ record.MaterialModel,
+ record.InOutDate,
+ record.InOrOut,
+ record.Number,
+ record.Remark,
+ record.UnitId,
+ record.CompileMan,
+ record.CompileDate,
+ record.MaterialUnitId,
+ MaterialUnitName = materialUnit != null ? materialUnit.MaterialUnitName : null,
+ UnitName = unit != null ? unit.UnitName : null,
+ CompileManName = users != null ? users.UserName : null
+ }
+ ).OrderByDescending(x => x.InOutDate).ToList();
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx
new file mode 100644
index 00000000..3a03c863
--- /dev/null
+++ b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx
@@ -0,0 +1,156 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaterialUnit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.MaterialUnit" %>
+
+
+
+
+
+ 物资单位信息
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.cs
new file mode 100644
index 00000000..4523add2
--- /dev/null
+++ b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.cs
@@ -0,0 +1,284 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using BLL;
+
+namespace FineUIPro.Web.BaseInfo
+{
+ public partial class MaterialUnit : PageBase
+ {
+ #region 加载页面
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ ////权限按钮方法
+ this.GetButtonPower();
+ Funs.DropDownPageSize(this.ddlPageSize);
+ ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+ // 绑定表格
+ BindGrid();
+ }
+ }
+
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+ var q = from x in Funs.DB.Base_MaterialUnit orderby x.MaterialUnitCode select x;
+ Grid1.RecordCount = q.Count();
+ // 2.获取当前分页数据
+ var table = GetPagedDataTable(Grid1.PageIndex, Grid1.PageSize);
+ Grid1.DataSource = table;
+ Grid1.DataBind();
+ }
+
+ ///
+ /// 分页
+ ///
+ ///
+ private List GetPagedDataTable(int pageIndex, int pageSize)
+ {
+ List source =
+ (from x in Funs.DB.Base_MaterialUnit orderby x.MaterialUnitCode select x).ToList();
+ List paged = new List();
+
+ int rowbegin = pageIndex * pageSize;
+ int rowend = (pageIndex + 1) * pageSize;
+ if (rowend > source.Count())
+ {
+ rowend = source.Count();
+ }
+
+ for (int i = rowbegin; i < rowend; i++)
+ {
+ paged.Add(source[i]);
+ }
+
+ return paged;
+ }
+
+ ///
+ /// 改变索引事件
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+ ///
+ /// 分页下拉选择
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+
+ ///
+ /// 过滤表头
+ ///
+ ///
+ ///
+ protected void Grid1_FilterChange(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ #endregion
+
+ #region 删除
+
+ ///
+ /// 删除
+ ///
+ ///
+ ///
+ protected void btnDelete_Click(object sender, EventArgs e)
+ {
+ BLL.LogService.AddSys_Log(this.CurrUser, this.txtMaterialUnitCode.Text, hfFormID.Text,
+ BLL.Const.MaterialUnitMenuId, BLL.Const.BtnDelete);
+ BLL.MaterialUnitService.DeleteMaterialUnitById(hfFormID.Text);
+
+ // 重新绑定表格,并模拟点击[新增按钮]
+ BindGrid();
+ PageContext.RegisterStartupScript("onNewButtonClick();");
+ }
+
+ ///
+ /// 右键删除事件
+ ///
+ ///
+ ///
+ protected void btnMenuDelete_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+
+ var getV = BLL.MaterialUnitService.GetMaterialUnitById(rowID);
+ if (getV != null)
+ {
+ BLL.LogService.AddSys_Log(this.CurrUser, getV.MaterialUnitCode, getV.MaterialUnitId,
+ BLL.Const.MaterialUnitMenuId, BLL.Const.BtnDelete);
+ BLL.MaterialUnitService.DeleteMaterialUnitById(rowID);
+ }
+ }
+
+ BindGrid();
+ PageContext.RegisterStartupScript("onNewButtonClick();");
+ }
+ }
+
+ #endregion
+
+ #region 编辑
+
+ ///
+ /// 右键编辑事件
+ ///
+ ///
+ ///
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!");
+ return;
+ }
+
+ string Id = Grid1.SelectedRowID;
+ var materialUnit = BLL.MaterialUnitService.GetMaterialUnitById(Id);
+ if (materialUnit != null)
+ {
+ this.txtMaterialUnitCode.Text = materialUnit.MaterialUnitCode;
+ this.txtMaterialUnitName.Text = materialUnit.MaterialUnitName;
+ this.txtRemark.Text = materialUnit.Remark;
+ hfFormID.Text = Id;
+ this.btnDelete.Enabled = true;
+ }
+ }
+
+ #endregion
+
+ #region 保存
+
+ ///
+ /// 保存按钮
+ ///
+ ///
+ ///
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ string strRowID = hfFormID.Text;
+ Model.Base_MaterialUnit newMaterialUnit = new Model.Base_MaterialUnit
+ {
+ MaterialUnitCode = this.txtMaterialUnitCode.Text.Trim(),
+ MaterialUnitName = this.txtMaterialUnitName.Text.Trim(),
+ Remark = txtRemark.Text.Trim()
+ };
+ if (string.IsNullOrEmpty(strRowID))
+ {
+ newMaterialUnit.MaterialUnitId = SQLHelper.GetNewID(typeof(Model.Base_MaterialUnit));
+ BLL.MaterialUnitService.AddMaterialUnit(newMaterialUnit);
+ BLL.LogService.AddSys_Log(this.CurrUser, newMaterialUnit.MaterialUnitCode,
+ newMaterialUnit.MaterialUnitId, BLL.Const.MaterialUnitMenuId, BLL.Const.BtnAdd);
+ }
+ else
+ {
+ newMaterialUnit.MaterialUnitId = strRowID;
+ BLL.MaterialUnitService.UpdateMaterialUnit(newMaterialUnit);
+ BLL.LogService.AddSys_Log(this.CurrUser, newMaterialUnit.MaterialUnitCode,
+ newMaterialUnit.MaterialUnitId, BLL.Const.MaterialUnitMenuId, BLL.Const.BtnModify);
+ }
+
+ this.SimpleForm1.Reset();
+ // 重新绑定表格,并点击当前编辑或者新增的行
+ BindGrid();
+ PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID,
+ newMaterialUnit.MaterialUnitId));
+ }
+
+ #endregion
+
+ #region 验证职称信息名称、编号是否存在
+
+ ///
+ /// 验证职称信息名称、编号是否存在
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ var q = Funs.DB.Base_MaterialUnit.FirstOrDefault(x =>
+ x.MaterialUnitCode == this.txtMaterialUnitCode.Text.Trim() && (x.MaterialUnitId != hfFormID.Text ||
+ (hfFormID.Text == null &&
+ x.MaterialUnitId != null)));
+ if (q != null)
+ {
+ ShowNotify("输入的职称编号已存在!", MessageBoxIcon.Warning);
+ }
+
+ var q2 = Funs.DB.Base_MaterialUnit.FirstOrDefault(x =>
+ x.MaterialUnitName == this.txtMaterialUnitName.Text.Trim() && (x.MaterialUnitId != hfFormID.Text ||
+ (hfFormID.Text == null &&
+ x.MaterialUnitId != null)));
+ if (q2 != null)
+ {
+ ShowNotify("输入的职称名称已存在!", MessageBoxIcon.Warning);
+ }
+ }
+
+ #endregion
+
+ #region 获取按钮权限
+
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId,
+ BLL.Const.MaterialUnitMenuId);
+ 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.btnDelete.Hidden = false;
+ this.btnMenuDelete.Hidden = false;
+ }
+
+ if (buttonList.Contains(BLL.Const.BtnSave))
+ {
+ this.btnSave.Hidden = false;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.designer.cs
new file mode 100644
index 00000000..54c19b78
--- /dev/null
+++ b/SGGL/FineUIPro.Web/BaseInfo/MaterialUnit.aspx.designer.cs
@@ -0,0 +1,206 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.BaseInfo
+{
+
+
+ public partial class MaterialUnit
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// Label1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.SimpleForm SimpleForm1;
+
+ ///
+ /// hfFormID 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox hfFormID;
+
+ ///
+ /// txtMaterialUnitCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtMaterialUnitCode;
+
+ ///
+ /// txtMaterialUnitName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtMaterialUnitName;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRemark;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// btnDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDelete;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// 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/RewardAndPunishManager.aspx b/SGGL/FineUIPro.Web/BaseInfo/RewardAndPunishManager.aspx
index 603f8ba4..d41536ed 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/RewardAndPunishManager.aspx
+++ b/SGGL/FineUIPro.Web/BaseInfo/RewardAndPunishManager.aspx
@@ -1,97 +1,98 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RewardAndPunishManager.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.RewardAndPunishManager" %>
+
+
-
奖罚类别维护
-
+
-
-
+
-
+