Нет описания

T_SMS_SentSMS.cs 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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_SentSMS
  9. /// </summary>
  10. public partial class T_SMS_SentSMS
  11. {
  12. private readonly CallCenterApi.DAL.T_SMS_SentSMS dal = new CallCenterApi.DAL.T_SMS_SentSMS();
  13. public T_SMS_SentSMS()
  14. { }
  15. #region Method
  16. /// <summary>
  17. /// 得到最大ID
  18. /// </summary>
  19. public int GetMaxId()
  20. {
  21. return dal.GetMaxId();
  22. }
  23. /// <summary>
  24. /// 是否存在该记录
  25. /// </summary>
  26. public bool Exists(int SMSID)
  27. {
  28. return dal.Exists(SMSID);
  29. }
  30. /// <summary>
  31. /// 增加一条数据
  32. /// </summary>
  33. public int Add(CallCenterApi.Model.T_SMS_SentSMS model)
  34. {
  35. return dal.Add(model);
  36. }
  37. /// <summary>
  38. /// 更新一条数据
  39. /// </summary>
  40. public bool Update(CallCenterApi.Model.T_SMS_SentSMS model)
  41. {
  42. return dal.Update(model);
  43. }
  44. /// <summary>
  45. /// 删除一条数据
  46. /// </summary>
  47. public bool Delete(int SMSID)
  48. {
  49. return dal.Delete(SMSID);
  50. }
  51. public bool Delete(string arrSMSID)
  52. {
  53. return dal.Delete(arrSMSID);
  54. }
  55. public int ReSend(string arrSMSID)
  56. {
  57. return dal.ReSend(arrSMSID);
  58. }
  59. /// <summary>
  60. /// 删除一条数据
  61. /// </summary>
  62. public bool DeleteList(string SMSIDlist)
  63. {
  64. return dal.DeleteList(SMSIDlist);
  65. }
  66. /// <summary>
  67. /// 得到一个对象实体
  68. /// </summary>
  69. public CallCenterApi.Model.T_SMS_SentSMS GetModel(int SMSID)
  70. {
  71. return dal.GetModel(SMSID);
  72. }
  73. /// <summary>
  74. /// 获得数据列表
  75. /// </summary>
  76. public DataSet GetList(string strWhere)
  77. {
  78. return dal.GetList(strWhere);
  79. }
  80. /// <summary>
  81. /// 获得前几行数据
  82. /// </summary>
  83. public DataSet GetList(int Top, string strWhere, string filedOrder)
  84. {
  85. return dal.GetList(Top, strWhere, filedOrder);
  86. }
  87. /// <summary>
  88. /// 获得数据列表
  89. /// </summary>
  90. public List<CallCenterApi.Model.T_SMS_SentSMS> GetModelList(string strWhere)
  91. {
  92. DataSet ds = dal.GetList(strWhere);
  93. return DataTableToList(ds.Tables[0]);
  94. }
  95. /// <summary>
  96. /// 获得数据列表
  97. /// </summary>
  98. public List<CallCenterApi.Model.T_SMS_SentSMS> DataTableToList(DataTable dt)
  99. {
  100. List<CallCenterApi.Model.T_SMS_SentSMS> modelList = new List<CallCenterApi.Model.T_SMS_SentSMS>();
  101. int rowsCount = dt.Rows.Count;
  102. if (rowsCount > 0)
  103. {
  104. CallCenterApi.Model.T_SMS_SentSMS model;
  105. for (int n = 0; n < rowsCount; n++)
  106. {
  107. model = new CallCenterApi.Model.T_SMS_SentSMS();
  108. if (dt.Rows[n]["SMSID"] != null && dt.Rows[n]["SMSID"].ToString() != "")
  109. {
  110. model.SMSID = int.Parse(dt.Rows[n]["SMSID"].ToString());
  111. }
  112. if (dt.Rows[n]["TelNum"] != null && dt.Rows[n]["TelNum"].ToString() != "")
  113. {
  114. model.TelNum = dt.Rows[n]["TelNum"].ToString();
  115. }
  116. if (dt.Rows[n]["Content"] != null && dt.Rows[n]["Content"].ToString() != "")
  117. {
  118. model.Content = dt.Rows[n]["Content"].ToString();
  119. }
  120. if (dt.Rows[n]["CommitTime"] != null && dt.Rows[n]["CommitTime"].ToString() != "")
  121. {
  122. model.CommitTime = DateTime.Parse(dt.Rows[n]["CommitTime"].ToString());
  123. }
  124. if (dt.Rows[n]["State"] != null && dt.Rows[n]["State"].ToString() != "")
  125. {
  126. model.State = int.Parse(dt.Rows[n]["State"].ToString());
  127. }
  128. if (dt.Rows[n]["SendTime"] != null && dt.Rows[n]["SendTime"].ToString() != "")
  129. {
  130. model.SendTime = DateTime.Parse(dt.Rows[n]["SendTime"].ToString());
  131. }
  132. if (dt.Rows[n]["LastSentTime"] != null && dt.Rows[n]["LastSentTime"].ToString() != "")
  133. {
  134. model.LastSentTime = DateTime.Parse(dt.Rows[n]["LastSentTime"].ToString());
  135. }
  136. if (dt.Rows[n]["MaxSendCount"] != null && dt.Rows[n]["MaxSendCount"].ToString() != "")
  137. {
  138. model.MaxSendCount = int.Parse(dt.Rows[n]["MaxSendCount"].ToString());
  139. }
  140. if (dt.Rows[n]["CurSentCount"] != null && dt.Rows[n]["CurSentCount"].ToString() != "")
  141. {
  142. model.CurSentCount = int.Parse(dt.Rows[n]["CurSentCount"].ToString());
  143. }
  144. if (dt.Rows[n]["Info"] != null && dt.Rows[n]["Info"].ToString() != "")
  145. {
  146. model.Info = dt.Rows[n]["Info"].ToString();
  147. }
  148. if (dt.Rows[n]["SendModemIMEI"] != null && dt.Rows[n]["SendModemIMEI"].ToString() != "")
  149. {
  150. model.SendModemIMEI = dt.Rows[n]["SendModemIMEI"].ToString();
  151. }
  152. if (dt.Rows[n]["F_UserID"] != null && dt.Rows[n]["F_UserID"].ToString() != "")
  153. {
  154. model.F_UserID = int.Parse(dt.Rows[n]["F_UserID"].ToString());
  155. }
  156. if (dt.Rows[n]["F_CustomerID"] != null && dt.Rows[n]["F_CustomerID"].ToString() != "")
  157. {
  158. model.F_CustomerID = int.Parse(dt.Rows[n]["F_CustomerID"].ToString());
  159. }
  160. if (dt.Rows[n]["F_Name"] != null && dt.Rows[n]["F_Name"].ToString() != "")
  161. {
  162. model.F_Name = dt.Rows[n]["F_Name"].ToString();
  163. }
  164. modelList.Add(model);
  165. }
  166. }
  167. return modelList;
  168. }
  169. /// <summary>
  170. /// 获得数据列表
  171. /// </summary>
  172. public DataSet GetAllList()
  173. {
  174. return GetList("");
  175. }
  176. /// <summary>
  177. /// 分页获取数据列表
  178. /// </summary>
  179. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  180. //{
  181. //return dal.GetList(PageSize,PageIndex,strWhere);
  182. //}
  183. #endregion Method
  184. }
  185. }