コード例 #1
0
        public ActionResult AddToWishList(int id)
        {
            BOOK book = BookModel.FilterBook(id);

            if (book == null)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            if (!WishListModel.Exist(id, loginSession.AuthenticatedUser().USERID))
            {
                WishListModel.AddToWishList(id, loginSession.AuthenticatedUser().USERID);
            }

            return(Json(WishListModel.CountWishList(loginSession.AuthenticatedUser().USERID), JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public static bool AddView(int bookid)
        {
            SessionHandler loginSession = new SessionHandler();

            if (loginSession.AuthenticatedUser() == null)
            {
                return(Service.AddAnonymousView(bookid, -1));
            }
            else
            {
                return(Service.AddAnonymousView(bookid, (new SessionHandler()).AuthenticatedUser().USERID));
            }
        }
コード例 #3
0
        // GET: Profile
        public ActionResult EditProfile()
        {
            if (loginSession.AuthenticatedUser() == null)
            {
                return(RedirectToAction("Login", "Authentication"));
            }
            USER user = AuthenticationModel.FindUser(loginSession.AuthenticatedUser().USERID);

            return(View(user));
        }