Account.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /** 版本信息模板在安装目录下,可自行修改。
  2. * account.cs
  3. *
  4. * 功 能: N/A
  5. * 类 名: account
  6. *
  7. * Ver 变更日期 负责人 变更内容
  8. * ───────────────────────────────────
  9. * V0.01 2024-07-27 10:51:14 N/A 初版
  10. *
  11. * Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
  12. *┌──────────────────────────────────┐
  13. *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
  14. *│ 版权所有:动软卓越(北京)科技有限公司              │
  15. *└──────────────────────────────────┘
  16. */
  17. using System;
  18. using System.Data;
  19. using System.Collections.Generic;
  20. using Maticsoft.Common;
  21. using Jpsoft.Model;
  22. namespace Jpsoft.BLL
  23. {
  24. /// <summary>
  25. /// account
  26. /// </summary>
  27. public partial class Account
  28. {
  29. private readonly Jpsoft.DAL.Account dal=new Jpsoft.DAL.Account();
  30. public Account()
  31. {}
  32. #region BasicMethod
  33. /// <summary>
  34. /// 是否存在该记录
  35. /// </summary>
  36. public bool Exists(string id_)
  37. {
  38. return dal.Exists(id_);
  39. }
  40. /// <summary>
  41. /// 增加一条数据
  42. /// </summary>
  43. public bool Add(Jpsoft.Model.Account model)
  44. {
  45. return dal.Add(model);
  46. }
  47. /// <summary>
  48. /// 更新一条数据
  49. /// </summary>
  50. public bool Update(Jpsoft.Model.Account model)
  51. {
  52. return dal.Update(model);
  53. }
  54. /// <summary>
  55. /// 删除一条数据
  56. /// </summary>
  57. public bool Delete(string id_)
  58. {
  59. return dal.Delete(id_);
  60. }
  61. /// <summary>
  62. /// 删除一条数据
  63. /// </summary>
  64. public bool DeleteList(string id_list )
  65. {
  66. return dal.DeleteList(id_list );
  67. }
  68. /// <summary>
  69. /// 得到一个对象实体
  70. /// </summary>
  71. public Jpsoft.Model.Account GetModel(string id_)
  72. {
  73. return dal.GetModel(id_);
  74. }
  75. /// <summary>
  76. /// 得到一个对象实体,从缓存中
  77. /// </summary>
  78. public Jpsoft.Model.Account GetModelByCache(string id_)
  79. {
  80. string CacheKey = "accountModel-" + id_;
  81. object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
  82. if (objModel == null)
  83. {
  84. try
  85. {
  86. objModel = dal.GetModel(id_);
  87. if (objModel != null)
  88. {
  89. int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
  90. Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  91. }
  92. }
  93. catch{}
  94. }
  95. return (Jpsoft.Model.Account)objModel;
  96. }
  97. /// <summary>
  98. /// 获得数据列表
  99. /// </summary>
  100. public DataSet GetList(string strWhere)
  101. {
  102. return dal.GetList(strWhere);
  103. }
  104. /// <summary>
  105. /// 获得数据列表
  106. /// </summary>
  107. public List<Jpsoft.Model.Account> GetModelList(string strWhere)
  108. {
  109. DataSet ds = dal.GetList(strWhere);
  110. return DataTableToList(ds.Tables[0]);
  111. }
  112. /// <summary>
  113. /// 获得数据列表
  114. /// </summary>
  115. public List<Jpsoft.Model.Account> DataTableToList(DataTable dt)
  116. {
  117. List<Jpsoft.Model.Account> modelList = new List<Jpsoft.Model.Account>();
  118. int rowsCount = dt.Rows.Count;
  119. if (rowsCount > 0)
  120. {
  121. Jpsoft.Model.Account model;
  122. for (int n = 0; n < rowsCount; n++)
  123. {
  124. model = dal.DataRowToModel(dt.Rows[n]);
  125. if (model != null)
  126. {
  127. modelList.Add(model);
  128. }
  129. }
  130. }
  131. return modelList;
  132. }
  133. /// <summary>
  134. /// 获得数据列表
  135. /// </summary>
  136. public DataSet GetAllList()
  137. {
  138. return GetList("");
  139. }
  140. /// <summary>
  141. /// 分页获取数据列表
  142. /// </summary>
  143. public int GetRecordCount(string strWhere)
  144. {
  145. return dal.GetRecordCount(strWhere);
  146. }
  147. /// <summary>
  148. /// 分页获取数据列表
  149. /// </summary>
  150. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  151. {
  152. return dal.GetListByPage( strWhere, orderby, startIndex, endIndex);
  153. }
  154. /// <summary>
  155. /// 分页获取数据列表
  156. /// </summary>
  157. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  158. //{
  159. //return dal.GetList(PageSize,PageIndex,strWhere);
  160. //}
  161. #endregion BasicMethod
  162. #region ExtensionMethod
  163. #endregion ExtensionMethod
  164. }
  165. }