Açıklama Yok

T_SMS_RecvSMS.cs 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. if (dt.Rows[n]["F_CreateDate"].ToString() != "")
  100. {
  101. model.F_CreateDate = DateTime.Parse(dt.Rows[n]["F_CreateDate"].ToString());
  102. }
  103. model.CallerNum = dt.Rows[n]["CallerNum"].ToString();
  104. model.Content = dt.Rows[n]["Content"].ToString();
  105. if (dt.Rows[n]["RecvTime"].ToString() != "")
  106. {
  107. model.RecvTime = DateTime.Parse(dt.Rows[n]["RecvTime"].ToString());
  108. }
  109. if (dt.Rows[n]["F_UserID"].ToString() != "")
  110. {
  111. model.F_UserID = int.Parse(dt.Rows[n]["F_UserID"].ToString());
  112. }
  113. if (dt.Rows[n]["F_CustomerID"].ToString() != "")
  114. {
  115. model.F_CustomerID = int.Parse(dt.Rows[n]["F_CustomerID"].ToString());
  116. }
  117. model.F_Name = dt.Rows[n]["F_Name"].ToString();
  118. if (dt.Rows[n]["State"].ToString() != "")
  119. {
  120. model.State = int.Parse(dt.Rows[n]["State"].ToString());
  121. }
  122. modelList.Add(model);
  123. }
  124. }
  125. return modelList;
  126. }
  127. /// <summary>
  128. /// 获得数据列表
  129. /// </summary>
  130. public DataSet GetAllList()
  131. {
  132. return GetList("");
  133. }
  134. /// <summary>
  135. /// 分页获取数据列表
  136. /// </summary>
  137. public int GetRecordCount(string strWhere)
  138. {
  139. return dal.GetRecordCount(strWhere);
  140. }
  141. /// <summary>
  142. /// 分页获取数据列表
  143. /// </summary>
  144. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  145. {
  146. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  147. }
  148. #endregion
  149. }
  150. }