123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using OOO_WriteAndClear.DBModels;
- using OOO_WriteAndClear.MVP.Models.OrderFormerer;
- using OOO_WriteAndClear.MVP.Models.ProductsUserControlModel;
- using OOO_WriteAndClear.MVP.MVPInterfaces;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OOO_WriteAndClear.MVP.Presenters
- {
- public class ProductsUserControlPresenter : IProductsUserControlContract.IPresenter
- {
- public ProductsUserControlPresenter(IProductsUserControlContract.IView view)
- {
- _view = view;
- _model = new ProductsUserControlModel();
- }
- #region Реализация IProductsUserControlContract.IPresenter
- public int GetAllProductsCount() => _model.GetAllProductsCount();
- public ICollection<Product> FilterSearchSortProducts(FilterSearchSortParameters parameters)
- {
- _model.FilterSearchSortProducts(parameters);
- return _model.Products;
- }
- public async Task<ICollection<Product>> UpdateProductsList(FilterSearchSortParameters parameters)
- {
- await _model.UpdateProductsList(parameters);
- return _model.Products;
- }
- public void AddProductIntoOrder(Product product)
- {
- _model.AddProductIntoOrder(product, (order) => _view.ChangeDisplayingBasketData(order));
- }
- public void RemoveProductFromOrder(Product product)
- {
- _model.RemoveProductFromOrder(product, (order) => _view.ChangeDisplayingBasketData(order));
- }
- public OrderFormerer GetCurrentOrderFormerer() => _model.GetCurrentOrderFormerer();
- #endregion
- private IProductsUserControlContract.IView _view;
- private IProductsUserControlContract.IModel _model;
- }
- }
|