Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id);

            db.CodeingClubTBs.Remove(codeingClubTB);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,ExpDate,Type,StudentId")] CodeingClubTB codeingClubTB)
 {
     if (ModelState.IsValid)
     {
         db.Entry(codeingClubTB).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentId = new SelectList(db.StudentTBs, "Id", "StudentName", codeingClubTB.StudentId);
     return(View(codeingClubTB));
 }
Пример #3
0
        // GET: CodeingClub/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id);

            if (codeingClubTB == null)
            {
                return(HttpNotFound());
            }
            return(View(codeingClubTB));
        }
Пример #4
0
        // GET: CodeingClub/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id);

            if (codeingClubTB == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StudentId = new SelectList(db.StudentTBs, "Id", "StudentName", codeingClubTB.StudentId);
            return(View(codeingClubTB));
        }