Пример #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;
 }
Пример #2
0
 public ActionResult Edit(int id, EditKidViewModel model)
 {
     _homeAdapter.SaveKidViewModel(id, model);
     return RedirectToAction("Index");
 }
Пример #3
0
 public ActionResult Edit(int id)
 {
     EditKidViewModel model = new EditKidViewModel();
     model = _homeAdapter.GetEditKidViewModel(id);
     return View(model);
 }
Пример #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();
 }