public DistributionCenterStockGUIView GenerateDistributionCenterStock(int centerID) { ICollection<DistributionCenterStockView> stockReport = reportDao.DistributionCenterStock(centerID); DistributionCenterStockGUIView GUIView = new DistributionCenterStockGUIView(); int totalItems = 0; double totalValue = 0; foreach (DistributionCenterStockView item in stockReport) { Medication med = medicationDao.GetMedication(item.ItemID); item.ItemName = med.Description; item.Total = (item.Quantity * med.Value.Value); totalItems += item.Quantity; totalValue += item.Total; } GUIView.Items = stockReport; GUIView.TotalQuantity = totalItems; GUIView.TotalValue = totalValue; return GUIView; }
public ActionResult DistributionCenterStock(DistributionCenterStockGUIView center) { centerID = center.CenterID; ListDistributionCenters(); return View(reportService.GenerateDistributionCenterStock(centerID)); }