示例#1
0
        public IActionResult Update(Person person)
        {
            PeopleDb db = new PeopleDb(_connectionString);

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

            db.Update(person);

            return(Redirect("/people/index"));
        }
示例#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"));
        }
示例#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");
 }
示例#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"));
        }