Exemple #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            if ((string)Session["Accesslevel"] != "Admin")
            {
                return(RedirectToAction("Index", "Home"));
            }
            tbintake tbintake = db.tbintakes.Find(id);

            db.tbintakes.Remove(tbintake);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ClassID,ProgramID")] tbintake tbintake)
 {
     if ((string)Session["Accesslevel"] != "Admin")
     {
         return(RedirectToAction("Index", "Home"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(tbintake).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProgramID = new SelectList(db.tbprograms, "ProgramID", "Name", tbintake.ProgramID);
     return(View(tbintake));
 }
Exemple #3
0
        // GET: Intake/Details/5
        public ActionResult Details(string id)
        {
            if ((string)Session["Accesslevel"] != "Admin")
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbintake tbintake = db.tbintakes.Find(id);

            if (tbintake == null)
            {
                return(HttpNotFound());
            }
            return(View(tbintake));
        }
Exemple #4
0
        // GET: Intake/Edit/5
        public ActionResult Edit(string id)
        {
            if ((string)Session["Accesslevel"] != "Admin")
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbintake tbintake = db.tbintakes.Find(id);

            if (tbintake == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProgramID = new SelectList(db.tbprograms, "ProgramID", "Name", tbintake.ProgramID);
            return(View(tbintake));
        }