Ei kuvausta

T_Sys_OperateLogs.cs 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace CallCenterApi.BLL
  8. {
  9. /// <summary>
  10. /// T_Sys_OperateLogs
  11. /// </summary>
  12. public partial class T_Sys_OperateLogs
  13. {
  14. private readonly CallCenterApi.DAL.T_Sys_OperateLogs dal = new CallCenterApi.DAL.T_Sys_OperateLogs();
  15. public T_Sys_OperateLogs()
  16. { }
  17. #region BasicMethod
  18. /// <summary>
  19. /// 增加一条数据
  20. /// </summary>
  21. public int Add(CallCenterApi.Model.T_Sys_OperateLogs model)
  22. {
  23. return dal.Add(model);
  24. }
  25. /// <summary>
  26. /// 获得数据列表
  27. /// </summary>
  28. public DataSet GetList(string strWhere)
  29. {
  30. return dal.GetList(strWhere);
  31. }
  32. /// <summary>
  33. /// 获得前几行数据
  34. /// </summary>
  35. public DataSet GetList(int Top, string strWhere, string filedOrder)
  36. {
  37. return dal.GetList(Top, strWhere, filedOrder);
  38. }
  39. /// <summary>
  40. /// 获得数据列表
  41. /// </summary>
  42. public List<CallCenterApi.Model.T_Sys_OperateLogs> GetModelList(string strWhere)
  43. {
  44. DataSet ds = dal.GetList(strWhere);
  45. return DataTableToList(ds.Tables[0]);
  46. }
  47. /// <summary>
  48. /// 获得数据列表
  49. /// </summary>
  50. public List<CallCenterApi.Model.T_Sys_OperateLogs> DataTableToList(DataTable dt)
  51. {
  52. List<CallCenterApi.Model.T_Sys_OperateLogs> modelList = new List<CallCenterApi.Model.T_Sys_OperateLogs>();
  53. int rowsCount = dt.Rows.Count;
  54. if (rowsCount > 0)
  55. {
  56. CallCenterApi.Model.T_Sys_OperateLogs model;
  57. for (int n = 0; n < rowsCount; n++)
  58. {
  59. model = dal.DataRowToModel(dt.Rows[n]);
  60. if (model != null)
  61. {
  62. modelList.Add(model);
  63. }
  64. }
  65. }
  66. return modelList;
  67. }
  68. /// <summary>
  69. /// 获得数据列表
  70. /// </summary>
  71. public DataSet GetAllList()
  72. {
  73. return GetList("");
  74. }
  75. /// <summary>
  76. /// 分页获取数据列表
  77. /// </summary>
  78. public int GetRecordCount(string strWhere)
  79. {
  80. return dal.GetRecordCount(strWhere);
  81. }
  82. /// <summary>
  83. /// 分页获取数据列表
  84. /// </summary>
  85. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  86. {
  87. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  88. }
  89. #endregion BasicMethod
  90. #region ExtensionMethod
  91. public int AddOptLog(string module,string optuser,string optip,string des,string optcode,string tables,string optid)
  92. {
  93. Model.T_Sys_OperateLogs optmodel = new Model.T_Sys_OperateLogs();
  94. optmodel.F_Module = module;
  95. optmodel.F_OptBy = optuser;
  96. optmodel.F_OptOn = DateTime.Now;
  97. optmodel.F_OptIP = optip;
  98. optmodel.F_OptCode = optcode;
  99. optmodel.F_OptTables = tables;
  100. optmodel.F_OptID = optid;
  101. optmodel.F_Descript = des;
  102. return Add(optmodel);
  103. }
  104. #endregion ExtensionMethod
  105. }
  106. }