public ActionResult KameraOversigt()
        {
            DBAccessVehicles dbcars    = new DBAccessVehicles();
            Vehicle          LatestCar = dbcars.GetAllLatestVehiclesFromLatestDate()[0];

            ViewBag.HEYHEYSIMON = dbcars.GetVehiclesForMapOverview();

            return(View());
        }
        public JsonResult GenerateTestDataVehicles()
        {
            DBAccessVehicles testData = new DBAccessVehicles();

            testData.GenerateTestDataVehicles();
            List <Vehicle>       vehicle      = dbVehicles.GetAllLatestVehiclesFromLatestDate();
            IEnumerable <int>    selectAmount = SelectVehicleAmount(vehicle);
            IEnumerable <string> selectHour   = SelectHourStampStrings(vehicle, "Dato", true);
            IEnumerable <string> selectDay    = SelectCurrentDays(vehicle);

            return(Json(new { countSelect = selectAmount, hourSelect = selectHour, daySelect = selectDay }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Index()
        {
            DBAccessVehicles     dbvehicles    = new DBAccessVehicles();
            IEnumerable <int>    VehicleAmount = null;
            IEnumerable <string> HourStamp     = null;
            string TypeName  = null;
            string DateStamp = null;

            List <Vehicle> latestVehicles = dbvehicles.GetAllLatestVehiclesFromLatestDate();
            List <string>  Hours          = new List <string>();

            //måske til senere.
            //var VehicleAmount = vehicles.Select(x => x.VehicleAmount).OrderBy(x => x).ToArray()
            int Amount = 0;

            VehicleAmount = SelectVehicleAmount(latestVehicles);
            HourStamp     = SelectHourStampStrings(latestVehicles, "Dato", true);
            DateStamp     = latestVehicles[latestVehicles.Count - 1].DateTime;
            foreach (var item in HourStamp)
            {
                Hours.Add(item);
            }

            /*
             * foreach (var item in DateStamp)
             * {
             *  Amount++;
             * }
             */

            ViewBag.CARCOUNT    = VehicleAmount;
            ViewBag.CURRENTHOUR = Hours;
            ViewBag.DateStamp   = DateTime.Now.ToString();
            ViewBag.AMOUNT      = Amount;
            ViewBag.LOGGEDIN    = false;
            ViewBag.VEHICLETYPE = TypeName;

            return(View(latestVehicles));
        }