コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_Aluno tbl_Aluno = db.tbl_Aluno.Find(id);

            db.tbl_Aluno.Remove(tbl_Aluno);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,Nome,Matricula,ID_Curso")] tbl_Aluno tbl_Aluno)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Aluno).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_Curso = new SelectList(db.tbl_Disciplina, "ID", "Disciplina", tbl_Aluno.ID_Curso);
     return(View(tbl_Aluno));
 }
コード例 #3
0
        // GET: Aluno/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Aluno tbl_Aluno = db.tbl_Aluno.Find(id);

            if (tbl_Aluno == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Aluno));
        }
コード例 #4
0
        // GET: Aluno/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Aluno tbl_Aluno = db.tbl_Aluno.Find(id);

            if (tbl_Aluno == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_Curso = new SelectList(db.tbl_Disciplina, "ID", "Disciplina", tbl_Aluno.ID_Curso);
            return(View(tbl_Aluno));
        }