public ActionResult DeleteConfirmed(int id) { Animal_Treatment animal_Treatment = db.Animal_Treatment.Find(id); db.Animal_Treatment.Remove(animal_Treatment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Treat_ID,Animal_ID,Treat_StartDate,Treat_EndDate,Treat_Quantity,Treat_Regularity,Treat_Name,Treat_cost,Comment,Id")] Animal_Treatment animal_Treatment) { if (ModelState.IsValid) { db.Entry(animal_Treatment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Animal_ID = new SelectList(db.Animals, "Animal_ID", "Animal_Image", animal_Treatment.Animal_ID); ViewBag.Id = new SelectList(db.Mecidal_Card, "Id", "Diagnosis_Details", animal_Treatment.Id); return(View(animal_Treatment)); }
// GET: Animal_Treatment/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Animal_Treatment animal_Treatment = db.Animal_Treatment.Find(id); if (animal_Treatment == null) { return(HttpNotFound()); } return(View(animal_Treatment)); }
// GET: Animal_Treatment/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Animal_Treatment animal_Treatment = db.Animal_Treatment.Find(id); if (animal_Treatment == null) { return(HttpNotFound()); } ViewBag.Animal_ID = new SelectList(db.Animals, "Animal_ID", "Animal_Image", animal_Treatment.Animal_ID); ViewBag.Id = new SelectList(db.Mecidal_Card, "Id", "Diagnosis_Details", animal_Treatment.Id); return(View(animal_Treatment)); }