Пример #1
0
        public ActionResult Create(Person person)
        {
            if (ModelState.IsValid)
            {
                db.People.Add(person);
                db.SaveChanges();
                return RedirectToAction("Detail/"+ person.EntryId,"Book");
            }

            return View(person);
        }
Пример #2
0
 //
 // GET: /Person/Create
 public ActionResult Create(int bookid)
 {
     Person p = new Person();
     p.EntryId = bookid;
     return View(p);
 }
Пример #3
0
 public ActionResult Edit(Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(person);
 }