using System; using System.Collections.Generic; using System.Linq; using System.Web; using Warehouse.Models.mesModel; namespace Warehouse.DAL.Report { public class PressureResistant { public List QueryData(string lot,string bt, string et) { using (var context = new mesModel()) { string strwhere = ""; if (!string.IsNullOrEmpty(bt.ToString())) { strwhere += "and [LastTime] >= '" + Convert.ToString(bt) + "'"; strwhere += "and [LastTime] <= '" + Convert.ToString(et) + "'"; } strwhere += String.IsNullOrEmpty(lot) ? "" : " AND [BarCode] in (" + Convert.ToString(lot) + ")"; string sql = @"SELECT [BarCode] ,[MemoryId] ,[StepId] ,[UserId] ,[ReadMode] ,[Source] ,[ReadData1] ,[Limit] ,[ReadData2] ,[ReadTime] ,[ReadResult] ,[LastTime] FROM [mes_level2_iface].[dbo].[PressureResistant] where 1=1 " + strwhere; var res = context.DynamicListFromSql(sql, null); return res.ToList(); } } } }