CalMonthServices.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Blazored.LocalStorage;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Net.Http;
  6. using System.Net.Http.Json;
  7. using System.Threading.Tasks;
  8. using wispro.sp.entity;
  9. namespace wispro.sp.web.Services
  10. {
  11. public class CalMonthServices
  12. {
  13. private readonly IHttpService _httpClient;
  14. public CalMonthServices(IHttpService httpClient)
  15. {
  16. _httpClient = httpClient;
  17. }
  18. public async Task<CalMonth> GetHandlingMonth()
  19. {
  20. try
  21. {
  22. var data = await _httpClient.Get<CalMonth>($"CalMonth/GetHandlingMonth");
  23. return data;
  24. }
  25. catch
  26. {
  27. return null;
  28. }
  29. }
  30. public async Task<List<CalMonth>> GetAll()
  31. {
  32. try
  33. {
  34. var data = await _httpClient.Get<List<CalMonth>>($"CalMonth/GetAll");
  35. return data;
  36. }
  37. catch
  38. {
  39. return null;
  40. }
  41. }
  42. }
  43. }