DAL_DZKJ_CustomerAccount.cs 5.2 KB

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