Beispiel #1
0
        public IActionResult Car(string vrm)
        {
            vrm = vrm.Replace(" ", "");

            ViewData["Car"] = VehicleProvider.getVehicleFromVRM(vrm);

            try
            {
                ViewData["DVLACar"] = VehicleProvider.getDVLADetails(vrm);
            }
            catch
            {
                ViewData["DVLACar"] = new DVLAData();
            }

            ViewData["vrm"] = vrm;

            return(View());
        }
Beispiel #2
0
        public IActionResult AddVehicle(string vrm)
        {
            if (!isAuthenticated())
            {
                return(RedirectToAction("Login", "Auth"));
            }

            vrm = vrm.Replace(" ", "");

            try
            {
                ViewData["DVLADetails"] = VehicleProvider.getDVLADetails(vrm);
            }
            catch
            {
                ViewData["DVLADetails"] = new DVLAData();
            }

            ViewData["vrm"] = vrm;

            return(View());
        }