市长热线演示版

T_Sys_TelTitleData.cs 5.0KB

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