ZZDianXin_API - 郑州电信演示

T_Ask_Question.cs 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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_Question
  10. {
  11. private readonly CallCenterApi.DAL.T_Ask_Question dal = new CallCenterApi.DAL.T_Ask_Question();
  12. public T_Ask_Question()
  13. { }
  14. #region Method
  15. /// <summary>
  16. /// 是否存在该记录
  17. /// </summary>
  18. public bool Exists(int F_QuestionId)
  19. {
  20. return dal.Exists(F_QuestionId);
  21. }
  22. /// <summary>
  23. /// 增加一条数据
  24. /// </summary>
  25. public int Add(CallCenterApi.Model.T_Ask_Question model)
  26. {
  27. return dal.Add(model);
  28. }
  29. /// <summary>
  30. /// 更新一条数据
  31. /// </summary>
  32. public bool Update(CallCenterApi.Model.T_Ask_Question model)
  33. {
  34. return dal.Update(model);
  35. }
  36. /// <summary>
  37. /// 删除一条数据
  38. /// </summary>
  39. public bool Delete(int F_QuestionId)
  40. {
  41. return dal.Delete(F_QuestionId);
  42. }
  43. /// <summary>
  44. /// 删除一条数据
  45. /// </summary>
  46. public bool DeleteList(string F_QuestionIdlist)
  47. {
  48. return dal.DeleteList(F_QuestionIdlist);
  49. }
  50. /// <summary>
  51. /// 得到一个对象实体
  52. /// </summary>
  53. public CallCenterApi.Model.T_Ask_Question GetModel(int F_QuestionId)
  54. {
  55. return dal.GetModel(F_QuestionId);
  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_Question> 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_Question> DataTableToList(DataTable dt)
  83. {
  84. List<CallCenterApi.Model.T_Ask_Question> modelList = new List<CallCenterApi.Model.T_Ask_Question>();
  85. int rowsCount = dt.Rows.Count;
  86. if (rowsCount > 0)
  87. {
  88. CallCenterApi.Model.T_Ask_Question model;
  89. for (int n = 0; n < rowsCount; n++)
  90. {
  91. model = new CallCenterApi.Model.T_Ask_Question();
  92. if (dt.Rows[n]["F_QuestionId"] != null && dt.Rows[n]["F_QuestionId"].ToString() != "")
  93. {
  94. model.F_QuestionId = int.Parse(dt.Rows[n]["F_QuestionId"].ToString());
  95. }
  96. if (dt.Rows[n]["F_CategoryId"] != null && dt.Rows[n]["F_CategoryId"].ToString() != "")
  97. {
  98. model.F_CategoryId = int.Parse(dt.Rows[n]["F_CategoryId"].ToString());
  99. }
  100. if (dt.Rows[n]["F_Type"] != null && dt.Rows[n]["F_Type"].ToString() != "")
  101. {
  102. model.F_Type = int.Parse(dt.Rows[n]["F_Type"].ToString());
  103. }
  104. if (dt.Rows[n]["F_Title"] != null && dt.Rows[n]["F_Title"].ToString() != "")
  105. {
  106. model.F_Title = dt.Rows[n]["F_Title"].ToString();
  107. }
  108. if (dt.Rows[n]["F_Content"] != null && dt.Rows[n]["F_Content"].ToString() != "")
  109. {
  110. model.F_Content = dt.Rows[n]["F_Content"].ToString();
  111. }
  112. if (dt.Rows[n]["F_Remark"] != null && dt.Rows[n]["F_Remark"].ToString() != "")
  113. {
  114. model.F_Remark = dt.Rows[n]["F_Remark"].ToString();
  115. }
  116. if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
  117. {
  118. model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
  119. }
  120. if (dt.Rows[n]["F_CreateBy"] != null && dt.Rows[n]["F_CreateBy"].ToString() != "")
  121. {
  122. model.F_CreateBy = int.Parse(dt.Rows[n]["F_CreateBy"].ToString());
  123. }
  124. if (dt.Rows[n]["F_ModifyOn"] != null && dt.Rows[n]["F_ModifyOn"].ToString() != "")
  125. {
  126. model.F_ModifyOn = DateTime.Parse(dt.Rows[n]["F_ModifyOn"].ToString());
  127. }
  128. if (dt.Rows[n]["F_ModifyBy"] != null && dt.Rows[n]["F_ModifyBy"].ToString() != "")
  129. {
  130. model.F_ModifyBy = int.Parse(dt.Rows[n]["F_ModifyBy"].ToString());
  131. }
  132. if (dt.Rows[n]["F_DeleteFlag"] != null && dt.Rows[n]["F_DeleteFlag"].ToString() != "")
  133. {
  134. model.F_DeleteFlag = int.Parse(dt.Rows[n]["F_DeleteFlag"].ToString());
  135. }
  136. if (dt.Rows[n]["F_SortModel"] != null && dt.Rows[n]["F_SortModel"].ToString() != "")
  137. {
  138. model.F_SortModel = int.Parse(dt.Rows[n]["F_SortModel"].ToString());
  139. }
  140. modelList.Add(model);
  141. }
  142. }
  143. return modelList;
  144. }
  145. /// <summary>
  146. /// 获得数据列表
  147. /// </summary>
  148. public List<CallCenterApi.Model.T_Ask_PagerItemsQuestion> DataTableToPagerItemList(DataTable dt)
  149. {
  150. List<CallCenterApi.Model.T_Ask_PagerItemsQuestion> modelList = new List<CallCenterApi.Model.T_Ask_PagerItemsQuestion>();
  151. int rowsCount = dt.Rows.Count;
  152. if (rowsCount > 0)
  153. {
  154. CallCenterApi.Model.T_Ask_PagerItemsQuestion model;
  155. for (int n = 0; n < rowsCount; n++)
  156. {
  157. model = new CallCenterApi.Model.T_Ask_PagerItemsQuestion();
  158. if (dt.Rows[n]["F_ItemId"] != null && dt.Rows[n]["F_ItemId"].ToString() != "")
  159. {
  160. model.F_ItemId = int.Parse(dt.Rows[n]["F_ItemId"].ToString());
  161. }
  162. if (dt.Rows[n]["F_Sort"] != null && dt.Rows[n]["F_Sort"].ToString() != "")
  163. {
  164. model.F_Sort = int.Parse(dt.Rows[n]["F_Sort"].ToString());
  165. }
  166. if (dt.Rows[n]["F_QuestionId"] != null && dt.Rows[n]["F_QuestionId"].ToString() != "")
  167. {
  168. model.F_QuestionId = int.Parse(dt.Rows[n]["F_QuestionId"].ToString());
  169. }
  170. if (dt.Rows[n]["F_CategoryId"] != null && dt.Rows[n]["F_CategoryId"].ToString() != "")
  171. {
  172. model.F_CategoryId = int.Parse(dt.Rows[n]["F_CategoryId"].ToString());
  173. }
  174. if (dt.Rows[n]["F_Type"] != null && dt.Rows[n]["F_Type"].ToString() != "")
  175. {
  176. model.F_Type = int.Parse(dt.Rows[n]["F_Type"].ToString());
  177. }
  178. if (dt.Rows[n]["F_Title"] != null && dt.Rows[n]["F_Title"].ToString() != "")
  179. {
  180. model.F_Title = dt.Rows[n]["F_Title"].ToString();
  181. }
  182. if (dt.Rows[n]["F_Content"] != null && dt.Rows[n]["F_Content"].ToString() != "")
  183. {
  184. model.F_Content = dt.Rows[n]["F_Content"].ToString();
  185. }
  186. if (dt.Rows[n]["F_Remark"] != null && dt.Rows[n]["F_Remark"].ToString() != "")
  187. {
  188. model.F_Remark = dt.Rows[n]["F_Remark"].ToString();
  189. }
  190. if (dt.Rows[n]["F_CategoryName"] != null && dt.Rows[n]["F_CategoryName"].ToString() != "")
  191. {
  192. model.F_CategoryName = dt.Rows[n]["F_CategoryName"].ToString();
  193. }
  194. modelList.Add(model);
  195. }
  196. }
  197. return modelList;
  198. }
  199. /// <summary>
  200. /// 获得数据列表
  201. /// </summary>
  202. public DataSet GetAllList()
  203. {
  204. return GetList("");
  205. }
  206. /// <summary>
  207. /// 分页获取数据列表
  208. /// </summary>
  209. public int GetRecordCount(string strWhere)
  210. {
  211. return dal.GetRecordCount(strWhere);
  212. }
  213. /// <summary>
  214. /// 分页获取数据列表
  215. /// </summary>
  216. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  217. {
  218. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  219. }
  220. /// <summary>
  221. /// 分页获取数据列表
  222. /// </summary>
  223. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  224. //{
  225. //return dal.GetList(PageSize,PageIndex,strWhere);
  226. //}
  227. #endregion Method
  228. }
  229. }