public ActionResult DeleteConfirmed(int id)
        {
            AspNetFeedBackForm aspNetFeedBackForm = db.AspNetFeedBackForms.Find(id);

            db.AspNetFeedBackForms.Remove(aspNetFeedBackForm);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: AspNetFeedBackForm/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AspNetFeedBackForm aspNetFeedBackForm = db.AspNetFeedBackForms.Find(id);

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

            if (aspNetFeedBackForm == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FormFor = new SelectList(db.AspNetPTMFormRoles, "Id", "RoleName", aspNetFeedBackForm.FormFor);
            return(View(aspNetFeedBackForm));
        }
        public ActionResult DeleteCnfm(int id)
        {
            AspNetFeedBackForm aspNetFeedBackForm = db.AspNetFeedBackForms.Find(id);

            try
            {
                db.AspNetFeedBackForms.Remove(aspNetFeedBackForm);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                ViewBag.Error   = "It can't be deleted";
                ViewBag.FormFor = new SelectList(db.AspNetPTMFormRoles, "Id", "RoleName", aspNetFeedBackForm.FormFor);

                return(View("Details", aspNetFeedBackForm));
            }
        }
 public ActionResult Edit([Bind(Include = "Id,Question,FormFor")] AspNetFeedBackForm aspNetFeedBackForm)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetFeedBackForm).State = EntityState.Modified;
         db.SaveChanges();
         if (aspNetFeedBackForm.FormFor == 2)
         {
             return(RedirectToAction("ParentForm"));
         }
         else if (aspNetFeedBackForm.FormFor == 1)
         {
             return(RedirectToAction("TeacherForm"));
         }
     }
     ViewBag.FormFor = new SelectList(db.AspNetPTMFormRoles, "Id", "RoleName", aspNetFeedBackForm.FormFor);
     return(View(aspNetFeedBackForm));
 }
        public ActionResult Create([Bind(Include = "Id,Question,FormFor")] AspNetFeedBackForm aspNetFeedBackForm)
        {
            if (ModelState.IsValid)
            {
                aspNetFeedBackForm.SessionID = SessionID;
                db.AspNetFeedBackForms.Add(aspNetFeedBackForm);
                db.SaveChanges();

                if (aspNetFeedBackForm.FormFor == 2)
                {
                    return(RedirectToAction("ParentForm"));
                }
                else if (aspNetFeedBackForm.FormFor == 1)
                {
                    return(RedirectToAction("TeacherForm"));
                }
                return(RedirectToAction("Index"));
            }

            ViewBag.FormFor = new SelectList(db.AspNetPTMFormRoles, "Id", "RoleName", aspNetFeedBackForm.FormFor);
            return(View(aspNetFeedBackForm));
        }