Exemplo n.º 1
0
 public ActionResult Detail(int num)
 {
     var model = new SharingViewModel()
     {
         Sharing_nopage = shd.Get().ToList().Where(a=>a.num == num)
     };
     return View(model);
 }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            int page = (Request.QueryString["page"] != null) ? Convert.ToInt32(Request.QueryString["page"]) : 1;
            double pagesize = 12, count = 0;
            int pagesort = (page - 1) * Convert.ToInt32(pagesize);

            count = Convert.ToDouble(shd.Get().ToList().Count);
            var model = new SharingViewModel()
            {
                Sharing_nopage = shd.Get().ToList().OrderBy(a => a.sort).Skip(pagesort).Take(Convert.ToInt32(pagesize)),
                page = page,
                pages = Convert.ToInt32(Math.Ceiling(count / pagesize))
            };
            return View(model);
        }
Exemplo n.º 3
0
        public ActionResult SharingRead(int page = 1)
        {
            if (!CheckMemberlogin)
            {
                return RedirectToAction("login");
            }
            else
            {
                leftModel();
                var currentpage = page < 1 ? 1 : page;
                var pagesize = 10;

                var model = new SharingViewModel()
                {
                    Sharing = shd.Get().OrderBy(a => a.sort).ToPagedList(currentpage, pagesize),
                };
                return View(model);
            }
        }
Exemplo n.º 4
0
        public ActionResult SharingEdit(int num)
        {
            if (!CheckMemberlogin)
            {
                return RedirectToAction("login");
            }
            else
            {
                leftModel();
                var model = new SharingViewModel()
                {
                    Sharing_nopage = shd.Get().ToList().Where(a => a.num == num)

                };

                return View(model);
            }
        }