CalMonthController.cs 885 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Threading.Tasks;
  8. using wispro.sp.entity;
  9. namespace wispro.sp.api.Controllers
  10. {
  11. [Route("api/[controller]/[action]")]
  12. [ApiController]
  13. [Authorize]
  14. public class CalMonthController : ControllerBase
  15. {
  16. spDbContext Context;
  17. public CalMonthController(spDbContext context)
  18. {
  19. Context = context;
  20. }
  21. public CalMonth GetHandlingMonth()
  22. {
  23. CalMonth calMonth= Context.CalMonths.Where<CalMonth>(c => c.Status != 4).FirstOrDefault();
  24. if(calMonth== null)
  25. {
  26. return null;
  27. }
  28. else
  29. {
  30. return calMonth;
  31. }
  32. }
  33. }
  34. }