Esempio n. 1
0
        public ActionResult Redid(int?page, int?sectionid, string search)
        {
            int pageSize = 8;
            int pageNum  = (page ?? 1);
            var redsopt  = BraveManage.FindAllSpots();

            if (!String.IsNullOrEmpty(search))
            {
                redsopt = redsopt.Where(a => a.RedSpotsName.Contains(search) || a.RedArea.Contains(search) || a.Location.Contains(search));
            }
            if (sectionid >= 1)
            {
                redsopt = redsopt.Where(a => a.RedSection_id == sectionid);
            }


            ViewBag.id = sectionid;
            if (Request.IsAjaxRequest())

            {
                return(PartialView("Redid", redsopt.OrderBy(a => a.RedSpots_id).ToPagedList(pageNum, pageSize)));
            }
            else
            {
                return(View("Redid", redsopt.OrderBy(a => a.RedSpots_id).ToPagedList(pageNum, pageSize)));
            }
        }
Esempio n. 2
0
        // GET: RedSpots
        public ActionResult Index()
        {
            var section = BraveManage.FindAllSection();
            var redsopt = BraveManage.FindAllSpots();

            ViewModels.Brave index = new ViewModels.Brave();
            index.spots1      = redsopt;
            index.RedSection1 = section;
            return(View(index));
        }
Esempio n. 3
0
        public ActionResult ShareDetails(int id)
        {
            var redsharede1 = BraveManage.FindSharede(id);

            var gengduored = BraveManage.FindAllSpots().OrderByDescending(p => p.RedSpots_id).Take(10);

            ViewBag.name11 = redsharede1.RedSpots.RedSpotsName;
            ViewBag.redid  = redsharede1.RedSpots_id;
            ViewModels.Brave index = new ViewModels.Brave()
            {
                spots1     = gengduored,
                redsharede = redsharede1,
            };
            return(View(index));
        }
Esempio n. 4
0
        // GET: Brave
        public ActionResult Index()
        {
            var news     = BraveManage.FindAllNews().OrderByDescending(p => p.SubmtDate).Take(4);
            var video    = BraveManage.FindAllvideo().OrderByDescending(p => p.MilitaryVideoTime).Take(4);
            var video1   = BraveManage.FindAllvideo1().OrderByDescending(p => p.VideoTime).Take(3);
            var history1 = BraveManage.FindAllhistory().OrderByDescending(p => p.HistoryTime).Take(10);
            var goodss   = GoodsManage.FindAllBooks().OrderByDescending(p => p.Grounding).Take(3);
            var spots    = BraveManage.FindAllSpots().OrderByDescending(p => p.RedSpotsName).Take(3);
            var share    = BraveManage.FindAllShare().OrderByDescending(p => p.RedShareTime).Take(4);

            ViewModels.Brave index = new ViewModels.Brave();
            index.new1    = news;
            index.Video   = video;
            index.Video1  = video1;
            index.history = history1;
            index.Good1   = goodss;
            index.spots1  = spots;
            index.Share   = share;
            return(View(index));
        }
Esempio n. 5
0
        public ActionResult Details(int id)
        {
            var redde      = BraveManage.FindRedId(id);
            var redshare   = BraveManage.FindShareid(id);
            var gengduored = BraveManage.FindAllSpots().OrderByDescending(p => p.RedSpots_id).Take(10);
            var comred     = CommentRedSpotsManage.FindRedCom(id);

            if (redde == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ViewModels.Brave index = new ViewModels.Brave()
            {
                spots1    = gengduored,
                redshare1 = redshare,
                redde1    = redde,
                Commred1  = comred,
            };
            ViewBag.count1 = BraveManage.findcoment(id);
            return(View(index));
        }