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.

36 lines
1.0 KiB

  1. using HKLib.DB;
  2. using HKLib.DB.Model.Entity;
  3. using HKLib.Interfaces;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. namespace HKLib.Logic
  8. {
  9. public class ServiceHandler
  10. {
  11. #region 机构类
  12. public static bool AddOrg(string Name)
  13. {
  14. var SiD = HKLibHelper.SetOrg(Name);
  15. return DbContext.Context.Insertable(new OrgTable
  16. {
  17. Name = Name,
  18. SId = SiD
  19. }).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0;
  20. }
  21. public static List<OrgTable> GetOrgList()
  22. {
  23. return DbContext.Context.Queryable<OrgTable>().ToList();
  24. }
  25. public static bool AlterOrg(string Name, string Id)
  26. {
  27. var s = HKLibHelper.AlterOrg(Name, Id);
  28. if (s)
  29. return DbContext.Context.Updateable<OrgTable>().SetColumns(t => t.Name == Name).Where(t => t.SId == Id).ExecuteCommandHasChange();
  30. else return false;
  31. }
  32. #endregion
  33. }
  34. }