public ActionResult DeleteConfirmed(int id) { BBMSystem bBMSystem = db.BBMSystems.Find(id); db.BBMSystems.Remove(bBMSystem); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: BBMSystems/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BBMSystem bBMSystem = db.BBMSystems.Find(id); if (bBMSystem == null) { return(HttpNotFound()); } return(View(bBMSystem)); }
public ActionResult Edit([Bind(Include = "BBMSystemId,BBMSName,BloodSampleId,ManagerId,RecipientId,DonorId,DistrictId")] BBMSystem bBMSystem) { if (ModelState.IsValid) { db.Entry(bBMSystem).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ManagerId = new SelectList(db.BloodInventoryManagers, "ManagerId", "Name", bBMSystem.ManagerId); ViewBag.RecipientId = new SelectList(db.BloodRecipients, "RecipientId", "RecipientName", bBMSystem.RecipientId); ViewBag.BloodSampleId = new SelectList(db.BloodSamples, "BloodSampleId", "BloodSampleId", bBMSystem.BloodSampleId); ViewBag.DistrictId = new SelectList(db.Districts, "DistrictId", "Name", bBMSystem.DistrictId); ViewBag.DonorId = new SelectList(db.Donors, "DonorId", "DonorName", bBMSystem.DonorId); return(View(bBMSystem)); }
// GET: BBMSystems/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BBMSystem bBMSystem = db.BBMSystems.Find(id); if (bBMSystem == null) { return(HttpNotFound()); } ViewBag.ManagerId = new SelectList(db.BloodInventoryManagers, "ManagerId", "Name", bBMSystem.ManagerId); ViewBag.RecipientId = new SelectList(db.BloodRecipients, "RecipientId", "RecipientName", bBMSystem.RecipientId); ViewBag.BloodSampleId = new SelectList(db.BloodSamples, "BloodSampleId", "BloodSampleId", bBMSystem.BloodSampleId); ViewBag.DistrictId = new SelectList(db.Districts, "DistrictId", "Name", bBMSystem.DistrictId); ViewBag.DonorId = new SelectList(db.Donors, "DonorId", "DonorName", bBMSystem.DonorId); return(View(bBMSystem)); }