123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- 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<WdtLogs> GetLogsTable()
- {
- List<WdtLogs> list = new List<WdtLogs>();
- 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<WdtLogs> GetSingletonTable(string typeStr)
- {
- List<WdtLogs> list = new List<WdtLogs>();
- 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;
- }
- }
- }
|