新野县12345_后端

T_Sys_DictionaryValue.cs 4.9KB

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