Пример #1
0
        public IActionResult ApplyMB(Vehicle v)
        {
            if (ModelState.IsValid)
            {
                // Add to database

                VehicleDB.Apply(v);
                // Alert successs
                ViewData["Success"] = "Registration was successful!";
                return(View());
            }
            return(View());
        }
Пример #2
0
        public IActionResult Apply(IFormCollection data)
        {
            Vehicle v = new Vehicle()
            {
                FullName = data["full-name"],
                Make     = data["make"],
                Model    = data["model"],
                Year     = Convert.ToInt32(data["year"]),
                Miles    = Convert.ToInt32(data["miles"])
            };

            VehicleDB.Apply(v);
            ViewData["Success"] = "Registration was successful!";
            //ADD TO DATABASE HERE!!!!
            return(View());
        }