新野县12345_后端

T_Sys_TelTitleData.cs 6.1KB

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