コード例 #1
0
        //
        // GET: /Profile/Details/5

        public ActionResult Details(int id = 0)
        {
            UserProfile user = db.UserProfiles.Find(id);

            if (user == null)
            {
                ViewBag.Message = "User not found.";
                return(View("Error"));
            }
            Profile profile = user.Profile;

            if (profile == null)
            {
                return(HttpNotFound());
            }
            // Get List Follow
            List <UserProfile> listfollow = Follow_Logic.GetFollowingUsersOfType(2, id, 5);

            ViewBag.listfollow = listfollow;

            ViewBag._user = user;
            // Get list store follow
            List <Store> liststore = Account_Logic.GetListStoreFollowByUser(id);

            ViewBag.liststore = liststore;

            // Get list product like
            List <Product> listpro = Account_Logic.GetListProductLikeByUser(id);

            ViewBag.listpro = listpro;
            return(View(profile));
        }
コード例 #2
0
        //
        // GET: /Store/Details/5

        public ActionResult Details(int id = 0)
        {
            Store store = db.Stores.Find(id);

            if (store == null)
            {
                return(HttpNotFound());
            }
            if (store.StatusId == Constant.STATUS_BANNED || store.StatusId == Constant.STATUS_INACTIVE)
            {
                ViewBag.Message = "Sorry, this store is not available.";
                return(View("Error"));
            }
            if (store.StatusId == Constant.STATUS_PENDING)
            {
                ViewBag.Message = "Sorry, this store is waiting arropve by admin";
                return(View("Error"));
            }
            if (User.Identity.IsAuthenticated != false)
            {
                UserProfile user = UserProfiles_Logic.GetUserProfileByUserName(User.Identity.Name);
                ViewBag.detailuser = user;
            }
            else
            {
                ViewBag.detailuser = null;
            }
            List <UserProfile> listprofile = new List <UserProfile>();

            listprofile         = Follow_Logic.GetFollowingUsersOfType(3, id, 5);
            ViewBag.listprofile = listprofile;
            return(View(store));
        }