Nenhuma Descrição

T_Bus_ManageSet.cs 5.4KB

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