public ActionResult Edit(int pid) { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); Person person = db.GetById(pid); return(View(person)); }
public ActionResult Edit(int id) { PeopleDb db = new PeopleDb(_connectionString); Person person = db.GetById(id); if (person == null) { return(Redirect("/people/index")); } EditPersonViewModel vm = new EditPersonViewModel { Person = person }; return(View(vm)); }
public ActionResult Edit(int pid) { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); Person person = db.GetById(pid); return View(person); }