public ValueInTransitView TransitRecord() { ICollection<Package> transitRecord = reportDao.PackageTypesList(StockType.InTransit); //receive all packages in transit ValueInTransitView GUIView = new ValueInTransitView(); int totalItems = 0; double totalValue = 0; foreach (Package pack in transitRecord) { totalItems += pack.Medication.Quantity.Value; totalValue += pack.Medication.Value.Value * pack.Medication.Quantity.Value; } GUIView.Items = transitRecord; GUIView.TotalQuantity = totalItems; GUIView.TotalValue = totalValue; return GUIView; }
public ActionResult DoctorActivity(ValueInTransitView doc) { ListDoctors(); return View(reportService.DoctorActivity(doc.DoctorID)); }
public ValueInTransitView DoctorActivity(int docID) { ICollection<Package> doctorRecord = reportDao.PackageByUser(docID, StockType.Distributed); ValueInTransitView GUIView = new ValueInTransitView(); int totalItems = 0; double totalValue = 0; foreach (Package pack in doctorRecord) { totalItems += pack.Medication.Quantity.Value; totalValue += pack.Medication.Value.Value * pack.Medication.Quantity.Value; } GUIView.Items = doctorRecord; GUIView.TotalQuantity = totalItems; GUIView.TotalValue = totalValue; return GUIView; }