コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MainFeed mainFeed = db.MainFeeds.Find(id);

            db.MainFeeds.Remove(mainFeed);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        // 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));
        }