コード例 #1
0
        // GET: Home
        public ActionResult Index()
        {
            if ((int)Session["UserId"] == 0)
            {
                return(RedirectToAction("Index", "User"));
            }
            Session["PageName"] = "MyList";

            HomeIndexViewModel user = new HomeIndexViewModel();

            user.UserId         = (int)Session["UserId"];
            user.ShowItemNumber = 10;
            user.ItemStart      = 0;
            user.PickUpNewPassword();


            List <ShowList> NewUser = new List <ShowList>();

            foreach (var i in user.ShowNewPassword)
            {
                NewUser.Add(i);
            }

            return(View(NewUser));
        }
コード例 #2
0
        public ActionResult Index(int FlipPage)
        {
            if ((int)Session["UserId"] == 0)
            {
                return(RedirectToAction("Index", "User"));
            }

            HomeIndexViewModel user = new HomeIndexViewModel();

            user.UserId         = (int)Session["UserId"];
            user.ShowItemNumber = 10;
            user.ComputPageCount();
            int SessionNumber = (int)Session["PageIndex"];

            if ((FlipPage > 0) && (SessionNumber + 1 >= user.PageCount))
            {
                FlipPage = 0;
            }
            if ((FlipPage < 0) && (SessionNumber - 1 < 0))
            {
                FlipPage = 0;
            }
            Session["PageIndex"] = SessionNumber + FlipPage;
            user.ItemStart       = (SessionNumber + FlipPage) * 10;
            user.PickUpNewPassword();


            List <ShowList> NewUser = new List <ShowList>();

            foreach (var i in user.ShowNewPassword)
            {
                NewUser.Add(i);
            }

            return(View(NewUser));
        }