using cuidian.Sql; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using YiLvRunFrom.Model; namespace YiLvRunFrom.Dal { public class WdtLogService { public List GetLogsTable() { List list = new List(); DataTable dt= DbUtils.Fill("select SysId,OperType,Args,ReturnCode,Msg from WdtLogs where ReturnCode<>0", ConnectionUtils.Instance.GetConnection("TempDB") ); foreach (DataRow row in dt.Rows) { list.Add(new WdtLogs() { SysId = Convert.ToInt32(row["SysId"].ToString()), OperType = row["OperType"].ToString(), Args = row["Args"].ToString(), ReturnCode = Convert.ToInt32(row["ReturnCode"].ToString()), Msg=row["Msg"].ToString() }); } return list; } public List GetSingletonTable(string typeStr) { List list = new List(); DataTable dt = DbUtils.Fill(string.Format("select SysId,OperType,Args,ReturnCode,Msg from WdtLogs where ReturnCode<>0 and OperType like '%{0}%'",typeStr), ConnectionUtils.Instance.GetConnection("TempDB")); foreach (DataRow row in dt.Rows) { list.Add(new WdtLogs() { SysId = Convert.ToInt32(row["SysId"].ToString()), OperType = row["OperType"].ToString(), Args = row["Args"].ToString(), ReturnCode = Convert.ToInt32(row["ReturnCode"].ToString()), Msg = row["Msg"].ToString() }); } return list; } } }