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.
63 lines
1.7 KiB
63 lines
1.7 KiB
4 months ago
|
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;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 新增错误信息
|
||
|
/// </summary>
|
||
|
/// <param name="md"></param>
|
||
|
/// <returns></returns>
|
||
|
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)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|