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.
66 lines
1.7 KiB
66 lines
1.7 KiB
3 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 LogErrBLL
|
||
|
{
|
||
|
|
||
|
public DataTable SearchInfoByTime(string stime, string etime)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
LogErrDAL db = new LogErrDAL();
|
||
|
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);
|
||
|
}
|
||
|
if (etime != "0")
|
||
|
{
|
||
|
endtime = Convert.ToDateTime(etime);
|
||
|
}
|
||
|
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 err,MethodBase mb)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
LogErrDAL db = new LogErrDAL();
|
||
|
LogErrModel md = new LogErrModel();
|
||
|
md.ID = Guid.NewGuid().ToString();
|
||
|
md.ErrContent = err;
|
||
|
md.ErrSource = mb.DeclaringType.Name + "." + mb.Name;
|
||
|
db.Add_Info(md);
|
||
|
|
||
|
}
|
||
|
catch (Exception)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|