Ejemplo n.º 1
0
        public ActionResult DeleteUserFollow(int ID)
        {
            if (User.Identity.IsAuthenticated == false)
            {
                return(Json("You must login to Like", JsonRequestBehavior.AllowGet));
            }
            UserProfile user = UserProfiles_Logic.GetUserProfileByUserName(User.Identity.Name);

            if (Follow_Logic.DeletFollow(user.UserId, ID, 2))
            {
                return(Json("true", JsonRequestBehavior.AllowGet));
            }
            return(Json("false", JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteStoreFollow(int ID)
        {
            if (User.Identity.IsAuthenticated == false)
            {
                return(Json("You must login to Follow", JsonRequestBehavior.AllowGet));
            }
            UserProfile user = UserProfiles_Logic.GetUserProfileByUserName(User.Identity.Name);

            if (Follow_Logic.DeletFollow(user.UserId, ID, 3))
            {
                Store store = db.Stores.Find(ID);
                --store.TotalFollowers;
                db.Entry(store).State = EntityState.Modified;
                db.SaveChanges();

                return(Json("true", JsonRequestBehavior.AllowGet));
            }
            return(Json("false", JsonRequestBehavior.AllowGet));
        }