Nav apraksta

T_Sys_Area.cs 3.9KB

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