using MESClassLibrary.DAL.Log; using MESClassLibrary.Model; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Text; namespace MESClassLibrary.BLL.Log { public class LogSysBLL { public DataTable SearchInfoByTime(string stime, string etime) { try { LogSysDAL db = new LogSysDAL(); DateTime startime = Convert.ToDateTime("1900-01-01 00:00:00"); DateTime endtime = Convert.ToDateTime("2100-12-31 23:59:59"); if (stime != "0") { startime = Convert.ToDateTime(stime + " 00:00:00"); } if (etime != "0") { endtime = Convert.ToDateTime(etime + " 23:59:59"); } return db.Search_InfoByTime(startime, endtime); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } /// /// 新增错误信息 /// /// /// public static void AddInfo(string sys, MethodBase mb) { try { LogSysDAL db = new LogSysDAL(); LogSysModel md = new LogSysModel(); md.ID = Guid.NewGuid().ToString(); md.SysContent = sys; md.SysSource = mb.DeclaringType.Name + "." + mb.Name; db.Add_Info(md); } catch (Exception) { } } } }