public ActionResult DeleteConfirmed(int id)
        {
            GrammaQuestion grammaQuestion = db.GrammaQuestions.Find(id);

            db.GrammaQuestions.Remove(grammaQuestion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,GrammaCategory,EslLevel,Body,Answer")] GrammaQuestion grammaQuestion)
 {
     if (ModelState.IsValid)
     {
         grammaQuestion.ModifiedAt      = DateTime.Now;
         db.Entry(grammaQuestion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grammaQuestion));
 }
        // GET: Questions/GrammaQuestions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrammaQuestion grammaQuestion = db.GrammaQuestions.Find(id);

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

            if (grammaQuestion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GrammaCategories = db.GrammaCategories.Select(g => g.GrammaCategoryName).ToList();
            ViewBag.EslLevels        = db.EslLevels.Select(e => e.EslLevelName).ToList();
            return(View(grammaQuestion));
        }