Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Alunos_Professores alunos_Professores = db.Alunos_Professores.Find(id);

            db.Alunos_Professores.Remove(alunos_Professores);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "IDFKAlunosProfessores,IDAluno,IDProfessor")] Alunos_Professores alunos_Professores)
 {
     if (ModelState.IsValid)
     {
         db.Entry(alunos_Professores).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IDAluno     = new SelectList(db.alunos, "Matricula", "Nome", alunos_Professores.IDAluno);
     ViewBag.IDProfessor = new SelectList(db.professores, "Senha", "Nome", alunos_Professores.IDProfessor);
     return(View(alunos_Professores));
 }
Exemplo n.º 3
0
        // GET: Alunos_Professores/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Alunos_Professores alunos_Professores = db.Alunos_Professores.Find(id);

            if (alunos_Professores == null)
            {
                return(HttpNotFound());
            }
            return(View(alunos_Professores));
        }
Exemplo n.º 4
0
        // GET: Alunos_Professores/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Alunos_Professores alunos_Professores = db.Alunos_Professores.Find(id);

            if (alunos_Professores == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IDAluno     = new SelectList(db.alunos, "Matricula", "Nome", alunos_Professores.IDAluno);
            ViewBag.IDProfessor = new SelectList(db.professores, "Senha", "Nome", alunos_Professores.IDProfessor);
            return(View(alunos_Professores));
        }