コード例 #1
0
 public ActionResult Edit([Bind(Include = "ContactId,ContactNumber,Type,PersonId")] Contact contact)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contact).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PersonId = new SelectList(db.People, "PersonId", "FirstName", contact.PersonId);
     return(View(contact));
 }
コード例 #2
0
ファイル: PeopleController.cs プロジェクト: Maham456/NewRepo
 public ActionResult Edit([Bind(Include = "PersonId,FirstName,MiddleName,LastName,DateOfBirth,AddedOn,AddedBy,HomeAddress,HomeCity,FaceBookAccountId,LinkedInId,UpdateOn,ImagePath,TwitterId,EmailId")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AddedBy = new SelectList(db.AspNetUsers, "Id", "Email", person.AddedBy);
     return(View(person));
 }