// GET: Mechanic public ActionResult Index(string lastName = "") { var mechanics = MechanicHelper.GetMechanicsByLastName(lastName); ViewBag.SearchString = lastName; return(View(mechanics)); }
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()); } }