鹤壁市长热线,前端git:http://192.168.1.222:3000/clq1010/CallCenter5.0WebUI.git 中的鹤壁12345分支

T_Sys_Accessories.cs 5.1KB

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