protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }

                CanDashboardServices canDasboardServices = new CanDashboardServices();
                infringementList = canDasboardServices.GetDriverOverReving(timePeriod.StartDate, timePeriod.EndDate, null);
                infringementList.Sort(delegate(InfringementCount ic1, InfringementCount ic2) { return(ic2.Count.CompareTo(ic1.Count)); });
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }

                fleetIdlingTime = DashboardDataAccess.getFleetIdling(timePeriod.StartDate, timePeriod.EndDate);
                if (fleetIdlingTime > 20)
                {
                    fleetIdlingTime = 20;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }

                CanDashboardServices canDasboardServices = new CanDashboardServices();
                fuelConsumptionList = canDasboardServices.GetDriverFuelConsumption(timePeriod.StartDate, timePeriod.EndDate, null);
                fuelConsumptionList.Sort(delegate(FuelConsumption fc2, FuelConsumption fc1) { return(fc2.MPG.CompareTo(fc1.MPG)); });
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }
                ordersByStateDS = GetDataSimple(timePeriod.StartDate, timePeriod.EndDate);
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }

                CanDashboardServices canDasboardServices = new CanDashboardServices();
                idlingTimeList = canDasboardServices.GetDriverIdlingTime(timePeriod.StartDate, timePeriod.EndDate, null);
                idlingTimeList.Sort(delegate(IdlingTime it1, IdlingTime it2) { return(it2.IdlingSeconds.CompareTo(it1.IdlingSeconds)); });
            }
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Attributes["mode"] != null)
            {
                int         mode       = int.Parse(this.Attributes["mode"]);
                TimePeriods timePeriod = new TimePeriods();
                switch (mode)
                {
                case 1:
                    timePeriod.SetLast30Days();
                    break;

                case 2:
                    timePeriod.SetWeekDays();
                    break;

                case 3:
                    timePeriod.SetMonthDays();
                    break;

                case 4:
                    timePeriod.SetYearDays();
                    break;
                }

                CanDashboardServices canDasboardServices = new CanDashboardServices();
                fuelConsumptionList = canDasboardServices.GetVehicleFuelConsumption(timePeriod.StartDate, timePeriod.EndDate, null);
                double mpgTotal = 0;
                double litres   = 0;
                foreach (FuelConsumption fuelConsumption in fuelConsumptionList)
                {
                    mpgTotal += fuelConsumption.MPG;
                    litres   += fuelConsumption.FuelLitres;
                }
                if (fuelConsumptionList.Capacity == 0)
                {
                    fleetFuelConsumption = 0;
                    litres = 0;
                }
                else
                {
                    fleetFuelConsumption = mpgTotal / fuelConsumptionList.Capacity;
                    if (fleetFuelConsumption > 20)
                    {
                        fleetFuelConsumption = 20;
                    }
                    fleetFuelLitres = litres / fuelConsumptionList.Capacity;
                }
            }
        }