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

            db.symptomtables.Remove(symptomtable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,symptom,remedy")] symptomtable symptomtable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(symptomtable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(symptomtable));
 }
        public ActionResult Create([Bind(Include = "id,symptom,remedy")] symptomtable symptomtable)
        {
            if (ModelState.IsValid)
            {
                db.symptomtables.Add(symptomtable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(symptomtable));
        }
        // GET: /AdSymptom/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            symptomtable symptomtable = db.symptomtables.Find(id);

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

            if (symptomtable == null)
            {
                return(HttpNotFound());
            }

            var allcat = (from e in db.RemedyTables select e).ToList();

            var getremname = (from e in db.RemedyTables where e.id == symptomtable.remedy select e).FirstOrDefault();

            ViewBag.catname = getremname;

            ViewBag.cat = allcat;


            return(View(symptomtable));
        }