一厂MES,含注塑,喷涂,冲孔
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

58 lines
2.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.EFModel;
using MESClassLibrary.Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MESClassLibrary.BLL.Painting
{
public class BucketStateBLL
{
BasicBLL<tb_AddColorRecord> db=new BasicBLL<tb_AddColorRecord>();
public string SearchInfo(string page, string pageSize, string bucketCode, string paintCode)
{
try
{
string jsonStr = "[]";
int total = 0;//总行数
List<tb_AddColorRecord> list = db.SearchAllInfo().ToList();
if (!string.IsNullOrWhiteSpace(bucketCode))
{
list = list.Where(p => p.BucketCode.Contains(bucketCode)).ToList();
}
if (!string.IsNullOrWhiteSpace(paintCode))
{
list = list.Where(p => p.PaintCode.Contains(paintCode)).ToList();
}
if (list.Count > 0)
{
total = list.Count;
int skipCount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pageSize);
list = list.Skip(skipCount).Take(Convert.ToInt32(pageSize)).ToList();
JsonDataModel<tb_AddColorRecord> md = new JsonDataModel<tb_AddColorRecord>();
md.total = total.ToString();
md.rows = list;
IsoDateTimeConverter timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
jsonStr = JsonConvert.SerializeObject(md, Formatting.Indented, timeConverter);
}
return jsonStr;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
return "";
}
}
}
}