PriceAnnouncementController.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using CZFW.Framework.Interface;
  6. using CZKJ.GBRS2.Interface;
  7. using CZKJ.GBRS2.WebMVC.Models;
  8. using Microsoft.AspNetCore.Mvc;
  9. namespace CZKJ.GBRS2.WebMVC.Controllers
  10. {
  11. public class PriceAnnouncementController : Controller
  12. {
  13. private readonly IPriceAnnouncement _priceAnnouncementLgoic;
  14. private readonly IGallery _galleryLogic;
  15. private readonly IType _typeLogic;
  16. public PriceAnnouncementController(IPriceAnnouncement priceAnnouncementLogic, IGallery galleryLogic, IType typeLogic)
  17. {
  18. _priceAnnouncementLgoic = priceAnnouncementLogic;
  19. _galleryLogic = galleryLogic;
  20. _typeLogic = typeLogic;
  21. }
  22. public IActionResult Index(int typeId, DateTime? startTime, DateTime? endTime, int pageIndex = 1, int pageSize = 20)
  23. {
  24. var model = new PriceAnnouncementIndexModel();
  25. int rowsCount;
  26. model.Banner = _galleryLogic.GetGallery(176);
  27. model.TypeList = _typeLogic.GetListByParentId(172);
  28. model.List = _priceAnnouncementLgoic.GetList(typeId, startTime, endTime, pageIndex, pageSize, out rowsCount);
  29. model.TypeId = typeId;
  30. model.StartTime = startTime;
  31. model.EndTime = endTime;
  32. model.PageIndex = pageIndex;
  33. model.PageSize = pageSize;
  34. model.RowsCount = rowsCount;
  35. model.MaxYear = _priceAnnouncementLgoic.GetMaxYear();
  36. model.MinYear = _priceAnnouncementLgoic.GetMinYear();
  37. return View(model);
  38. }
  39. }
  40. }