PriceAnnouncementController.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using CZFW.Framework.Model.ViewModel;
  6. using CZFW.Framework.WebApi;
  7. using CZKJ.GBRS2.Entity;
  8. using CZKJ.GBRS2.Interface;
  9. using Microsoft.AspNetCore.Mvc;
  10. namespace CZKJ.GBRS2.Web.Areas.Manage.Controllers
  11. {
  12. public class PriceAnnouncementController : ApiControllerBase<PriceAnnouncementEntity>
  13. {
  14. private IPriceAnnouncement _priceAnnouncementLogic;
  15. public PriceAnnouncementController(IPriceAnnouncement priceAnnouncementLogic)
  16. {
  17. _baseLogic = _priceAnnouncementLogic = priceAnnouncementLogic;
  18. }
  19. public TableModel<PriceAnnouncementEntity> GetTableModel(int? typeId, int pageIndex = 1, int pageSize = 20)
  20. {
  21. int rowsCount = 0;
  22. var model = new TableModel<PriceAnnouncementEntity>();
  23. var data = _priceAnnouncementLogic.GetTableList(typeId,pageIndex,pageSize,out rowsCount);
  24. model.SetData(data);
  25. model.Pager = new PagerModel(rowsCount, pageIndex, pageSize);
  26. model.TableHeads = PropertyHelper.Get(typeof(PriceAnnouncementEntity));
  27. return model;
  28. }
  29. }
  30. }