Example #1
0
 public ActionResult Edit([Bind(Include = "id,nome,dat_nasc,sexo,email")] pessoa pessoa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pessoa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pessoa));
 }
Example #2
0
 public ActionResult Edit([Bind(Include = "id,id_pessoa,tipo,email1")] email email)
 {
     if (ModelState.IsValid)
     {
         db.Entry(email).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_pessoa = new SelectList(db.pessoa, "id", "nome", email.id_pessoa);
     return(View(email));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "id,id_pessoa,tipo,ddi,ddd,telefone1")] telefone telefone)
 {
     if (ModelState.IsValid)
     {
         db.Entry(telefone).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_pessoa = new SelectList(db.pessoa, "id", "nome", telefone.id_pessoa);
     return(View(telefone));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "id,id_pessoa,numero,endereco1,complemento")] endereco endereco)
 {
     if (ModelState.IsValid)
     {
         db.Entry(endereco).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_pessoa = new SelectList(db.pessoa, "id", "nome", endereco.id_pessoa);
     return(View(endereco));
 }