コード例 #1
0
        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;
        }
コード例 #2
0
 public ActionResult DistributionCenterStock(DistributionCenterStockGUIView center)
 {
     centerID = center.CenterID;
     ListDistributionCenters();
     return View(reportService.GenerateDistributionCenterStock(centerID));
 }