public ActionResult Create(ConditionSymptom conditionsymptom)
        {
            if (ModelState.IsValid)
            {
                conditionsymptom.ID = Guid.NewGuid();
                db.WellCastConditionSymptoms.Add(conditionsymptom);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ConditionID = new SelectList(db.WellCastConditions, "ID", "KeyName", conditionsymptom.ConditionID);
            ViewBag.SymptomID = new SelectList(db.WellCastSymptoms, "ID", "SymptomCategoryID", conditionsymptom.SymptomID);
            return View(conditionsymptom);
        }
        // POST api/ConditionSymptoms
        public HttpResponseMessage PostConditionSymptom(ConditionSymptom conditionsymptom)
        {
            if (ModelState.IsValid)
            {
                db.WellCastConditionSymptoms.Add(conditionsymptom);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, conditionsymptom);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = conditionsymptom.ID }));
                return response;
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
 public ActionResult Edit(ConditionSymptom conditionsymptom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(conditionsymptom).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ConditionID = new SelectList(db.WellCastConditions, "ID", "KeyName", conditionsymptom.ConditionID);
     ViewBag.SymptomID = new SelectList(db.WellCastSymptoms, "ID", "SymptomCategoryID", conditionsymptom.SymptomID);
     return View(conditionsymptom);
 }
        // PUT api/ConditionSymptoms/5
        public HttpResponseMessage PutConditionSymptom(Guid id, ConditionSymptom conditionsymptom)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != conditionsymptom.ID)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }

            db.Entry(conditionsymptom).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }