Exemplo n.º 1
0
        public ActionResult Progressbar(int tripId)
        {
            var trip                   = _repo.GetTripByID(tripId);
            int totalTripDays          = (trip.EndDate - trip.StartDate).Days + 1;
            List <TripStatus> statuses = CalcPercentagesTrip(totalTripDays, trip);

            return(PartialView("Progressbar", statuses));
        }
Exemplo n.º 2
0
        private bool LegFitsOnTrip(Leg leg)
        {
            var trip = _repo.GetTripByID(leg.TripId);

            //if leg starts before the trip starts, it fails
            if (trip.StartDate > leg.StartDate)
            {
                return(false);
            }

            //if leg ends after the trip ends, it fails
            if (trip.EndDate < leg.EndDate)
            {
                return(false);
            }

            return(true);
        }