public ActionResult DeleteConfirmed(int id)
        {
            AllergiesName allergiesName = db.AllergiesNames.Find(id);

            db.AllergiesNames.Remove(allergiesName);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,AllergiesID,AllergyTypeID,AllergyName")] AllergiesName allergiesName)
 {
     if (ModelState.IsValid)
     {
         db.Entry(allergiesName).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AllergyTypeID = new SelectList(db.AllergyTypes, "AllergyTypeID", "AllergyTypeName", allergiesName.AllergyTypeID);
     return(View(allergiesName));
 }
        public ActionResult Create([Bind(Include = "id,AllergiesID,AllergyTypeID,AllergyName")] AllergiesName allergiesName)
        {
            if (ModelState.IsValid)
            {
                db.AllergiesNames.Add(allergiesName);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AllergyTypeID = new SelectList(db.AllergyTypes, "AllergyTypeID", "AllergyTypeName", allergiesName.AllergyTypeID);
            return(View(allergiesName));
        }
        // GET: AllergiesNames/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AllergiesName allergiesName = db.AllergiesNames.Find(id);

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

            if (allergiesName == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AllergyTypeID = new SelectList(db.AllergyTypes, "AllergyTypeID", "AllergyTypeName", allergiesName.AllergyTypeID);
            return(View(allergiesName));
        }