public IActionResult Update(Person person)
        {
            PeopleDb db = new PeopleDb(_connectionString);

            db.Update(person);
            return(Redirect("/postdemo/showpeople"));
        }
Example #2
0
        public ActionResult Update(Person person)
        {
            PeopleDb db = new PeopleDb(_connectionString);

            db.Update(person);

            return(Redirect("/people/index"));
        }
Example #3
0
        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"));
        }
Example #4
0
 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");
 }
Example #5
0
        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"));
        }