Exemplo n.º 1
0
        // GET: Mechanic
        public ActionResult Index(string lastName = "")
        {
            var mechanics = MechanicHelper.GetMechanicsByLastName(lastName);

            ViewBag.SearchString = lastName;

            return(View(mechanics));
        }
Exemplo n.º 2
0
        public ActionResult Create(string firstName, string lastName)
        {
            try
            {
                MechanicHelper.InsertNewMechanic(firstName, lastName);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());

                return(View());
            }
        }