PersonnelAttendanceController.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Cksoft.Data;
  2. using Cksoft.Data.Repository;
  3. using Cksoft.Unity;
  4. using DllEapDal.OFILM;
  5. using DllEapEntity.OFILM;
  6. using Microsoft.AspNetCore.Authorization;
  7. using Microsoft.AspNetCore.Mvc;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Text;
  11. namespace DllEapBll.OFILM
  12. {
  13. [Route("eap/api/[controller]/[action]")]
  14. [ApiController]
  15. [Authorize]
  16. public class PersonnelAttendanceController : ControllerBase
  17. {
  18. private IDatabase db;
  19. [HttpGet]
  20. public EapResponse Get(string name, string rate, DateTime? start, DateTime? end, string order = "desc", int pageIndex = 1, int pageSize = 20)
  21. {
  22. db = DbFactory.Base("MESPRD");
  23. var dal = new PersonnelAttendanceDal(db);
  24. int total = 0;
  25. var data = dal.Get(name, rate,order, start, end,pageIndex,pageSize,ref total);
  26. return new EapResponse()
  27. {
  28. Code = 1,
  29. Total=total,
  30. Data = data
  31. };
  32. }
  33. /* [HttpPost]
  34. public EapResponse Add([FromBody] Attendance Attend)
  35. {
  36. db = DbFactory.Base("MESPRD");
  37. var dal = new PersonnelAttendanceDal(db);
  38. string msg = dal.Add(Attend);
  39. }*/
  40. }
  41. }