DAL_KeywordManagement.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. namespace LYFZ.WeixinServiceDate.DAL
  7. {
  8. public class DAL_KeywordManagement : BaseDataOperate
  9. {
  10. public DAL_KeywordManagement()
  11. {
  12. this.TableFieldNameString = "";
  13. }
  14. #region 属性和字段
  15. string _tableName = "tb_KeywordManagement";
  16. /// <summary>
  17. /// 获取数据表名
  18. /// </summary>
  19. public override string TableName
  20. {
  21. get { return _tableName; }
  22. set { this._tableName = value; }
  23. }
  24. /// <summary>
  25. /// 获取当前新的数据表模型对象
  26. /// </summary>
  27. public override object ObjModel
  28. {
  29. get
  30. {
  31. return this.CurrentModel;
  32. }
  33. }
  34. /// <summary>
  35. /// 获取当前新的MOdel
  36. /// </summary>
  37. public Model.Model_KeywordManagement CurrentModel
  38. {
  39. get { return new Model.Model_KeywordManagement(); }
  40. }
  41. string _tableFieldNameString = "";
  42. /// <summary>
  43. /// 数据表字段名数组
  44. /// </summary>
  45. public override string TableFieldNameString
  46. {
  47. get { return this._tableFieldNameString; }
  48. set { this._tableFieldNameString = value; }
  49. }
  50. #endregion
  51. #region 检查记录
  52. //基类已经实现
  53. #endregion
  54. #region 增加数据
  55. /// <summary>
  56. /// 增加一条数据
  57. /// </summary>
  58. /// <param name="model">Model对象</param>
  59. /// <returns></returns>
  60. public bool Add(Model.Model_KeywordManagement model)
  61. {
  62. return base.Add(model);
  63. }
  64. /// <summary>
  65. /// 增加一条数据
  66. /// </summary>
  67. /// <param name="model">Model对象</param>
  68. /// <param name="overlookFieldList">忽略字段名列表 字段名之间用“,”号分隔</param>
  69. /// <returns></returns>
  70. public bool Add(Model.Model_KeywordManagement model, string overlookFieldList = "ID")
  71. {
  72. return base.Add(model, overlookFieldList);
  73. }
  74. #endregion
  75. #region 删除数据
  76. /// <summary>
  77. /// 删除数据
  78. /// </summary>
  79. /// <param name="model"></param>
  80. /// <returns></returns>
  81. public bool Delete(Model.Model_KeywordManagement model)
  82. {
  83. return base.Delete(model.ID);
  84. }
  85. #endregion
  86. #region 更新数据
  87. /// <summary>
  88. /// 根据模块代码 设置启用/禁用状态
  89. /// </summary>
  90. public bool SetFunctionCodeEnabled(string FunctionCode,int isEnabled)
  91. {
  92. if (LYFZ.Helper.SQLHelper.ExecuteSql("UPDATE tb_KeywordManagement set [isEnabled]=" + isEnabled.ToString() + " where FunctionCode='" + FunctionCode + "'") > 0)
  93. {
  94. return true;
  95. }
  96. else {
  97. return false;
  98. }
  99. }
  100. /// <summary>
  101. /// 根据关键字 设置启用/禁用状态
  102. /// </summary>
  103. public bool SetKeywordCodeEnabled(string Keyword, int isEnabled)
  104. {
  105. if (LYFZ.Helper.SQLHelper.ExecuteSql("UPDATE tb_KeywordManagement set [isEnabled]=" + isEnabled.ToString() + " where Keyword='" + Keyword + "'") > 0)
  106. {
  107. return true;
  108. }
  109. else
  110. {
  111. return false;
  112. }
  113. }
  114. /// <summary>
  115. /// 更新一条数据
  116. /// </summary>
  117. public bool Update(Model.Model_KeywordManagement model)
  118. {
  119. return base.Update(model);
  120. }
  121. /// <summary>
  122. /// 根据筛选字段和SQL筛选运算符号更新数据
  123. /// </summary>
  124. /// <param name="model">Model对象</param>
  125. /// <param name="filterFieldName">筛选字段名称</param>
  126. /// <param name="operators">SQL筛选运算符号</param>
  127. /// <param name="overlookFieldList">忽略字段名列表 字段名之间用“,”号分隔</param>
  128. /// <returns></returns>
  129. public bool Update(Model.Model_KeywordManagement model, string filterFieldName = "ID", string operators = "=", string overlookFieldList = "ID")
  130. {
  131. return base.Update(model, filterFieldName, operators, overlookFieldList);
  132. }
  133. #endregion
  134. #region 查询数据
  135. /// <summary>
  136. /// 得到一个对象实体
  137. /// </summary>
  138. public Model.Model_KeywordManagement GetModel(int ID)
  139. {
  140. return DataRowToModel(GetDataRow(ID));
  141. }
  142. /// <summary>
  143. /// 得到一个对象实体
  144. /// </summary>
  145. /// <param name="row"></param>
  146. /// <returns></returns>
  147. public Model.Model_KeywordManagement DataRowToModel(DataRow row)
  148. {
  149. return DataRowToModelObject(row) as Model.Model_KeywordManagement;
  150. }
  151. #endregion
  152. #region 数据分页
  153. //基类已实现相关方法
  154. #endregion
  155. }
  156. }