public DistributionCenterStockGUIView GenerateGlobalStock()
        {
            ICollection <DistributionCenterStockView> stockReport = reportDao.GlobaStock();
            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);
        }
Example #2
0
 public ActionResult DistributionCenterStock(DistributionCenterStockGUIView center)
 {
     centerID = center.CenterID;
     ListDistributionCenters();
     return(View(reportService.GenerateDistributionCenterStock(centerID)));
 }