public IActionResult Update(Person person) { PeopleDb db = new PeopleDb(_connectionString); db.Update(person); return(Redirect("/postdemo/showpeople")); }
public ActionResult Update(Person person) { PeopleDb db = new PeopleDb(_connectionString); db.Update(person); return(Redirect("/people/index")); }
public ActionResult Edit(string name, string address, int customerId) { var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True"); Customer c = new Customer(); c.Name = name; c.Address = address; c.Id = customerId; db.Update(c); return(RedirectToAction("Index")); }
public ActionResult Edit(int personId, string firstName, string lastName, int? age) { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); Person p = new Person { FirstName = firstName, LastName = lastName, Age = age, Id = personId }; db.Update(p); return RedirectToAction("Index"); }
public ActionResult Edit(int personId, string firstName, string lastName, int?age) { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); Person p = new Person { FirstName = firstName, LastName = lastName, Age = age, Id = personId }; db.Update(p); return(RedirectToAction("Index")); }