public ActionResult Edit([Bind(Include = "CursoID,Descricao")] Curso curso)
 {
     if (ModelState.IsValid)
     {
         db.Entry(curso).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(curso));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MatriculaID,DataMatricula,CursoID,AlunoID")] Matricula matricula)
 {
     if (ModelState.IsValid)
     {
         db.Entry(matricula).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AlunoID = new SelectList(db.Alunos, "ID", "Nome", matricula.AlunoID);
     ViewBag.CursoID = new SelectList(db.Cursos, "CursoID", "Descricao", matricula.CursoID);
     return(View(matricula));
 }