CalMonthController.cs 827 B

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