Brak opisu

T_FunctionsMenu.cs 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. using System;
  2. using System.Data;
  3. using System.Collections.Generic;
  4. using XYFDRQ.Model;
  5. namespace XYFDRQ.BLL
  6. {
  7. /// <summary>
  8. /// T_FunctionsMenu
  9. /// </summary>
  10. public partial class T_FunctionsMenu
  11. {
  12. private readonly XYFDRQ.DAL.T_FunctionsMenu dal=new XYFDRQ.DAL.T_FunctionsMenu();
  13. public T_FunctionsMenu()
  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_FunctionsMenuId)
  27. {
  28. return dal.Exists(F_FunctionsMenuId);
  29. }
  30. /// <summary>
  31. /// 增加一条数据
  32. /// </summary>
  33. public bool Add(XYFDRQ.Model.T_FunctionsMenu model)
  34. {
  35. return dal.Add(model);
  36. }
  37. /// <summary>
  38. /// 更新一条数据
  39. /// </summary>
  40. public bool Update(XYFDRQ.Model.T_FunctionsMenu model)
  41. {
  42. return dal.Update(model);
  43. }
  44. /// <summary>
  45. /// 删除一条数据
  46. /// </summary>
  47. public bool Delete(int F_FunctionsMenuId)
  48. {
  49. return dal.Delete(F_FunctionsMenuId);
  50. }
  51. /// <summary>
  52. /// 删除一条数据
  53. /// </summary>
  54. public bool DeleteList(string F_FunctionsMenuIdlist )
  55. {
  56. return dal.DeleteList(F_FunctionsMenuIdlist );
  57. }
  58. /// <summary>
  59. /// 得到一个对象实体
  60. /// </summary>
  61. public XYFDRQ.Model.T_FunctionsMenu GetModel(int F_FunctionsMenuId)
  62. {
  63. return dal.GetModel(F_FunctionsMenuId);
  64. }
  65. /// <summary>
  66. /// 获得数据列表
  67. /// </summary>
  68. public DataSet GetList(string strWhere)
  69. {
  70. return dal.GetList(strWhere);
  71. }
  72. /// <summary>
  73. /// 获得前几行数据
  74. /// </summary>
  75. public DataSet GetList(int Top,string strWhere,string filedOrder)
  76. {
  77. return dal.GetList(Top,strWhere,filedOrder);
  78. }
  79. /// <summary>
  80. /// 获得数据列表
  81. /// </summary>
  82. public List<XYFDRQ.Model.T_FunctionsMenu> GetModelList(string strWhere)
  83. {
  84. DataSet ds = dal.GetList(strWhere);
  85. return DataTableToList(ds.Tables[0]);
  86. }
  87. /// <summary>
  88. /// 获得数据列表
  89. /// </summary>
  90. public List<XYFDRQ.Model.T_FunctionsMenu> DataTableToList(DataTable dt)
  91. {
  92. List<XYFDRQ.Model.T_FunctionsMenu> modelList = new List<XYFDRQ.Model.T_FunctionsMenu>();
  93. int rowsCount = dt.Rows.Count;
  94. if (rowsCount > 0)
  95. {
  96. XYFDRQ.Model.T_FunctionsMenu model;
  97. for (int n = 0; n < rowsCount; n++)
  98. {
  99. model = new XYFDRQ.Model.T_FunctionsMenu();
  100. if(dt.Rows[n]["F_FunctionsMenuId"]!=null && dt.Rows[n]["F_FunctionsMenuId"].ToString()!="")
  101. {
  102. model.F_FunctionsMenuId=int.Parse(dt.Rows[n]["F_FunctionsMenuId"].ToString());
  103. }
  104. if(dt.Rows[n]["F_Path"]!=null && dt.Rows[n]["F_Path"].ToString()!="")
  105. {
  106. model.F_Path=dt.Rows[n]["F_Path"].ToString();
  107. }
  108. if(dt.Rows[n]["F_ParentId"]!=null && dt.Rows[n]["F_ParentId"].ToString()!="")
  109. {
  110. model.F_ParentId=int.Parse(dt.Rows[n]["F_ParentId"].ToString());
  111. }
  112. if(dt.Rows[n]["F_Sp_Order"]!=null && dt.Rows[n]["F_Sp_Order"].ToString()!="")
  113. {
  114. model.F_Sp_Order=dt.Rows[n]["F_Sp_Order"].ToString();
  115. }
  116. if(dt.Rows[n]["F_FunctionDescribe"]!=null && dt.Rows[n]["F_FunctionDescribe"].ToString()!="")
  117. {
  118. model.F_FunctionDescribe=dt.Rows[n]["F_FunctionDescribe"].ToString();
  119. }
  120. if(dt.Rows[n]["F_Status"]!=null && dt.Rows[n]["F_Status"].ToString()!="")
  121. {
  122. model.F_Status=dt.Rows[n]["F_Status"].ToString();
  123. }
  124. modelList.Add(model);
  125. }
  126. }
  127. return modelList;
  128. }
  129. /// <summary>
  130. /// 获得数据列表
  131. /// </summary>
  132. public DataSet GetAllList()
  133. {
  134. return GetList("");
  135. }
  136. /// <summary>
  137. /// 分页获取数据列表
  138. /// </summary>
  139. public int GetRecordCount(string strWhere)
  140. {
  141. return dal.GetRecordCount(strWhere);
  142. }
  143. /// <summary>
  144. /// 分页获取数据列表
  145. /// </summary>
  146. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  147. {
  148. return dal.GetListByPage( strWhere, orderby, startIndex, endIndex);
  149. }
  150. /// <summary>
  151. /// 分页获取数据列表
  152. /// </summary>
  153. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  154. //{
  155. //return dal.GetList(PageSize,PageIndex,strWhere);
  156. //}
  157. #endregion Method
  158. }
  159. }