예제 #1
0
        public ActionResult Edit(int pid)
        {
            var    db     = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString);
            Person person = db.GetById(pid);

            return(View(person));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public ActionResult Edit(int pid)
 {
     var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString);
     Person person = db.GetById(pid);
     return View(person);
 }