From 50cdaae27ade14fe601814e8cc0f063c25cdd5fe Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Tue, 21 Mar 2023 19:22:45 +0800 Subject: [PATCH] =?UTF-8?q?2023-03-21=20=E8=B4=A8=E9=87=8F=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E5=A2=9E=E5=8A=A0=E5=8F=AF=E7=BC=96=E8=BE=91=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E8=B5=84=E6=96=99=E9=AA=8C=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-03-21.sql | 70 ++++ .../1-2质量管理(Menu_CQMS).sql | 19 +- SGGL/BLL/BLL.csproj | 1 + .../BLL/CQMS/Check/CheckMaterialacceptance.cs | 146 ++++++++ SGGL/BLL/Common/Const.cs | 5 + .../AttachFile/EditOffice.aspx.cs | 6 + .../CQMS/Check/MaterialAcceptance.aspx | 118 +++++++ .../CQMS/Check/MaterialAcceptance.aspx.cs | 287 +++++++++++++++ .../Check/MaterialAcceptance.aspx.designer.cs | 161 +++++++++ .../CQMS/Check/MaterialAcceptanceEdit.aspx | 95 +++++ .../CQMS/Check/MaterialAcceptanceEdit.aspx.cs | 307 ++++++++++++++++ .../MaterialAcceptanceEdit.aspx.designer.cs | 188 ++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 + SGGL/FineUIPro.Web/common/Menu_CQMS.xml | 1 + SGGL/Model/Model.cs | 330 +++++++++++++++++- 15 files changed, 1737 insertions(+), 13 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-03-21.sql create mode 100644 SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-03-21.sql b/DataBase/版本日志/SGGLDB_V2023-03-21.sql new file mode 100644 index 00000000..371142a6 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-03-21.sql @@ -0,0 +1,70 @@ + +/****** Object: Table [dbo].[Check_MaterialAcceptance] Script Date: 2023/3/21 18:04:29 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[Check_MaterialAcceptance]( + [MaterialAcceptanceId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [PlanCode] [nvarchar](50) NULL, + [FileName] [nvarchar](50) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [State] [char](1) NULL, + [FilePath] [varchar](200) NULL, + CONSTRAINT [PK_Check_MaterialAcceptance] PRIMARY KEY CLUSTERED +( + [MaterialAcceptanceId] 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 + +SET ANSI_PADDING OFF +GO + + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance', @level2type=N'COLUMN',@level2name=N'[MaterialAcceptanceId]' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance', @level2type=N'COLUMN',@level2name=N'PlanCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ļ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance', @level2type=N'COLUMN',@level2name=N'FileName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance', @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'Check_MaterialAcceptance', @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'Check_MaterialAcceptance', @level2type=N'COLUMN',@level2name=N'State' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ձ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Check_MaterialAcceptance' +GO + +delete from Sys_Menu where MenuId='8317C0F7-3A69-48AB-87E5-03E96C543B1C' +delete from Sys_ButtonToMenu where MenuId='8317C0F7-3A69-48AB-87E5-03E96C543B1C' +go +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('0B17549C-2749-4255-BFF4-574902E878FA','','CQMS/Check/MaterialAcceptance.aspx',20,'B8500D87-407E-458C-9915-FD54F0E81F36','Menu_CQMS',0,1,1) +GO +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('00B413F9-1BB9-4F56-8952-D661716E9EF2','0B17549C-2749-4255-BFF4-574902E878FA','',1) +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('419D13BE-438D-450B-92AE-2737B571A4F1','0B17549C-2749-4255-BFF4-574902E878FA','޸',2) +GO +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('88813BE-438D-450B-92AE-2737B571A4F1','0B17549C-2749-4255-BFF4-574902E878FA','ɾ',3) +GO diff --git a/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql b/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql index 213266e3..7d1369b0 100644 --- a/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql +++ b/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql @@ -327,13 +327,26 @@ INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('5B1DCDDD-344E-4BD3-8660-E816D5EF9E1E','CC43E208-335D-4AE3-A1CE-B2D8510AE854','提交',5) GO +--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +--VALUES('8317C0F7-3A69-48AB-87E5-03E96C543B1C','资料验收','CQMS/Check/SpotDataCheck.aspx',20,'B8500D87-407E-458C-9915-FD54F0E81F36','Menu_CQMS',0,1,1) +--GO +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('9EAC9A0F-0E2E-4650-8318-3C9BC5EFC35D','8317C0F7-3A69-48AB-87E5-03E96C543B1C','保存',1) +--INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +--VALUES('BDAFA160-FC9D-4B2C-A887-178453E945FE','8317C0F7-3A69-48AB-87E5-03E96C543B1C','提交',2) +--GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('8317C0F7-3A69-48AB-87E5-03E96C543B1C','资料验收','CQMS/Check/SpotDataCheck.aspx',20,'B8500D87-407E-458C-9915-FD54F0E81F36','Menu_CQMS',0,1,1) +VALUES('0B17549C-2749-4255-BFF4-574902E878FA','资料验收','CQMS/Check/MaterialAcceptance.aspx',20,'B8500D87-407E-458C-9915-FD54F0E81F36','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('9EAC9A0F-0E2E-4650-8318-3C9BC5EFC35D','8317C0F7-3A69-48AB-87E5-03E96C543B1C','保存',1) +VALUES('00B413F9-1BB9-4F56-8952-D661716E9EF2','0B17549C-2749-4255-BFF4-574902E878FA','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) -VALUES('BDAFA160-FC9D-4B2C-A887-178453E945FE','8317C0F7-3A69-48AB-87E5-03E96C543B1C','提交',2) +VALUES('419D13BE-438D-450B-92AE-2737B571A4F1','0B17549C-2749-4255-BFF4-574902E878FA','修改',2) +GO +INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +VALUES('88813BE-438D-450B-92AE-2737B571A4F1','0B17549C-2749-4255-BFF4-574902E878FA','删除',3) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 35868507..a5c311ea 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -266,6 +266,7 @@ + diff --git a/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs b/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs new file mode 100644 index 00000000..bb25fb33 --- /dev/null +++ b/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs @@ -0,0 +1,146 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class CheckMaterialacceptanceService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetCheck_MaterialAcceptanceByModle(Model.Check_MaterialAcceptance table) + { + var q = from x in db.Check_MaterialAcceptance + where + (string.IsNullOrEmpty(table.MaterialAcceptanceId) || x.MaterialAcceptanceId.Contains(table.MaterialAcceptanceId)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.PlanCode) || x.PlanCode.Contains(table.PlanCode)) && + (string.IsNullOrEmpty(table.FileName) || x.FileName.Contains(table.FileName)) && + (string.IsNullOrEmpty(table.CompileMan) || x.CompileMan.Contains(table.CompileMan)) && + (string.IsNullOrEmpty(table.State) || x.State.Contains(table.State)) && + (string.IsNullOrEmpty(table.FilePath) || x.FilePath.Contains(table.FilePath)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Check_MaterialAcceptance table, Grid Grid1) + { + var q = GetCheck_MaterialAcceptanceByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.MaterialAcceptanceId, + x.ProjectId, + x.PlanCode, + x.FileName, + x.CompileMan, + x.CompileDate, + x.State, + x.FilePath, + + }; + } + #endregion + + public static Model.Check_MaterialAcceptance GetCheck_MaterialAcceptanceById(string MaterialAcceptanceId) + { + return db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); + } + + + public static void AddCheck_MaterialAcceptance(Model.Check_MaterialAcceptance newtable) + { + + Model.Check_MaterialAcceptance table = new Model.Check_MaterialAcceptance + { + MaterialAcceptanceId = newtable.MaterialAcceptanceId, + ProjectId = newtable.ProjectId, + PlanCode = newtable.PlanCode, + FileName = newtable.FileName, + CompileMan = newtable.CompileMan, + CompileDate = newtable.CompileDate, + State = newtable.State, + FilePath = newtable.FilePath, + }; + db.Check_MaterialAcceptance.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkCheck_MaterialAcceptance(List newtables) + { + + db.Check_MaterialAcceptance.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateCheck_MaterialAcceptance(Model.Check_MaterialAcceptance newtable) + { + + Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == newtable.MaterialAcceptanceId); + if (table != null) + { + table.MaterialAcceptanceId = newtable.MaterialAcceptanceId; + table.ProjectId = newtable.ProjectId; + table.PlanCode = newtable.PlanCode; + table.FileName = newtable.FileName; + table.CompileMan = newtable.CompileMan; + table.CompileDate = newtable.CompileDate; + table.State = newtable.State; + table.FilePath = newtable.FilePath; + db.SubmitChanges(); + } + + } + public static void DeleteCheck_MaterialAcceptanceById(string MaterialAcceptanceId) + { + + Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); + if (table != null) + { + db.Check_MaterialAcceptance.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLCheck_MaterialAcceptance() + { + if (db.Check_MaterialAcceptance != null) + { + db.Check_MaterialAcceptance.DeleteAllOnSubmit(db.Check_MaterialAcceptance); + db.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 4f87c5e9..98f01b47 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3423,6 +3423,11 @@ /// 工序资料记录 /// public const string SpotDataCheckMenuId = "8317C0F7-3A69-48AB-87E5-03E96C543B1C"; + /// + /// 资料验收 + /// + public const string CheckMaterialacceptanceMenuId = "0B17549C-2749-4255-BFF4-574902E878FA"; + #endregion #region 人员管理 diff --git a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs index 49a69429..6f66a015 100644 --- a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs +++ b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs @@ -40,6 +40,12 @@ namespace WordEdit string filepath = model.FilePath; url = Funs.SGGLUrl + filepath; } + else if (a[1]== "CQMS_Check_MaterialAcceptance") + { + var model = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(a[0]); + string filepath = model.FilePath; + url = Funs.SGGLUrl + filepath; + } } diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx new file mode 100644 index 00000000..d76a81fa --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx @@ -0,0 +1,118 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaterialAcceptance.aspx.cs" Inherits="FineUIPro.Web.CQMS.Check.MaterialAcceptance" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.cs new file mode 100644 index 00000000..d6093ea3 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.cs @@ -0,0 +1,287 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Check +{ + public partial class MaterialAcceptance : PageBase + { + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + + // 表头过滤 + //FilterDataRowItem = FilterDataRowItemImplement; + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + //权限按钮方法 + GetButtonPower(); + btnNew.OnClientClick = Window1.GetShowReference("MaterialAcceptanceEdit.aspx") + "return false;"; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + } + } + #endregion + + protected DataTable insklistData() + { + string strSql = @"SELECT ins.MaterialAcceptanceId,ins.PlanCode,ins.ProjectId,ins.FileName," + + @" ins.CompileDate,ins.State," + + @" u.PersonName as CompileManName" + + @" FROM Check_MaterialAcceptance ins" + + @" left join Person_Persons u on u.PersonId = ins.CompileMan" + + @" where ins.ProjectId=@ProjectId"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + /// + /// 绑定数据 + /// + + public void BindGrid() + { + DataTable tb = insklistData(); + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 过滤表头、排序、分页、关闭窗口 + /// + /// 过滤表头 + /// + /// + /// + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + //Grid1.SortDirection = e.SortDirection; + //Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + string str = this.hdID.Text; + if (!string.IsNullOrEmpty(str)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialAcceptanceEdit.aspx?MaterialAcceptanceId={0}", str, "查看 - "))); + } + this.hdID.Text = string.Empty; + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuModify_Click(null, null); + } + #endregion + #region 编辑 + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var ins = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(id); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialAcceptanceEdit.aspx?MaterialAcceptanceId={0}", ins.MaterialAcceptanceId, "查看 - "))); + + + } + + #endregion + + #region 删除 + /// + /// 批量删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var ins = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(id); + if (File.Exists(Funs.RootPath + ins.FilePath)) + { + File.Delete(Funs.RootPath + ins.FilePath); + + } + ////删除附件表 + BLL.CommonService.DeleteAttachFileById(id); + BLL.CheckMaterialacceptanceService.DeleteCheck_MaterialAcceptanceById(id); + BLL.LogService.AddSys_Log(this.CurrUser, ins.PlanCode, id, BLL.Const.CheckMaterialacceptanceMenuId, "删除验收资料"); + Grid1.DataBind(); + BindGrid(); + Alert.ShowInTop("删除数据成功!", MessageBoxIcon.Success); + } + #endregion + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.PersonId, BLL.Const.CheckMaterialacceptanceMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.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 Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + + } + + + protected void btnQuery_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void btnRset_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void imgBtnFile_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMS_Check_MaterialAcceptance", Grid1.SelectedRowID, "查看 -"))); + PageContext.RegisterStartupScript(Window1.GetHideReference()); + + } + else + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.designer.cs new file mode 100644 index 00000000..fb682f27 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptance.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Check +{ + + + public partial class MaterialAcceptance + { + + /// + /// 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; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdID; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// imgBtnFile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgBtnFile; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// 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; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx new file mode 100644 index 00000000..2d3b9316 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx @@ -0,0 +1,95 @@ + +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaterialAcceptanceEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Check.MaterialAcceptanceEdit" %> + + + + + + 材料验收 + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.cs new file mode 100644 index 00000000..28798414 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.cs @@ -0,0 +1,307 @@ +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.CQMS.Check +{ + public partial class MaterialAcceptanceEdit : PageBase + { + /// + /// 主键 + /// + public string MaterialAcceptanceId + { + get + { + return (string)ViewState["MaterialAcceptanceId"]; + } + set + { + ViewState["MaterialAcceptanceId"] = value; + } + } + + + /// + /// 办理类型 + /// + public string State + { + get + { + return (string)ViewState["State"]; + } + set + { + ViewState["State"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + MaterialAcceptanceId = Request.Params["MaterialAcceptanceId"]; + BLL.Base_CompanytemplateService.InitBase_CompanyTemplateDownList(drpCompanyTemplate, true); + IsHiddendrpCompanyTemplate(); + if (!string.IsNullOrEmpty(MaterialAcceptanceId)) + { + var MainPlan = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(MaterialAcceptanceId); + hdId.Text = this.MaterialAcceptanceId; + txtPlanCode.Text = MainPlan.PlanCode; + txtFileName.Text = MainPlan.FileName; + + + } + else + { + string prefix = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId) + "-ZLYS-"; + txtPlanCode.Text = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "Check_MaterialAcceptance", "PlanCode", this.CurrUser.LoginProjectId, prefix); + txtFileName.Text = "材料验收"; + } + } + } + + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + + } + + protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) + { + + } + + /// + /// 时间转换 + /// + /// + /// + public string ConvertDate(object date) + { + if (date != null) + { + return string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(date)); + } + else + { + return null; + } + } + + protected void imgBtnFile_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(hdId.Text)) + { + hdId.Text = SQLHelper.GetNewID(); + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=1&toKeyId={0}&path=FileUpload/CQMS/Plan&menuId={1}", hdId.Text, BLL.Const.CheckMaterialacceptanceMenuId))); + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (validate()) + { + SaveMainPlan("save"); + } + } + + /// + /// 保存 + /// + public void SaveMainPlan(string saveType) + { + Model.Check_MaterialAcceptance MaterialAcceptance = new Model.Check_MaterialAcceptance(); + MaterialAcceptance.ProjectId = this.CurrUser.LoginProjectId; + MaterialAcceptance.PlanCode = this.txtPlanCode.Text.Trim(); + MaterialAcceptance.FileName = this.txtFileName.Text.Trim(); + MaterialAcceptance.FilePath = "FileUpload/CQMS_Check_MaterialAcceptance/" + txtPlanCode.Text + ".doc"; + + if (!string.IsNullOrEmpty(MaterialAcceptanceId)) + { + MaterialAcceptance.MaterialAcceptanceId = MaterialAcceptanceId; + CheckMaterialacceptanceService.UpdateCheck_MaterialAcceptance(MaterialAcceptance); + + } + else + { + if (string.IsNullOrEmpty(hdId.Text)) + { + MaterialAcceptance.MaterialAcceptanceId = SQLHelper.GetNewID(); + hdId.Text = MaterialAcceptance.MaterialAcceptanceId; + MaterialAcceptanceId = MaterialAcceptance.MaterialAcceptanceId; + } + else + { + MaterialAcceptance.MaterialAcceptanceId = hdId.Text; + MaterialAcceptanceId = hdId.Text; + } + MaterialAcceptance.CompileMan = this.CurrUser.PersonId; + MaterialAcceptance.CompileDate = DateTime.Now; + CheckMaterialacceptanceService.AddCheck_MaterialAcceptance(MaterialAcceptance); + + } + LogService.AddSys_Log(CurrUser, MaterialAcceptance.PlanCode, MaterialAcceptance.MaterialAcceptanceId, Const.CheckMaterialacceptanceMenuId, "修改总包施工质量计划"); + if (saveType == "submit") + { + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + + } + } + /// + /// 表格数据验证 + /// + private bool validate() + { + bool res = false; + string err = string.Empty; + var att = BLL.AttachFileService.GetAttachFileByToKeyId(this.hdId.Text); + if (att == null) + { + err += "请上传文件!"; + } + if (!string.IsNullOrWhiteSpace(err)) + { + Alert.ShowInTop(err, MessageBoxIcon.Warning); + } + else + { + res = true; + } + return res; + } + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (validate()) + { + + SaveMainPlan("submit"); + + } + + } + + private string GetStringByArray(string[] array) + { + string str = string.Empty; + foreach (var item in array) + { + if (item != BLL.Const._Null) + { + str += item + ","; + } + } + if (!string.IsNullOrEmpty(str)) + { + str = str.Substring(0, str.LastIndexOf(",")); + } + return str; + } + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + string rootPath = Funs.RootPath; + var model = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(MaterialAcceptanceId); + 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}|CQMS_Check_MaterialAcceptance", MaterialAcceptanceId, "查看 -"))); + PageContext.RegisterStartupScript(WindowAtt.GetHideReference()); + } + private void GetCompanyTemplate() + { + string rootPath = Funs.RootPath; + var model = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(MaterialAcceptanceId); + 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); + + + } + else + { + ShowNotify("请选择模板", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMS_Check_MaterialAcceptance", MaterialAcceptanceId, "查看 -"))); + PageContext.RegisterStartupScript(WindowAtt.GetHideReference()); + + } + /// + /// 是否隐藏选择模板 + /// + protected void IsHiddendrpCompanyTemplate() + { + if (!string.IsNullOrEmpty(MaterialAcceptanceId)) + { + Model.Check_MaterialAcceptance Materialacceptance = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(MaterialAcceptanceId); + if (!File.Exists(Funs.RootPath + Materialacceptance.FilePath)) + { + + drpCompanyTemplate.Hidden = false; + } + + } + else + { + drpCompanyTemplate.Hidden = false; + } + + + } + protected void btnEditWord_Click(object sender, EventArgs e) + { + + if (!string.IsNullOrEmpty(MaterialAcceptanceId)) + { + Model.Check_MaterialAcceptance Materialacceptance = BLL.CheckMaterialacceptanceService.GetCheck_MaterialAcceptanceById(MaterialAcceptanceId); + if (!File.Exists(Funs.RootPath + Materialacceptance.FilePath)) + { + GetCompanyTemplate(); + //PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?", + // String.Empty, + // MessageBoxIcon.Question, + // PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求 + // PageManager1.GetCustomEventReference("No"))); + } + else + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMS_Check_MaterialAcceptance", MaterialAcceptanceId, "查看 -"))); + PageContext.RegisterStartupScript(WindowAtt.GetHideReference()); + + } + } + else + { + SaveMainPlan("save"); + GetCompanyTemplate(); + } + //PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -"))); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.designer.cs new file mode 100644 index 00000000..b5dfc994 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Check/MaterialAcceptanceEdit.aspx.designer.cs @@ -0,0 +1,188 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Check +{ + + + public partial class MaterialAcceptanceEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ContentPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel2; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtPlanCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPlanCode; + + /// + /// txtFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtFileName; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// imgBtnFile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgBtnFile; + + /// + /// drpCompanyTemplate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCompanyTemplate; + + /// + /// btnEditWord 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEditWord; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 8f76add5..a04d6814 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -343,6 +343,8 @@ + + @@ -6398,6 +6400,20 @@ JointCheckView.aspx + + MaterialAcceptance.aspx + ASPXCodeBehind + + + MaterialAcceptance.aspx + + + MaterialAcceptanceEdit.aspx + ASPXCodeBehind + + + MaterialAcceptanceEdit.aspx + ShowWBS.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index a090e6ed..23ba0c8e 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -35,6 +35,7 @@ + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index efe6acf7..e392372a 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -299,6 +299,9 @@ namespace Model partial void InsertCheck_JointCheckDetail(Check_JointCheckDetail instance); partial void UpdateCheck_JointCheckDetail(Check_JointCheckDetail instance); partial void DeleteCheck_JointCheckDetail(Check_JointCheckDetail instance); + partial void InsertCheck_MaterialAcceptance(Check_MaterialAcceptance instance); + partial void UpdateCheck_MaterialAcceptance(Check_MaterialAcceptance instance); + partial void DeleteCheck_MaterialAcceptance(Check_MaterialAcceptance instance); partial void InsertCheck_MonthDesign(Check_MonthDesign instance); partial void UpdateCheck_MonthDesign(Check_MonthDesign instance); partial void DeleteCheck_MonthDesign(Check_MonthDesign instance); @@ -2254,6 +2257,14 @@ namespace Model } } + public System.Data.Linq.Table Check_MaterialAcceptance + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Check_MonthDesign { get @@ -19679,6 +19690,8 @@ namespace Model private EntitySet _Check_JointCheck; + private EntitySet _Check_MaterialAcceptance; + private EntitySet _Check_PauseNotice; private EntitySet _Check_PunishNotice; @@ -20019,6 +20032,7 @@ namespace Model this._Check_CheckEquipment = new EntitySet(new Action(this.attach_Check_CheckEquipment), new Action(this.detach_Check_CheckEquipment)); this._Check_IncentiveNotice = new EntitySet(new Action(this.attach_Check_IncentiveNotice), new Action(this.detach_Check_IncentiveNotice)); this._Check_JointCheck = new EntitySet(new Action(this.attach_Check_JointCheck), new Action(this.detach_Check_JointCheck)); + this._Check_MaterialAcceptance = new EntitySet(new Action(this.attach_Check_MaterialAcceptance), new Action(this.detach_Check_MaterialAcceptance)); this._Check_PauseNotice = new EntitySet(new Action(this.attach_Check_PauseNotice), new Action(this.detach_Check_PauseNotice)); this._Check_PunishNotice = new EntitySet(new Action(this.attach_Check_PunishNotice), new Action(this.detach_Check_PunishNotice)); this._Check_RectifyNotices = new EntitySet(new Action(this.attach_Check_RectifyNotices), new Action(this.detach_Check_RectifyNotices)); @@ -21095,6 +21109,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_MaterialAcceptance_Base_Project", Storage="_Check_MaterialAcceptance", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet Check_MaterialAcceptance + { + get + { + return this._Check_MaterialAcceptance; + } + set + { + this._Check_MaterialAcceptance.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_PauseNotice_Base_Project", Storage="_Check_PauseNotice", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet Check_PauseNotice { @@ -23028,6 +23055,18 @@ namespace Model entity.Base_Project = null; } + private void attach_Check_MaterialAcceptance(Check_MaterialAcceptance entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_Check_MaterialAcceptance(Check_MaterialAcceptance entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + private void attach_Check_PauseNotice(Check_PauseNotice entity) { this.SendPropertyChanging(); @@ -41902,6 +41941,277 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Check_MaterialAcceptance")] + public partial class Check_MaterialAcceptance : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _MaterialAcceptanceId; + + private string _ProjectId; + + private string _PlanCode; + + private string _FileName; + + private string _CompileMan; + + private System.Nullable _CompileDate; + + private string _State; + + private string _FilePath; + + private EntityRef _Base_Project; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnMaterialAcceptanceIdChanging(string value); + partial void OnMaterialAcceptanceIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnPlanCodeChanging(string value); + partial void OnPlanCodeChanged(); + partial void OnFileNameChanging(string value); + partial void OnFileNameChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + partial void OnStateChanging(string value); + partial void OnStateChanged(); + partial void OnFilePathChanging(string value); + partial void OnFilePathChanged(); + #endregion + + public Check_MaterialAcceptance() + { + this._Base_Project = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialAcceptanceId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string MaterialAcceptanceId + { + get + { + return this._MaterialAcceptanceId; + } + set + { + if ((this._MaterialAcceptanceId != value)) + { + this.OnMaterialAcceptanceIdChanging(value); + this.SendPropertyChanging(); + this._MaterialAcceptanceId = value; + this.SendPropertyChanged("MaterialAcceptanceId"); + this.OnMaterialAcceptanceIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + if (this._Base_Project.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanCode", DbType="NVarChar(50)")] + public string PlanCode + { + get + { + return this._PlanCode; + } + set + { + if ((this._PlanCode != value)) + { + this.OnPlanCodeChanging(value); + this.SendPropertyChanging(); + this._PlanCode = value; + this.SendPropertyChanged("PlanCode"); + this.OnPlanCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileName", DbType="NVarChar(50)")] + public string FileName + { + get + { + return this._FileName; + } + set + { + if ((this._FileName != value)) + { + this.OnFileNameChanging(value); + this.SendPropertyChanging(); + this._FileName = value; + this.SendPropertyChanged("FileName"); + this.OnFileNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="Char(1)")] + public string State + { + get + { + return this._State; + } + set + { + if ((this._State != value)) + { + this.OnStateChanging(value); + this.SendPropertyChanging(); + this._State = value; + this.SendPropertyChanged("State"); + this.OnStateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FilePath", DbType="VarChar(200)")] + public string FilePath + { + get + { + return this._FilePath; + } + set + { + if ((this._FilePath != value)) + { + this.OnFilePathChanging(value); + this.SendPropertyChanging(); + this._FilePath = value; + this.SendPropertyChanged("FilePath"); + this.OnFilePathChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_MaterialAcceptance_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] + public Base_Project Base_Project + { + get + { + return this._Base_Project.Entity; + } + set + { + Base_Project previousValue = this._Base_Project.Entity; + if (((previousValue != value) + || (this._Base_Project.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Project.Entity = null; + previousValue.Check_MaterialAcceptance.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.Check_MaterialAcceptance.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Check_MonthDesign")] public partial class Check_MonthDesign : INotifyPropertyChanging, INotifyPropertyChanged { @@ -74047,7 +74357,7 @@ namespace Model OnCreated(); } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] public string MaterialCode { get @@ -74151,7 +74461,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(3000)")] public string MaterialDef { get @@ -78741,7 +79051,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15)")] public string MaterialCode { get @@ -83089,7 +83399,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] public string CanWelderCode { get @@ -122458,7 +122768,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(100)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(50)")] public string MaterialName { get @@ -122478,7 +122788,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(50)")] public string SpecificationAndModel { get @@ -122498,7 +122808,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(100)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] public string MaterialCode { get @@ -122518,7 +122828,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(100)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(50)")] public string Material { get @@ -181663,7 +181973,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RewardAndPunishDecision", DbType="NVarChar(100)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RewardAndPunishDecision", DbType="NVarChar(200)")] public string RewardAndPunishDecision { get @@ -236164,7 +236474,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] public string CanWelderCode { get