public ActionResult DeleteConfirmed(string id) { Event_tbl event_tbl = db.Event_tbl.Find(id); db.Event_tbl.Remove(event_tbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Title,Description,ReleaseDate,Type,Ed_Level,CourseID")] Event_tbl event_tbl) { if (ModelState.IsValid) { db.Entry(event_tbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CourseID = new SelectList(db.Course_tbl, "ID", "Name", event_tbl.CourseID); return(View(event_tbl)); }
public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Event_tbl event_tbl = db.Event_tbl.Find(id); if (event_tbl == null) { return(HttpNotFound()); } return(View(event_tbl)); }
public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Event_tbl event_tbl = db.Event_tbl.Find(id); if (event_tbl == null) { return(HttpNotFound()); } ViewBag.CourseID = new SelectList(db.Course_tbl, "ID", "Name", event_tbl.CourseID); return(View(event_tbl)); }
public ActionResult Create(Event_tbl event_tbl) { if (ModelState.IsValid) { event_tbl.ReleaseDate = DateTime.Now; db.Event_tbl.Add(event_tbl); db.SaveChanges(); //Add notification return(RedirectToAction("Create", "Notification", new { mthd = "Index", cntlr = "Event", course_id = event_tbl.ReleaseDate.ToString(), subject = "New Event is added at ", role_not = "Student" })); //return RedirectToAction("Index"); } ViewBag.CourseID = new SelectList(db.Course_tbl, "ID", "Name", event_tbl.CourseID); return(View(event_tbl)); }