Ejemplo n.º 1
0
        public ActionResult Create(MechanicModel model)
        {
            try
            {
                var mechanic = new Core.Model.Mechanic();
                mechanic.FirstName = model.FirstName;
                mechanic.LastName = model.LastName;

                MechanicsManager.GetManager().Add(mechanic);

                return RedirectToAction("Index");
            }
            catch
            {
                return View(model);
            }
        }
Ejemplo n.º 2
0
        public ActionResult Edit(MechanicModel model)
        {
            try
            {
                var part = MechanicsManager.GetManager().Get(model.Id);
                part.FirstName = model.FirstName;
                part.LastName = model.LastName;

                MechanicsManager.GetManager().Update(part);

                return RedirectToAction("Index");
            }
            catch
            {
                return View(model);
            }
        }