Пример #1
0
 /// <summary>
 /// 获取游戏团内最新加入的成员列表(未审批之前)
 /// </summary>
 /// <param name="gId">游戏团编号</param>
 /// <param name="top">获取成员个数</param>
 /// <returns></returns>
 public GroupMemberData GetNewGroupMembers(int gId)
 {
     var memberlist = this.GroupMemberRepository.Where(t => t.gId == gId && t.state == false);
     var count = memberlist.Count();
     var datas = memberlist.OrderByDescending(x=>x.revTime);
     IList<ViewGroupMemberData> list = new List<ViewGroupMemberData>();
     Kt.Framework.User.UserOnline online = new Kt.Framework.User.UserOnline();
     foreach (var item in datas)
     {
         ViewGroupMemberData vm = new ViewGroupMemberData()
         {
             uid = Convert.ToDecimal(item.myUid),
             nickname = this._MemberServices.getNickByUid(Convert.ToDecimal(item.myUid)),
             face_Small = this._MemberServices.GetAvatarImage(Convert.ToDecimal(item.myUid), DS.Web.UCenter.AvatarSize.Small, DS.Web.UCenter.AvatarType.Virtual),
             revTime=(DateTime)item.revTime,
             UserType = this._GroupServices.CheckManageRight(gId, Convert.ToDecimal(item.myUid)),
             GroupUserName = item.GroupUserName,
             GroupUserImg = item.GroupUserImg,
             UserGroupGradeName = GetUserGroupGradeName(gId, item.GradeId)
         };
         list.Add(vm);
     }
     var vd = new GroupMemberData
     {
         ViewGroupMemberData = list,
         count=count,
         UType = this._GroupServices.CheckManageRight(gId, Kt.Framework.User.User.MEMBER_ID)
     };
     return vd;
 }
Пример #2
0
        /// <summary>
        /// 游戏团成员列表
        /// </summary>
        /// <param name="gId">游戏团编号</param>
        /// <param name="pageNo">页码</param>
        /// <param name="pageSize">每页条数</param>
        /// <returns></returns>
        public GroupMemberData GetGroupMembersByGId(int gId, int PageNo = 1, int PageSize = 20,int utype=0)
        {
            IEnumerable<group_member> groupMemberList = null;

            if (utype == 1)
            {
                groupMemberList = this.GroupMemberRepository.Where(t => t.gId == gId && t.state == true && t.uType == 3);
            }
            else
            {
                groupMemberList = this.GroupMemberRepository.Where(t => t.gId == gId && t.state == true);
            }
            var count = groupMemberList.Count();
            var xxxx = groupMemberList.OrderByDescending(x => x.revTime);
            var datas = xxxx.Skip((PageNo - 1) * PageSize).Take(PageSize);
            /* var predicate = PredicateBuilder.True<group_member>();
             predicate.And(t => t.gId == gId && t.state == true);
             if (utype == 1)
             {
                 predicate.And(x=>x.uType!=1);
             }

             var count = this.GroupMemberRepository.Get().Where(predicate).Count();

             var xxxx = from groupMemberList in this.GroupMemberRepository.Table
                        orderby groupMemberList.revTime descending
                        select groupMemberList;
             var datas = xxxx.Where(predicate).Skip((PageNo - 1) * PageSize).Take(PageSize);
             */
            IList<ViewGroupMemberData> list = new List<ViewGroupMemberData>();
            Kt.Framework.User.UserOnline online = new Kt.Framework.User.UserOnline();
            foreach (var item in datas)
            {

                ViewGroupMemberData vm = new ViewGroupMemberData()
                {
                    uid = Convert.ToDecimal(item.myUid),
                    nickname = this._MemberServices.getNickByUid(Convert.ToDecimal(item.myUid)),
                    face_Small = this._MemberServices.GetAvatarImage(Convert.ToDecimal(item.myUid), DS.Web.UCenter.AvatarSize.Small, DS.Web.UCenter.AvatarType.Virtual),
                    UserType = this._GroupServices.CheckManageRight(gId, Convert.ToDecimal(item.myUid)),
                    IsOnLine = online.IsOnLine(Convert.ToDecimal(item.myUid)),
                    relation = Convert.ToInt32(this._PersonalMainPageServices.GetRelation(Convert.ToDecimal(item.myUid))),
                    GroupUserName = item.GroupUserName,
                    GroupUserImg = item.GroupUserImg,
                    revTime = (DateTime)item.revTime,
                    UserGroupGradeName = GetUserGroupGradeName(gId,item.GradeId)
                };
                list.Add(vm);
            }
            var vd = new GroupMemberData
            {
                count = count,
                ViewGroupMemberData = list,
                PageNo = PageNo,
                PageSize = PageSize
            };
            return vd;
        }