DAL_AdminUser.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using LYFZ.Helper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Data.SqlClient;
  6. using System.Linq;
  7. using System.Text;
  8. namespace LYFZ.WeixinServiceDate.DAL
  9. {
  10. public class DAL_AdminUser :BaseDataOperate
  11. {
  12. public DAL_AdminUser()
  13. {
  14. this.TableFieldNameString = "";
  15. }
  16. #region 属性和字段
  17. string _tableName = "tb_AdminUser";
  18. /// <summary>
  19. /// 获取数据表名
  20. /// </summary>
  21. public override string TableName
  22. {
  23. get { return _tableName; } set { this._tableName = value; }
  24. }
  25. /// <summary>
  26. /// 获取当前新的数据表模型对象
  27. /// </summary>
  28. public override object ObjModel
  29. {
  30. get
  31. {
  32. return this.CurrentModel;
  33. }
  34. }
  35. /// <summary>
  36. /// 获取当前新的MOdel
  37. /// </summary>
  38. public Model.Model_AdminUser CurrentModel
  39. {
  40. get { return new Model.Model_AdminUser(); }
  41. }
  42. string _tableFieldNameString = "";
  43. /// <summary>
  44. /// 数据表字段名数组
  45. /// </summary>
  46. public override string TableFieldNameString
  47. {
  48. get { return this._tableFieldNameString; }
  49. set { this._tableFieldNameString = value; }
  50. }
  51. #endregion
  52. #region 检查记录
  53. //基类已经实现
  54. #endregion
  55. #region 增加数据
  56. /// <summary>
  57. /// 增加一条数据, 返回Id
  58. /// </summary>
  59. /// <param name="model">Model对象</param>
  60. /// <returns></returns>
  61. public int Add(Model.Model_AdminUser model)
  62. {
  63. LYFZ.Helper.CommandInfo comdInfo = this.GetAddCommandInfo(model, "ID");
  64. object result = SQLHelper.GetSingle(comdInfo.CommandText, (SqlParameter[])comdInfo.Parameters);
  65. return Convert.ToInt32(result);
  66. }
  67. #endregion
  68. #region 删除数据
  69. /// <summary>
  70. /// 删除数据
  71. /// </summary>
  72. /// <param name="model"></param>
  73. /// <returns></returns>
  74. public bool Delete(Model.Model_AdminUser model)
  75. {
  76. return base.Delete(model.ID);
  77. }
  78. #endregion
  79. #region 更新数据
  80. /// <summary>
  81. /// 更新一条数据
  82. /// </summary>
  83. public bool Update(Model.Model_AdminUser model)
  84. {
  85. return base.Update(model);
  86. }
  87. /// <summary>
  88. /// 根据筛选字段和SQL筛选运算符号更新数据
  89. /// </summary>
  90. /// <param name="model">Model对象</param>
  91. /// <param name="filterFieldName">筛选字段名称</param>
  92. /// <param name="operators">SQL筛选运算符号</param>
  93. /// <param name="overlookFieldList">忽略字段名列表 字段名之间用“,”号分隔</param>
  94. /// <returns></returns>
  95. public bool Update(Model.Model_AdminUser model, string filterFieldName = "ID", string operators = "=", string overlookFieldList = "ID")
  96. {
  97. return base.Update(model, filterFieldName, operators, overlookFieldList);
  98. }
  99. #endregion
  100. #region 查询数据
  101. /// <summary>
  102. /// 得到一个对象实体
  103. /// </summary>
  104. public Model.Model_AdminUser GetModel(int ID)
  105. {
  106. return DataRowToModel(GetDataRow(ID));
  107. }
  108. /// <summary>
  109. /// 得到一个对象实体
  110. /// </summary>
  111. /// <param name="row"></param>
  112. /// <returns></returns>
  113. public Model.Model_AdminUser DataRowToModel(DataRow row)
  114. {
  115. return DataRowToModelObject(row) as Model.Model_AdminUser;
  116. }
  117. #endregion
  118. #region 数据分页
  119. //基类已实现相关方法
  120. #endregion
  121. }
  122. }