商城手机版

PT_Base_Site.cs 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Text;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using ShopMobile.Model;
  6. namespace ShopMobile.Bll
  7. {
  8. //PT_Base_Site
  9. public partial class PT_Base_Site
  10. {
  11. private readonly ShopMobile.Dal.PT_Base_Site dal = new ShopMobile.Dal.PT_Base_Site();
  12. public PT_Base_Site()
  13. { }
  14. #region Method
  15. /// <summary>
  16. /// 是否存在该记录
  17. /// </summary>
  18. public bool Exists(int ID)
  19. {
  20. return dal.Exists(ID);
  21. }
  22. /// <summary>
  23. /// 增加一条数据
  24. /// </summary>
  25. public int Add(ShopMobile.Model.PT_Base_Site model)
  26. {
  27. return dal.Add(model);
  28. }
  29. /// <summary>
  30. /// 更新一条数据
  31. /// </summary>
  32. public bool Update(ShopMobile.Model.PT_Base_Site model)
  33. {
  34. return dal.Update(model);
  35. }
  36. /// <summary>
  37. /// 删除一条数据
  38. /// </summary>
  39. public bool Delete(int ID)
  40. {
  41. return dal.Delete(ID);
  42. }
  43. /// <summary>
  44. /// 批量删除一批数据
  45. /// </summary>
  46. public bool DeleteList(string IDlist)
  47. {
  48. return dal.DeleteList(IDlist);
  49. }
  50. /// <summary>
  51. /// 得到一个对象实体
  52. /// </summary>
  53. public ShopMobile.Model.PT_Base_Site GetModel(int ID)
  54. {
  55. return dal.GetModel(ID);
  56. }
  57. /// <summary>
  58. /// 获得数据列表
  59. /// </summary>
  60. public DataSet GetList(string strWhere)
  61. {
  62. return dal.GetList(strWhere);
  63. }
  64. /// <summary>
  65. /// 获得前几行数据
  66. /// </summary>
  67. public DataSet GetList(int Top, string strWhere, string filedOrder)
  68. {
  69. return dal.GetList(Top, strWhere, filedOrder);
  70. }
  71. /// <summary>
  72. /// 获得数据列表
  73. /// </summary>
  74. public List<ShopMobile.Model.PT_Base_Site> GetModelList(string strWhere)
  75. {
  76. DataSet ds = dal.GetList(strWhere);
  77. return DataTableToList(ds.Tables[0]);
  78. }
  79. /// <summary>
  80. /// 获得数据列表
  81. /// </summary>
  82. public List<ShopMobile.Model.PT_Base_Site> DataTableToList(DataTable dt)
  83. {
  84. List<ShopMobile.Model.PT_Base_Site> modelList = new List<ShopMobile.Model.PT_Base_Site>();
  85. int rowsCount = dt.Rows.Count;
  86. if (rowsCount > 0)
  87. {
  88. ShopMobile.Model.PT_Base_Site model;
  89. for (int n = 0; n < rowsCount; n++)
  90. {
  91. model = new ShopMobile.Model.PT_Base_Site();
  92. if (dt.Rows[n]["ID"].ToString() != "")
  93. {
  94. model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
  95. }
  96. model.WX_AppID = dt.Rows[n]["WX_AppID"].ToString();
  97. model.WX_AppSecret = dt.Rows[n]["WX_AppSecret"].ToString();
  98. model.WX_MCHID = dt.Rows[n]["WX_MCHID"].ToString();
  99. model.WX_KEY = dt.Rows[n]["WX_KEY"].ToString();
  100. model.SiteName = dt.Rows[n]["SiteName"].ToString();
  101. model.Alipay_PublicKey = dt.Rows[n]["Alipay_PublicKey"].ToString();
  102. model.SiteLogo = dt.Rows[n]["SiteLogo"].ToString();
  103. model.SiteTel = dt.Rows[n]["SiteTel"].ToString();
  104. model.SiteQQ = dt.Rows[n]["SiteQQ"].ToString();
  105. model.SearchKey = dt.Rows[n]["SearchKey"].ToString();
  106. model.Alipay_No = dt.Rows[n]["Alipay_No"].ToString();
  107. model.Alipay_PID = dt.Rows[n]["Alipay_PID"].ToString();
  108. model.Alipay_PrivateKey = dt.Rows[n]["Alipay_PrivateKey"].ToString();
  109. modelList.Add(model);
  110. }
  111. }
  112. return modelList;
  113. }
  114. /// <summary>
  115. /// 获得数据列表
  116. /// </summary>
  117. public DataSet GetAllList()
  118. {
  119. return GetList("");
  120. }
  121. #endregion
  122. }
  123. }