Пример #1
0
 public Models.PageModels.InterestForRegModel RegGetInterest(String classid, int nowpageno)
 {
     string userid = User.Identity.Name;
     int interestscount = 0;
     if (classid != null && classid != "")
     {
         interestscount = BiZ.InterestCenter.InterestFactory.GetClassInterest(classid, 0, 0).Count;
     }
     else
     {
         interestscount = BiZ.InterestCenter.InterestFactory.GetAllInterestCount();
     }
     int pagesize = 8;
     int pagecount = interestscount % pagesize == 0 ? (int)(interestscount / pagesize) : (int)(interestscount / pagesize) + 1;
     int pageindex = nowpageno < pagecount ? nowpageno + 1 : 1;
     IList<BiZ.InterestCenter.Interest> interests = new List<BiZ.InterestCenter.Interest>();
     if (classid != null && classid != "")
     {
         interests = BiZ.InterestCenter.InterestFactory.GetClassInterest(classid, pagesize, pageindex);
     }
     else
     {
         interests = BiZ.InterestCenter.InterestFactory.GetInterest("", pagesize, pageindex);
     }
     IList<BiZ.InterestCenter.Interest> interestformember = new List<BiZ.InterestCenter.Interest>();
     IList<BiZ.InterestCenter.Interest> endinterest = new List<BiZ.InterestCenter.Interest>();
     interestformember = BiZ.InterestCenter.InterestFactory.GetMemberInterest(userid, 0, 0);
     foreach (var obj in interests)
     {
         bool ifinsert = true;
         foreach (var objtwo in interestformember)
         {
             if (objtwo.ID == obj.ID) { ifinsert = false; break; }
             else { continue; }
         }
         if (ifinsert) { endinterest.Add(obj); }
     }
     IList<BiZ.InterestCenter.InterestClass> interestclass = BiZ.InterestCenter.InterestFactory.GetAllInterestClass();
     Models.PageModels.InterestForRegModel model = new Models.PageModels.InterestForRegModel(endinterest, pageindex, interestclass);
     return model;
 }
Пример #2
0
 public ActionResult RegGetInterestForLike(String content)
 {
     IList<BiZ.InterestCenter.Interest> interests = BiZ.InterestCenter.InterestFactory.GetTitleInterest(content, 0, 0);
     Models.PageModels.InterestForRegModel model = new Models.PageModels.InterestForRegModel(interests, 0, null);
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Пример #3
0
        public ActionResult RegAddInterest()
        {
            #region metas version
            ViewData["jsversion"] = BiZ.Sys.RunStatus.JsVersion;
            ViewData["cssversion"] = BiZ.Sys.RunStatus.CSSVersion;
            ViewData["imageversion"] = BiZ.Sys.RunStatus.ImageVersion;
            #endregion
            //该session用于豆瓣登录选择性别
            Session.Remove("isDoubanLogin");

            string id = User.Identity.Name;

            BiZ.Member.Member member = BiZ.MemberManager.MemberManager.GetMember(id);
            string memberAllowLogin = CBB.ConfigurationHelper.AppSettingHelper.GetConfig("MemberAllowLogin");
            member.AllowLogin = Convert.ToBoolean(memberAllowLogin);
            BiZ.MemberManager.MemberManager.SaveMember(member);

            long memberInterestCount = BiZ.InterestCenter.InterestFactory.GetMemberInterestCount(member.ID);
            if (memberInterestCount >= 3)
                return RedirectToAction("IFavorerContent", "Content");

            IList<BiZ.InterestCenter.Interest> interestList = GetRegRecommendInterest(1);
            Models.PageModels.InterestForRegModel model = new Models.PageModels.InterestForRegModel(interestList);
            model.UserID = id;
            model.MemberID = id;
            model.AlreadyLogon = true;
            return View(model);
        }