You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.7 KiB

2 years ago
  1. using EasyNet.Common;
  2. using EasyNet.DBUtility;
  3. using Entity;
  4. using SqlSugar.Base;
  5. using System;
  6. using System.Collections.Generic;
  7. namespace EasyBL
  8. {
  9. public class EntityBL
  10. {
  11. public static Object QueryOne(string sType, Object oParam)
  12. {
  13. Object rel = null;
  14. var sSqlCommond = SqlCommand.GetSqlCommand(sType);
  15. rel = DBHelper.QueryOne(sSqlCommond, oParam);
  16. return rel;
  17. }
  18. public static Object QueryList(string sType, Object oParam)
  19. {
  20. Object rel = null;
  21. var sSqlCommond = SqlCommand.GetSqlCommand(sType);
  22. rel = DBHelper.QueryList(sSqlCommond, oParam);
  23. return rel;
  24. }
  25. public static PageResult QueryPage(Object oParam)
  26. {
  27. var pm = new ParamMap();
  28. pm.SetPageParamters(oParam);
  29. return new DBHelper().QueryPage(pm);
  30. }
  31. public static PageResult QueryPageByPrc(string sType, Object oParam, bool bCount)
  32. {
  33. var sSqlCommond = SqlCommand.GetSqlCommand(sType);
  34. return DBHelper.QueryPageByPrc(sSqlCommond, oParam, bCount);
  35. }
  36. public static Object GetTableByPrc(string sType, Object oParam)
  37. {
  38. Object res = null;
  39. var sSqlCommond = SqlCommand.GetSqlCommand(sType);
  40. var dic = oParam as Dictionary<string, object>;
  41. var db = SugarBase.DB;
  42. res = db.Ado.UseStoredProcedure().GetDataTable(sSqlCommond, dic);
  43. return res;
  44. }
  45. public static int ExecuteSqlTran(Object oParm)
  46. {
  47. var Rel = DBHelper.ExecuteSqlTran(oParm);
  48. return Rel;
  49. }
  50. }
  51. }