OrganizationService.cs 1009 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using wispro.sp.entity;
  6. namespace wispro.sp.web.Services
  7. {
  8. public class OrganizationService
  9. {
  10. private readonly IHttpService _httpClient;
  11. public OrganizationService(IHttpService httpClient)
  12. {
  13. _httpClient = httpClient;
  14. }
  15. public async Task<Department> SaveDept(Department dept)
  16. {
  17. var data = await _httpClient.Post<Department>($"Organization/SaveDept",dept);
  18. return data;
  19. }
  20. public async Task<List<Department>> GetDepartments()
  21. {
  22. var data = await _httpClient.Get<List<Department>>($"Organization/GetDepartments");
  23. return data;
  24. }
  25. public async Task<bool> DeleteDept(int deptId)
  26. {
  27. var ret = await _httpClient.Get<bool>($"Organization/DeleteDept?Id={deptId}");
  28. return ret;
  29. }
  30. }
  31. }