Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NetClubAdvTB netClubAdvTB = db.NetClubAdvTBs.Find(id);

            db.NetClubAdvTBs.Remove(netClubAdvTB);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,TeacherId,JoinDate")] NetClubAdvTB netClubAdvTB)
 {
     if (ModelState.IsValid)
     {
         db.Entry(netClubAdvTB).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeacherId = new SelectList(db.TeacherTBs, "Id", "TeacherName", netClubAdvTB.TeacherId);
     return(View(netClubAdvTB));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "Id,TeacherId,JoinDate")] NetClubAdvTB netClubAdvTB)
        {
            if (ModelState.IsValid)
            {
                db.NetClubAdvTBs.Add(netClubAdvTB);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.TeacherId = new SelectList(db.TeacherTBs, "Id", "TeacherName", netClubAdvTB.TeacherId);
            return(View(netClubAdvTB));
        }
Beispiel #4
0
        // GET: NetClubAdv/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NetClubAdvTB netClubAdvTB = db.NetClubAdvTBs.Find(id);

            if (netClubAdvTB == null)
            {
                return(HttpNotFound());
            }
            return(View(netClubAdvTB));
        }
Beispiel #5
0
        // GET: NetClubAdv/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NetClubAdvTB netClubAdvTB = db.NetClubAdvTBs.Find(id);

            if (netClubAdvTB == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TeacherId = new SelectList(db.TeacherTBs, "Id", "TeacherName", netClubAdvTB.TeacherId);
            return(View(netClubAdvTB));
        }