public ActionResult DeleteConfirmed(int id) { MainFeed mainFeed = db.MainFeeds.Find(id); db.MainFeeds.Remove(mainFeed); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MainFeedID,ProviderPostID,CharityPostID,TransportPostID")] MainFeed mainFeed) { if (ModelState.IsValid) { db.Entry(mainFeed).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CharityPostID = new SelectList(db.CharityPosts, "CharityPostID", "FoodRequested", mainFeed.CharityPostID); ViewBag.ProviderPostID = new SelectList(db.ProviderPosts, "ProviderPostID", "FoodType", mainFeed.ProviderPostID); ViewBag.TransportPostID = new SelectList(db.TransportPosts, "TransportPostID", "Message", mainFeed.TransportPostID); return(View(mainFeed)); }
// GET: MainFeeds/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MainFeed mainFeed = db.MainFeeds.Find(id); if (mainFeed == null) { return(HttpNotFound()); } return(View(mainFeed)); }
// GET: MainFeeds/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MainFeed mainFeed = db.MainFeeds.Find(id); if (mainFeed == null) { return(HttpNotFound()); } ViewBag.CharityPostID = new SelectList(db.CharityPosts, "CharityPostID", "FoodRequested", mainFeed.CharityPostID); ViewBag.ProviderPostID = new SelectList(db.ProviderPosts, "ProviderPostID", "FoodType", mainFeed.ProviderPostID); ViewBag.TransportPostID = new SelectList(db.TransportPosts, "TransportPostID", "Message", mainFeed.TransportPostID); return(View(mainFeed)); }