Esempio n. 1
0
 public ActionResult Groups(int? pageIndex)
 {
     ((dynamic) base.ViewBag).Title = "小组搜索";
     string inputString = string.IsNullOrWhiteSpace(base.Request.Params["keyword"]) ? "" : base.Server.UrlDecode(base.Request.Params["keyword"]);
     string sequence = string.IsNullOrWhiteSpace(base.Request.Params["type"]) ? "hot" : base.Request.Params["type"];
     int rec = string.IsNullOrWhiteSpace(base.Request.Params["Rec"]) ? -1 : Globals.SafeInt(base.Request.Params["Rec"], -1);
     inputString = InjectionFilter.Filter(inputString);
     Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups();
     GroupSearch model = new GroupSearch();
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int pageSize = 10;
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = pageIndex.Value * pageSize;
     int totalItemCount = 0;
     totalItemCount = groups.GetCountByKeyWord(inputString, rec);
     int? nullable = pageIndex;
     PagedList<Maticsoft.Model.SNS.Groups> list = new PagedList<Maticsoft.Model.SNS.Groups>(groups.GetGroupListByKeyWord(startIndex, endIndex, sequence, inputString, rec), nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, totalItemCount);
     model.SearchList = list;
     model.RecommandList = groups.GetGroupListByRecommendType(3, EnumHelper.GroupRecommend.Index);
     model.HotList = groups.GetHotGroupList(3);
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView(base.CurrentThemeViewPath + "/Search/GroupList.cshtml", model);
     }
     return base.View(base.CurrentThemeViewPath + "/Search/Groups.cshtml", model);
 }
Esempio n. 2
0
 public PartialViewResult SelfRight()
 {
     new UsersExp();
     new UsersExpModel();
     Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups();
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     Maticsoft.ViewModel.SNS.SelfRight model = new Maticsoft.ViewModel.SNS.SelfRight {
         MyGroups = groups.GetUserJoinGroup(base.currentUser.UserID, 9)
     };
     Maticsoft.BLL.Ms.Regions regions = new Maticsoft.BLL.Ms.Regions();
     new Maticsoft.BLL.SNS.Star();
     model.UserInfo = this.GetUserModel(base.currentUser.UserID);
     string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(model.UserInfo.Address, 0));
     if (regionNameByRID.Contains("北京北京"))
     {
         regionNameByRID = regionNameByRID.Replace("北京北京", "北京");
     }
     else if (regionNameByRID.Contains("上海上海"))
     {
         regionNameByRID = regionNameByRID.Replace("上海上海", "上海");
     }
     else if (regionNameByRID.Contains("重庆重庆"))
     {
         regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆");
     }
     else if (regionNameByRID.Contains("天津天津"))
     {
         regionNameByRID = regionNameByRID.Replace("天津天津", "天津");
     }
     model.UserInfo.Address = string.IsNullOrEmpty(model.UserInfo.Address) ? "暂未设置" : regionNameByRID;
     new Maticsoft.BLL.SNS.AlbumType();
     model.MyAlbum = albums.GetListByUserId(base.currentUser.UserID, base.UserAlbumDetailType);
     return this.PartialView("_SelfRight", model);
 }
Esempio n. 3
0
 public PartialViewResult ProfileLeft(int? uid)
 {
     Maticsoft.BLL.SNS.UserShip ship = new Maticsoft.BLL.SNS.UserShip();
     UsersExp exp = new UsersExp();
     UsersExpModel usersExpModel = new UsersExpModel();
     Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups();
     int userid = uid.HasValue ? uid.Value : ((base.currentUser != null) ? base.currentUser.UserID : 0);
     List<Maticsoft.Model.SNS.UserShip> list = ship.GetToListByFansPage(userid, "", 0, 9);
     List<Maticsoft.Model.SNS.Groups> userJoinGroup = groups.GetUserJoinGroup(userid, 9);
     List<Maticsoft.Model.SNS.Groups> modelList = groups.GetModelList("CreatedUserId=" + userid);
     usersExpModel = exp.GetUsersExpModel(userid);
     ((dynamic) base.ViewBag).FansCount = (usersExpModel != null) ? usersExpModel.FansCount : 0;
     ((dynamic) base.ViewBag).IsCurrentUser = !uid.HasValue && (base.currentUser != null);
     ((dynamic) base.ViewBag).UserId = userid;
     Maticsoft.ViewModel.SNS.ProfileLeft model = new Maticsoft.ViewModel.SNS.ProfileLeft {
         joingroupList = userJoinGroup,
         shipList = list,
         creategroupList = modelList
     };
     return this.PartialView("_ProfileLeft", model);
 }