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

T_Sys_DictionaryValue.cs 5.1KB

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