/// <summary> /// Displays the Application Administration home page /// </summary> /// <returns></returns> public ActionResult Index() { if (!authorize()) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.Unauthorized)); } var model = new ViewModels.dashViewModel(); model.countBikes = context.Bike.Where(b => !b.isArchived).Count(); model.countAvailableBikes = context.Bike.Where(b => !b.isArchived).ToList().Where(b => b.isAvailable()).Count(); model.countCharges = context.Charge.Count(); model.countCheckouts = context.CheckOut.Count(); model.countMaintenance = context.MaintenanceEvent.Count(); model.countOngoingMaintenance = context.MaintenanceEvent.Where(m => m.timeResolved == null).Count(); model.countRacks = context.BikeRack.Where(r => !r.isArchived).Count(); model.countInspections = context.Inspection.Count(); model.countUsers = context.BikeUser.Where(a => !a.isArchived).Count(); return(View(model)); }
/// <summary> /// Displays the Application Administration home page /// </summary> /// <returns></returns> public ActionResult Index() { if (!authorize()) { return new HttpStatusCodeResult(System.Net.HttpStatusCode.Unauthorized); } var model = new ViewModels.dashViewModel(); model.countBikes = context.Bike.Where(b => !b.isArchived).Count(); model.countAvailableBikes = context.Bike.Where(b => !b.isArchived).ToList().Where(b => b.isAvailable()).Count(); model.countCharges = context.Charge.Count(); model.countCheckouts = context.CheckOut.Count(); model.countMaintenance = context.MaintenanceEvent.Count(); model.countOngoingMaintenance = context.MaintenanceEvent.Where(m => m.timeResolved == null).Count(); model.countRacks = context.BikeRack.Where(r => !r.isArchived).Count(); model.countInspections = context.Inspection.Count(); model.countUsers = context.BikeUser.Where(a => !a.isArchived).Count(); return View(model); }