ZZDianXin_API - 郑州电信演示

T_Ask_QuestionCategory.cs 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace CallCenterApi.BLL
  8. {
  9. public partial class T_Ask_QuestionCategory
  10. {
  11. private readonly CallCenterApi.DAL.T_Ask_QuestionCategory dal = new CallCenterApi.DAL.T_Ask_QuestionCategory();
  12. public T_Ask_QuestionCategory()
  13. { }
  14. #region Method
  15. /// <summary>
  16. /// 是否存在该记录
  17. /// </summary>
  18. public bool Exists(int F_CategoryId)
  19. {
  20. return dal.Exists(F_CategoryId);
  21. }
  22. /// <summary>
  23. /// 增加一条数据
  24. /// </summary>
  25. public int Add(CallCenterApi.Model.T_Ask_QuestionCategory model)
  26. {
  27. return dal.Add(model);
  28. }
  29. /// <summary>
  30. /// 更新一条数据
  31. /// </summary>
  32. public bool Update(CallCenterApi.Model.T_Ask_QuestionCategory model)
  33. {
  34. return dal.Update(model);
  35. }
  36. /// <summary>
  37. /// 删除一条数据
  38. /// </summary>
  39. public bool Delete(int F_CategoryId)
  40. {
  41. return dal.Delete(F_CategoryId);
  42. }
  43. /// <summary>
  44. /// 删除一条数据
  45. /// </summary>
  46. public bool DeleteList(string F_CategoryIdlist)
  47. {
  48. return dal.DeleteList(F_CategoryIdlist);
  49. }
  50. /// <summary>
  51. /// 得到一个对象实体
  52. /// </summary>
  53. public CallCenterApi.Model.T_Ask_QuestionCategory GetModel(int F_CategoryId)
  54. {
  55. return dal.GetModel(F_CategoryId);
  56. }
  57. /// <summary>
  58. /// 获得数据列表
  59. /// </summary>
  60. public DataSet GetList(string strWhere)
  61. {
  62. return dal.GetList(strWhere);
  63. }
  64. /// <summary>
  65. /// 获得前几行数据
  66. /// </summary>
  67. public DataSet GetList(int Top, string strWhere, string filedOrder)
  68. {
  69. return dal.GetList(Top, strWhere, filedOrder);
  70. }
  71. /// <summary>
  72. /// 获得数据列表
  73. /// </summary>
  74. public List<CallCenterApi.Model.T_Ask_QuestionCategory> GetModelList(string strWhere)
  75. {
  76. DataSet ds = dal.GetList(strWhere);
  77. return DataTableToList(ds.Tables[0]);
  78. }
  79. /// <summary>
  80. /// 获得数据列表
  81. /// </summary>
  82. public List<CallCenterApi.Model.T_Ask_QuestionCategory> DataTableToList(DataTable dt)
  83. {
  84. List<CallCenterApi.Model.T_Ask_QuestionCategory> modelList = new List<CallCenterApi.Model.T_Ask_QuestionCategory>();
  85. int rowsCount = dt.Rows.Count;
  86. if (rowsCount > 0)
  87. {
  88. CallCenterApi.Model.T_Ask_QuestionCategory model;
  89. for (int n = 0; n < rowsCount; n++)
  90. {
  91. model = new CallCenterApi.Model.T_Ask_QuestionCategory();
  92. if (dt.Rows[n]["F_CategoryId"] != null && dt.Rows[n]["F_CategoryId"].ToString() != "")
  93. {
  94. model.F_CategoryId = int.Parse(dt.Rows[n]["F_CategoryId"].ToString());
  95. }
  96. if (dt.Rows[n]["F_CategoryNumber"] != null && dt.Rows[n]["F_CategoryNumber"].ToString() != "")
  97. {
  98. model.F_CategoryNumber = dt.Rows[n]["F_CategoryNumber"].ToString();
  99. }
  100. if (dt.Rows[n]["F_CategoryName"] != null && dt.Rows[n]["F_CategoryName"].ToString() != "")
  101. {
  102. model.F_CategoryName = dt.Rows[n]["F_CategoryName"].ToString();
  103. }
  104. if (dt.Rows[n]["F_CategoryEName"] != null && dt.Rows[n]["F_CategoryEName"].ToString() != "")
  105. {
  106. model.F_CategoryEName = dt.Rows[n]["F_CategoryEName"].ToString();
  107. }
  108. if (dt.Rows[n]["F_Layer"] != null && dt.Rows[n]["F_Layer"].ToString() != "")
  109. {
  110. model.F_Layer = int.Parse(dt.Rows[n]["F_Layer"].ToString());
  111. }
  112. if (dt.Rows[n]["F_ParentId"] != null && dt.Rows[n]["F_ParentId"].ToString() != "")
  113. {
  114. model.F_ParentId = int.Parse(dt.Rows[n]["F_ParentId"].ToString());
  115. }
  116. if (dt.Rows[n]["F_CategoryType"] != null && dt.Rows[n]["F_CategoryType"].ToString() != "")
  117. {
  118. model.F_CategoryType = int.Parse(dt.Rows[n]["F_CategoryType"].ToString());
  119. }
  120. if (dt.Rows[n]["F_CanDelete"] != null && dt.Rows[n]["F_CanDelete"].ToString() != "")
  121. {
  122. model.F_CanDelete = int.Parse(dt.Rows[n]["F_CanDelete"].ToString());
  123. }
  124. if (dt.Rows[n]["F_IsCommon"] != null && dt.Rows[n]["F_IsCommon"].ToString() != "")
  125. {
  126. model.F_IsCommon = int.Parse(dt.Rows[n]["F_IsCommon"].ToString());
  127. }
  128. if (dt.Rows[n]["F_Sort"] != null && dt.Rows[n]["F_Sort"].ToString() != "")
  129. {
  130. model.F_Sort = int.Parse(dt.Rows[n]["F_Sort"].ToString());
  131. }
  132. if (dt.Rows[n]["F_Expand1"] != null && dt.Rows[n]["F_Expand1"].ToString() != "")
  133. {
  134. model.F_Expand1 = dt.Rows[n]["F_Expand1"].ToString();
  135. }
  136. if (dt.Rows[n]["F_Expand2"] != null && dt.Rows[n]["F_Expand2"].ToString() != "")
  137. {
  138. model.F_Expand2 = dt.Rows[n]["F_Expand2"].ToString();
  139. }
  140. if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
  141. {
  142. model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
  143. }
  144. if (dt.Rows[n]["F_CreateBy"] != null && dt.Rows[n]["F_CreateBy"].ToString() != "")
  145. {
  146. model.F_CreateBy = int.Parse(dt.Rows[n]["F_CreateBy"].ToString());
  147. }
  148. if (dt.Rows[n]["F_DeleteFlag"] != null && dt.Rows[n]["F_DeleteFlag"].ToString() != "")
  149. {
  150. model.F_DeleteFlag = int.Parse(dt.Rows[n]["F_DeleteFlag"].ToString());
  151. }
  152. modelList.Add(model);
  153. }
  154. }
  155. return modelList;
  156. }
  157. /// <summary>
  158. /// 获得数据列表
  159. /// </summary>
  160. public DataSet GetAllList()
  161. {
  162. return GetList("");
  163. }
  164. /// <summary>
  165. /// 分页获取数据列表
  166. /// </summary>
  167. public int GetRecordCount(string strWhere)
  168. {
  169. return dal.GetRecordCount(strWhere);
  170. }
  171. /// <summary>
  172. /// 分页获取数据列表
  173. /// </summary>
  174. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  175. {
  176. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  177. }
  178. /// <summary>
  179. /// 分页获取数据列表
  180. /// </summary>
  181. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  182. //{
  183. //return dal.GetList(PageSize,PageIndex,strWhere);
  184. //}
  185. #endregion Method
  186. }
  187. }