public ActionResult DeleteConfirmed(int id)
        {
            training_sessions training_sessions = db.training_sessions.Find(id);

            db.training_sessions.Remove(training_sessions);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,trainingterms_id,session_date,attendance_number,session_closed,start_time,end_time")] training_sessions training_sessions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(training_sessions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.trainingterms_id = new SelectList(db.training_terms, "ID", "term_title", training_sessions.trainingterms_id);
     return(View(training_sessions));
 }
        // GET: sessions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            training_sessions training_sessions = db.training_sessions.Find(id);

            if (training_sessions == null)
            {
                return(HttpNotFound());
            }
            return(View(training_sessions));
        }
        // GET: sessions/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            training_sessions training_sessions = db.training_sessions.Find(id);

            if (training_sessions == null)
            {
                return(HttpNotFound());
            }
            ViewBag.trainingterms_id = new SelectList(db.training_terms, "ID", "term_title", training_sessions.trainingterms_id);
            return(View(training_sessions));
        }