Created
June 6, 2021 15:41
-
-
Save Defcoq/7dae4121482d76418c62931b8be4818e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductListPresenter | |
{ | |
private IProductListView _productListView; | |
private Service.ProductService _productService; | |
public ProductListPresenter(IProductListView ProductListView, Service.ProductService ProductService) | |
{ | |
_productService = ProductService; | |
_productListView = ProductListView; | |
} | |
public void Display() | |
{ | |
Service.ProductListRequest productListRequest = new Service.ProductListRequest(); | |
productListRequest.CustomerType = _productListView.CustomerType; | |
Service.ProductListResponse productResponse = _productService.GetAllProductsFor(productListRequest); | |
if (productResponse.Success) | |
{ | |
_productListView.Display(productResponse.Products); | |
} | |
else | |
{ | |
_productListView.ErrorMessage = productResponse.Message; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment