增加颜色标识库
This commit is contained in:
@@ -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<Model.Base_MaterialColor> GetByQueryModle(Model.Base_MaterialColor table)
|
||||
private static IQueryable<Model.BaseMaterialcolorOutput> 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<Model.Base_MaterialColor> GetListByQueryModle(Model.Base_MaterialColor table)
|
||||
public static List<Model.BaseMaterialcolorOutput> GetListByQueryModle(Model.BaseMaterialcolorOutput table)
|
||||
{
|
||||
return GetByQueryModle(table).ToList();
|
||||
|
||||
}
|
||||
public static (List<Model.Base_MaterialColor> Data, int Total) GetListByQueryModle(Model.Base_MaterialColor table, int pageIndex = 0, int pageSize = 20)
|
||||
public static (List<Model.BaseMaterialcolorOutput> 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
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user