Ejemplo n.º 1
0
        public Models.PageModels.SuperManModel GetEverydaySuper(int pageno)
        {
            int everydaysupercount = 0;
            int everydaysuperpagesize = 14;
            int everydaysuperpagecount = 0;
            int everydaysuperpageno = 0;
            if (pageno == 0) everydaysuperpageno = 1;
            else everydaysuperpageno = pageno;
            everydaysupercount = Active.SuperMan.SuperFactory.GetEveryDaySuper(0, 0).Count;
            everydaysuperpagecount = everydaysupercount % everydaysuperpagesize == 0 ? (everydaysupercount / everydaysuperpagesize) : (everydaysupercount / everydaysuperpagesize) + 1;
            IList<Active.SuperMan.Super> list = Active.SuperMan.SuperFactory.GetEveryDaySuper(everydaysuperpagesize, everydaysuperpageno);

            List<Models.PageModels.SuperManModel> everydaysupers = new List<Models.PageModels.SuperManModel>();
            foreach (var obj in list) { everydaysupers.Add(new Models.PageModels.SuperManModel(obj, BiZ.MemberManager.MemberManager.GetMember(obj.ToMemberID))); }

            Models.PageModels.SuperManModel model = new Models.PageModels.SuperManModel();
            model.everydaysuperobj = everydaysupers;
            model.everydaysuperpagecount = everydaysuperpagecount;
            model.everydaysuperpageno = everydaysuperpageno;
            model.everydaysuperpagesize = everydaysuperpagesize;
            model.everydaysupercount = everydaysupercount;
            return model;
        }
Ejemplo n.º 2
0
        public Models.PageModels.SuperManModel GetNowSuper(int pageno)
        {
            int nowsupercount = 0;
            int nowsuperpagesize = 5;
            int nowsuperpagecount = 0;
            int nowsuperpageno = 0;
            if (pageno == 0) nowsuperpageno = 1;
            else nowsuperpageno = pageno;
            nowsupercount = Active.SuperMan.SuperFactory.GetSuper(0, 0).Count;
            nowsuperpagecount = nowsupercount % nowsuperpagesize == 0 ? (nowsupercount / nowsuperpagesize) : (nowsupercount / nowsuperpagesize) + 1;
            IList<Active.SuperMan.Super> list = Active.SuperMan.SuperFactory.GetSuper(nowsuperpagesize, nowsuperpageno);

            List<Models.PageModels.SuperManModel> nowsupers = new List<Models.PageModels.SuperManModel>();
            foreach (var obj in list) { nowsupers.Add(new Models.PageModels.SuperManModel(obj, BiZ.MemberManager.MemberManager.GetMember(obj.ToMemberID))); }
            IList<IList<BiZ.InterestCenter.Interest>> nowsuperinterests = new List<IList<BiZ.InterestCenter.Interest>>();
            foreach (var objs in list) { nowsuperinterests.Add(BiZ.InterestCenter.InterestFactory.GetInterestForMember(objs.ToMemberID, 20, 1)); }

            Models.PageModels.SuperManModel model = new Models.PageModels.SuperManModel();
            model.nowsuperobj = nowsupers;
            model.nowsuperinterest = nowsuperinterests;
            model.nowsuperpagecount = nowsuperpagecount;
            model.nowsuperpageno = nowsuperpageno;
            model.nowsuperpagesize = nowsuperpagesize;
            model.nowsupercount = nowsupercount;
            return model;
        }
Ejemplo n.º 3
0
 public ActionResult SuperMan()
 {
     SetMetasVersion();
     String userid = HttpContext.User.Identity.Name;
     Models.PageModels.SuperManModel nowsupermodel = GetNowSuper(1);
     Models.PageModels.SuperManModel everydaysupermodel = GetEverydaySuper(1);
     Models.PageModels.SuperManModel model = new Models.PageModels.SuperManModel();
     model.UserID = User.Identity.Name;
     model.MemberID = User.Identity.Name;
     model.AlreadyLogon = true;
     model.nowsuperobj = nowsupermodel.nowsuperobj;
     model.nowsuperinterest = nowsupermodel.nowsuperinterest;
     model.nowsuperpagecount = nowsupermodel.nowsuperpagecount;
     model.nowsuperpageno = nowsupermodel.nowsuperpageno;
     model.nowsuperpagesize = nowsupermodel.nowsuperpagesize;
     model.nowsupercount = nowsupermodel.nowsupercount;
     model.everydaysuperobj = everydaysupermodel.everydaysuperobj;
     model.everydaysuperpagecount = everydaysupermodel.everydaysuperpagecount;
     model.everydaysuperpageno = everydaysupermodel.everydaysuperpageno;
     model.everydaysuperpagesize = everydaysupermodel.everydaysuperpagesize;
     model.everydaysupercount = everydaysupermodel.everydaysupercount;
     return View(model);
 }