Esempio n. 1
0
 public EditKidViewModel GetEditKidViewModel(int id)
 {
     Kid Kid = db.Kids.Find(id);
     EditKidViewModel model = new EditKidViewModel();
     model.Kid = Kid;
     model.FirstName = Kid.FirstName;
     model.LastName = Kid.LastName;
     return model;
 }
Esempio n. 2
0
 public ActionResult Edit(int id, EditKidViewModel model)
 {
     _homeAdapter.SaveKidViewModel(id, model);
     return RedirectToAction("Index");
 }
Esempio n. 3
0
 public ActionResult Edit(int id)
 {
     EditKidViewModel model = new EditKidViewModel();
     model = _homeAdapter.GetEditKidViewModel(id);
     return View(model);
 }
Esempio n. 4
0
 public void SaveKidViewModel(int id, EditKidViewModel model)
 {
     Kid Kid = db.Kids.Find(id);
     Kid.FirstName = model.FirstName;
     Kid.LastName = model.LastName;
     db.SaveChanges();
 }