public ActionResult DeleteConfirmed(int id) { animalData animalData = db.animalData.Find(id); db.animalData.Remove(animalData); db.SaveChanges(); return(RedirectToAction("showForAdopt_part", "aniData", new { id = @User.Identity.GetUserId(), title = "showForAdopt_part" })); }
public ActionResult Edit([Bind(Include = "animalID,animalKind,animalType,animalName,animalAddress,animalDate,animalGender,animalAge,animalColor,animalBirth,animalChip,animalHealthy,animalDisease_Other,animalOwner_userID,animalReason,animalGetter_userID,animalAdopted,animalAdoptedDate,animalNote")] animalData animalData) { if (ModelState.IsValid) { db.Entry(animalData).State = EntityState.Modified; db.SaveChanges(); Session["EditAID"] = animalData.animalID; return(RedirectToAction("Edit", "animalData_Condition", new { id = animalData.animalID })); } return(View(animalData)); }
public ActionResult Create([Bind(Include = "animalID,animalKind,animalType,animalName,animalAddress,animalDate,animalGender,animalAge,animalColor,animalBirth,animalChip,animalHealthy,animalDisease_Other,animalOwner_userID,animalReason,animalGetter_userID,animalAdopted,animalAdoptedDate,animalNote")] animalData animalData) { if (ModelState.IsValid) { db.animalData.Add(animalData); db.SaveChanges(); return(RedirectToAction("Create", "animalData_Condition")); } return(View(animalData)); }
//編輯送養狀態 public ActionResult EditAdopt(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } animalData animalData = db.animalData.Find(id); if (animalData == null) { return(HttpNotFound()); } return(PartialView(animalData)); }