注塑喷涂
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.

82 lines
2.6 KiB

6 months ago
using MESClassLibrary.BLL.Log;
using MESClassLibrary.EFModel;
using MESClassLibrary.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace MESClassLibrary.BLL.Record247
{
public class Record247BLL
{
BBMPTEntities ef = new BBMPTEntities();
BasicBLL<tb_Record_247> db = new BasicBLL<tb_Record_247>();
/// <summary>
/// 查询全部信息分页
/// </summary>
/// <returns></returns>
public string SearchInfoAll(string page, string pagesize, string StartTime, string EndTime, string BoxNo, string PartNo2, string PartNo1, string OrderNo)
{
try
{
string jsonStr = "[]";
int total = 0;//总行数
DateTime stime = Convert.ToDateTime(StartTime + " 00:00:00");
DateTime etime = Convert.ToDateTime(EndTime + " 23:59:59");
List<tb_Record_247> list = ef.tb_Record_247.Where(p => p.CreateTime1 >= stime && p.CreateTime1 <= etime && p.Flag == 1).ToList();
if (!String.IsNullOrEmpty(BoxNo))
{
list = list.Where(p => p.BoxNo != null && p.BoxNo.Contains(BoxNo)).ToList();
}
if (!String.IsNullOrEmpty(PartNo2))
{
list = list.Where(p => p.PartNo2 != null && p.PartNo2.Contains(PartNo2)).ToList();
}
if (!String.IsNullOrEmpty(PartNo1))
{
list = list.Where(p => p.PartNo1 != null && p.PartNo1.Contains(PartNo1)).ToList();
}
if (!String.IsNullOrEmpty(OrderNo))
{
list = list.Where(p => p.OrderNo != null && p.OrderNo.Contains(OrderNo)).ToList();
}
if (list.Count > 0)
{
total = list.Count;
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize);
list = list.OrderBy(p => p.CreateTime1).Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList();
JsonDataModel<tb_Record_247> md = new JsonDataModel<tb_Record_247>();
md.total = total.ToString();
md.rows = list;
jsonStr = JSONTools.ScriptSerialize(md);
}
return jsonStr;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}