OrdersUserControlPresenter.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using OOO_WriteAndClear.DBModels;
  2. using OOO_WriteAndClear.MVP.Models;
  3. using OOO_WriteAndClear.MVP.Models.ProductsUserControlModel;
  4. using OOO_WriteAndClear.MVP.MVPInterfaces;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace OOO_WriteAndClear.MVP.Presenters
  11. {
  12. public class OrdersUserControlPresenter : IOrdersUserControlContract.Presenter
  13. {
  14. public OrdersUserControlPresenter(IOrdersUserControlContract.View view)
  15. {
  16. _view = view;
  17. _model = new OrdersUserControlModel();
  18. }
  19. public ICollection<Order> Orders => _model.Orders;
  20. public void UpdateOrdersFromDB()
  21. {
  22. _model.UpdateOrdersFromDB();
  23. }
  24. public ICollection<Order> UpdateOrdersListForSortingAndFilting(FilterByDiscountParameters filterParams, string sortingParams)
  25. {
  26. _model.FilterAndSorting(filterParams, sortingParams);
  27. return _model.Orders;
  28. }
  29. private IOrdersUserControlContract.View _view;
  30. private IOrdersUserControlContract.Model _model;
  31. }
  32. }