Example #1
0
        // GET: LiaoWeiYing/Home
        public ActionResult Index(int pageIndex = 1, int userID = 0, int id = 1)
        {
            //var idd=Session["name"] as User;
            userID = ((User)(Session["User"])).UserId;
            WebManager dal1  = new WebManager();
            List <web> list1 = dal1.Where(x => x.web_typeID == id && x.web_Condition == "可见").OrderByDescending(x => x.webtime).ToList();

            web_typeManager dal2  = new web_typeManager();
            List <web_type> list2 = dal2.GetAll();

            ViewBag.list2 = list2;


            UserManager dal3  = new UserManager();
            List <User> list3 = dal3.Where(x => x.UserId == userID);

            ViewBag.list3 = list3;



            ReplayTypeManager dal5  = new ReplayTypeManager();
            List <ReplayType> list6 = dal5.GetAll();

            ViewBag.ReplayTypeID = new SelectList(list6, "ReplayTypeID", "ReplayTypeName");


            int pageSize = 3;
            var list4    = list1.Skip((pageIndex - 1) * pageSize)
                           .Take(pageSize).ToList();

            ViewBag.pageIndex = pageIndex;

            return(View(list4));
        }
Example #2
0
        public ActionResult As()
        {
            UserManager dal  = new UserManager();
            List <User> list = dal.GetAll();

            ViewBag.UserId = new SelectList(list, "UserId", "UserName");

            web_typeManager list1 = new web_typeManager();
            List <web_type> dal1  = list1.GetAll();

            ViewBag.web_typeID = new SelectList(dal1, "web_typeID", "web_typeName");

            ReplayTypeManager dal2  = new ReplayTypeManager();
            List <ReplayType> list2 = dal2.GetAll();

            ViewBag.ReplayTypeID = new SelectList(list2, "ReplayTypeID", "ReplayTypeName");
            return(PartialView());
        }