济源12345后端

T_SMS_RecvSMS.cs 5.5KB

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