diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index f326ce86..87c5769b 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json index 6c1cb586..75ab69a7 100644 --- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json +++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json @@ -67,10 +67,6 @@ "$type": "Bookmark", "Name": "ST:2:0:{b9f91511-5ca5-40ec-9726-f3e3a7e534e2}" }, - { - "$type": "Bookmark", - "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" - }, { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json index 75ab69a7..086d13fc 100644 --- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json +++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json @@ -70,6 +70,10 @@ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" } ] } diff --git a/SGGL/BLL/HJGL/BaseInfo/Base_MaterialColorService.cs b/SGGL/BLL/HJGL/BaseInfo/Base_MaterialColorService.cs index ff7ac211..763b3fcc 100644 --- a/SGGL/BLL/HJGL/BaseInfo/Base_MaterialColorService.cs +++ b/SGGL/BLL/HJGL/BaseInfo/Base_MaterialColorService.cs @@ -1,4 +1,5 @@ using FineUIPro; +using Model; using System; using System.Collections; using System.Collections.Generic; @@ -23,9 +24,24 @@ namespace BLL get; set; } - private static IQueryable GetByQueryModle(Model.Base_MaterialColor table) + private static IQueryable GetByQueryModle(Model.BaseMaterialcolorOutput table) { - var q = from x in Funs.DB.Base_MaterialColor select x; + var q = from x in Funs.DB.Base_MaterialColor + join y in Funs.DB.Base_Material on x.MaterialId equals y.MaterialId into yy + from y in yy.DefaultIfEmpty() + select new BaseMaterialcolorOutput + { + MaterialId = y.MaterialId, + MaterialCode = y.MaterialCode, + MaterialColorId = x.MaterialColorId, + UnitId = x.UnitId, + ProjectId = x.ProjectId, + ColorName = x.ColorName, + ColorCardNo = x.ColorCardNo, + RGB = x.RGB, + Remark= x.Remark, + + }; if (table == null) { return q; @@ -38,10 +54,18 @@ namespace BLL { q = q.Where(x => x.UnitId.Contains(table.UnitId)); } + if (!string.IsNullOrEmpty(table.ProjectId)) + { + q = q.Where(x => x.ProjectId.Contains(table.ProjectId)); + } if (!string.IsNullOrEmpty(table.MaterialId)) { q = q.Where(x => x.MaterialId.Contains(table.MaterialId)); } + if (!string.IsNullOrEmpty(table.MaterialCode)) + { + q = q.Where(x => x.MaterialCode.Contains(table.MaterialCode)); + } if (!string.IsNullOrEmpty(table.ColorName)) { q = q.Where(x => x.ColorName.Contains(table.ColorName)); @@ -62,12 +86,12 @@ namespace BLL return q; } - public static List GetListByQueryModle(Model.Base_MaterialColor table) + public static List GetListByQueryModle(Model.BaseMaterialcolorOutput table) { return GetByQueryModle(table).ToList(); } - public static (List Data, int Total) GetListByQueryModle(Model.Base_MaterialColor table, int pageIndex = 0, int pageSize = 20) + public static (List Data, int Total) GetListByQueryModle(Model.BaseMaterialcolorOutput table, int pageIndex = 0, int pageSize = 20) { var baseQuery = GetByQueryModle(table); var pagedData = baseQuery @@ -87,7 +111,7 @@ namespace BLL /// /// /// - public static IEnumerable GetListData(Model.Base_MaterialColor table, Grid grid1) + public static IEnumerable GetListData(Model.BaseMaterialcolorOutput table, Grid grid1) { var q = GetByQueryModle(table); Count = q.Count(); @@ -102,6 +126,7 @@ namespace BLL { x.MaterialColorId, x.UnitId, + x.ProjectId, x.MaterialId, x.ColorName, x.ColorCardNo, @@ -125,6 +150,7 @@ namespace BLL { MaterialColorId = newtable.MaterialColorId, UnitId = newtable.UnitId, + ProjectId= newtable.ProjectId, MaterialId = newtable.MaterialId, ColorName = newtable.ColorName, ColorCardNo = newtable.ColorCardNo, @@ -144,6 +170,7 @@ namespace BLL { table.MaterialColorId = newtable.MaterialColorId; table.UnitId = newtable.UnitId; + table.ProjectId = newtable.ProjectId; table.MaterialId = newtable.MaterialId; table.ColorName = newtable.ColorName; table.ColorCardNo = newtable.ColorCardNo; diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx index 7c0ca140..8564fed7 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx @@ -55,12 +55,8 @@ - - - - - + diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx.cs index 70e44f29..6010c49f 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColor.aspx.cs @@ -29,7 +29,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo /// private void BindGrid() { - Model.Base_MaterialColor table = new Model.Base_MaterialColor(); + Model.BaseMaterialcolorOutput table = new Model.BaseMaterialcolorOutput(); + table.ProjectId=this.CurrUser.LoginProjectId; var tb = BLL.BaseMaterialcolorService.GetListByQueryModle(table, Grid1.PageIndex, Grid1.PageSize); Grid1.RecordCount = tb.Total; Grid1.DataSource = tb.Data; @@ -91,7 +92,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo /// protected void btnNew_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Base_MaterialColorEdit.aspx?MaterialColorId={0}", string.Empty, "增加 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialColorEdit.aspx?MaterialColorId={0}", string.Empty, "增加 - "))); } /// @@ -110,7 +111,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo var model = BLL.BaseMaterialcolorService.GetModelById(ID); if (model != null) ///已上报时不能删除 { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Base_MaterialColorEdit.aspx?MaterialColorId={0}", ID, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialColorEdit.aspx?MaterialColorId={0}", ID, "编辑 - "))); } } diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColorEdit.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColorEdit.aspx index 697b092a..61182744 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColorEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialColorEdit.aspx @@ -5,7 +5,7 @@ - + @@ -15,57 +15,81 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - +