public AbstractReportDTO GetMaxProductSaled(int quantity) { List <ProductItemReportDTO> result = cartManager.GetMaxProductSaled(quantity); AbstractReportDTO report = new ProductReportDTO("Reporte de productos más vendidos", result); return(report); }
public ICollection <ProductReportDTO> GetDataVersion2(ICollection <Product> productsCollection, ICollection <Client> clientsCollection, ICollection <Category> categoryCollection) { var res = new List <ProductReportDTO>(); foreach (var prodItem in productsCollection) { var resItem = new ProductReportDTO(); resItem.ProductId = prodItem.Id; resItem.ProductName = prodItem.Name; resItem.CategoryId = prodItem.CategoryId; resItem.ClientId = prodItem.ClientId; resItem.ClientName = clientsCollection .First(x => x.Id == prodItem.ClientId).Name; resItem.CategoryName = categoryCollection .First(x => x.Id == prodItem.CategoryId).Name; } return(res); }