市长热线演示版

T_Ask_Question.cs 9.7KB

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