Brak opisu

T_SMS_RecvSMS.cs 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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_SMS_RecvSMS
  11. /// </summary>
  12. public partial class T_SMS_RecvSMS
  13. {
  14. private readonly CallCenterApi.DAL.T_SMS_RecvSMS dal = new CallCenterApi.DAL.T_SMS_RecvSMS();
  15. public T_SMS_RecvSMS()
  16. { }
  17. #region Method
  18. /// <summary>
  19. /// 是否存在该记录
  20. /// </summary>
  21. public bool Exists(int SMSID)
  22. {
  23. return dal.Exists(SMSID);
  24. }
  25. /// <summary>
  26. /// 增加一条数据
  27. /// </summary>
  28. public int Add(CallCenterApi.Model.T_SMS_RecvSMS model)
  29. {
  30. return dal.Add(model);
  31. }
  32. /// <summary>
  33. /// 更新一条数据
  34. /// </summary>
  35. public bool Update(CallCenterApi.Model.T_SMS_RecvSMS model)
  36. {
  37. return dal.Update(model);
  38. }
  39. /// <summary>
  40. /// 删除一条数据
  41. /// </summary>
  42. public bool Delete(int SMSID)
  43. {
  44. return dal.Delete(SMSID);
  45. }
  46. /// <summary>
  47. /// 批量删除一批数据
  48. /// </summary>
  49. public bool DeleteList(string SMSIDlist)
  50. {
  51. return dal.DeleteList(SMSIDlist);
  52. }
  53. /// <summary>
  54. /// 得到一个对象实体
  55. /// </summary>
  56. public CallCenterApi.Model.T_SMS_RecvSMS GetModel(int SMSID)
  57. {
  58. return dal.GetModel(SMSID);
  59. }
  60. /// <summary>
  61. /// 获得数据列表
  62. /// </summary>
  63. public DataSet GetList(string strWhere)
  64. {
  65. return dal.GetList(strWhere);
  66. }
  67. /// <summary>
  68. /// 获得前几行数据
  69. /// </summary>
  70. public DataSet GetList(int Top, string strWhere, string filedOrder)
  71. {
  72. return dal.GetList(Top, strWhere, filedOrder);
  73. }
  74. /// <summary>
  75. /// 获得数据列表
  76. /// </summary>
  77. public List<CallCenterApi.Model.T_SMS_RecvSMS> GetModelList(string strWhere)
  78. {
  79. DataSet ds = dal.GetList(strWhere);
  80. return DataTableToList(ds.Tables[0]);
  81. }
  82. /// <summary>
  83. /// 获得数据列表
  84. /// </summary>
  85. public List<CallCenterApi.Model.T_SMS_RecvSMS> DataTableToList(DataTable dt)
  86. {
  87. List<CallCenterApi.Model.T_SMS_RecvSMS> modelList = new List<CallCenterApi.Model.T_SMS_RecvSMS>();
  88. int rowsCount = dt.Rows.Count;
  89. if (rowsCount > 0)
  90. {
  91. CallCenterApi.Model.T_SMS_RecvSMS model;
  92. for (int n = 0; n < rowsCount; n++)
  93. {
  94. model = new CallCenterApi.Model.T_SMS_RecvSMS();
  95. if (dt.Rows[n]["SMSID"].ToString() != "")
  96. {
  97. model.SMSID = int.Parse(dt.Rows[n]["SMSID"].ToString());
  98. }
  99. model.CallerNum = dt.Rows[n]["CallerNum"].ToString();
  100. model.Content = dt.Rows[n]["Content"].ToString();
  101. if (dt.Rows[n]["RecvTime"].ToString() != "")
  102. {
  103. model.RecvTime = DateTime.Parse(dt.Rows[n]["RecvTime"].ToString());
  104. }
  105. if (dt.Rows[n]["F_UserID"].ToString() != "")
  106. {
  107. model.F_UserID = int.Parse(dt.Rows[n]["F_UserID"].ToString());
  108. }
  109. if (dt.Rows[n]["F_CustomerID"].ToString() != "")
  110. {
  111. model.F_CustomerID = int.Parse(dt.Rows[n]["F_CustomerID"].ToString());
  112. }
  113. model.F_Name = dt.Rows[n]["F_Name"].ToString();
  114. if (dt.Rows[n]["State"].ToString() != "")
  115. {
  116. model.State = int.Parse(dt.Rows[n]["State"].ToString());
  117. }
  118. modelList.Add(model);
  119. }
  120. }
  121. return modelList;
  122. }
  123. /// <summary>
  124. /// 获得数据列表
  125. /// </summary>
  126. public DataSet GetAllList()
  127. {
  128. return GetList("");
  129. }
  130. /// <summary>
  131. /// 分页获取数据列表
  132. /// </summary>
  133. public int GetRecordCount(string strWhere)
  134. {
  135. return dal.GetRecordCount(strWhere);
  136. }
  137. /// <summary>
  138. /// 分页获取数据列表
  139. /// </summary>
  140. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  141. {
  142. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  143. }
  144. #endregion
  145. }
  146. }