public ActionResult Delete(int id = -1)
 {
     if (id == -1)
     {
         return(RedirectToAction("Index"));
     }
     return(View(FeedMachine.FindFeedById(id)));
 }
 public ActionResult Read(int feedItemId = 0)
 {
     if (feedItemId > 0)
     {
         FeedMachine.MarkItemAsRead(feedItemId);
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult UpdateAll(string returnUrl)
        {
            FeedMachine.UpdateAll(User.Identity.Name);

            if (Url.IsLocalUrl(returnUrl))
            {
                return(Redirect(returnUrl));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
Beispiel #4
0
        public ActionResult Login(LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
            {
                // update all of the feeds for this user after each login.
                FeedMachine.UpdateAll(model.UserName);

                return(RedirectToLocal(returnUrl));
            }

            // If we got this far, something failed, redisplay form
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return(View(model));
        }
 public ActionResult Delete(Feed feed)
 {
     FeedMachine.DeleteFeedById(feed.ID);
     return(RedirectToAction("Manage"));
 }
 public ActionResult Create(Feed newFeed)
 {
     newFeed.UserName = User.Identity.Name;
     FeedMachine.CreateNewFeed(newFeed);
     return(RedirectToAction("Index"));
 }
 public ActionResult Search(string searchString = "*")
 {
     return(View(FeedMachine.SearchAll(User.Identity.Name, searchString)));
 }
 public ActionResult Manage()
 {
     return(View(FeedMachine.ListFeedsByUser(User.Identity.Name)));
 }