Пример #1
0
 public int SaveGroupUserName(decimal uid,int gid,string groupusername)
 {
     int rst = 1;
     var list = this.GroupMemberRepository.Where(t=>t.myUid==uid &&t.gId==gid);
     var info = new Kt.GameGroup.Data.group_member();
     if (list != null && list.Count() > 0)
     {
         info = list.First();
         info.GroupUserName = groupusername;
         this.GroupMemberRepository.Update(info);
     }
     else
     {
         rst = 0;
     }
     return rst;
 }
Пример #2
0
 /// <summary>
 /// 用于向 group_member EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTogroup_member(group_member group_member)
 {
     base.AddObject("group_member", group_member);
 }
Пример #3
0
 /// <summary>
 /// 加入游戏团
 /// </summary>
 /// <param name="uid">用户ID</param>
 /// <param name="gId">团ID</param>
 /// <param name="joinPerm">加入方式</param>
 /// <returns>JoinGroup</returns>
 public JoinGroup JoinGameGroup(decimal uid, int gId, int joinPerm)
 {
     if (uid <= 0) return JoinGroup.未登录;
     var join = GroupMemberRepository.First(t => t.myUid == uid && t.gId == gId);
     if (join != null)
     {
         if (join.state == true) return joinstate(true);
         return joinstate(false);
     }
     bool state = false;
     switch (joinPerm)
     {
         case 0: return JoinGroup.禁止加入;
             break;
         case 1: state = true;
             _GroupServices.ChangeGroupPoint(gId, GameGroupPointType.新成员加入);
             break;
         case 2: state = false;
             break;
         default: break;
     }
     if (state)
     {
         _GroupServices.ModifyGroupMemberNum(gId, 1, 1);
     }
     var nickname = this._MemberServices.getNickByUid(uid);
     group_member groupMember = new group_member()
     {
         myUid = uid,
         uType = 3,
         gId = gId,
         state = state,
         revTime = DateTime.Now,
         postNum = 0,
         GradeId = 6,     //加入时默认最低级别hjm
         GroupUserName = nickname,
         GroupUserImg = this._MemberServices.GetAvatarImage(uid, DS.Web.UCenter.AvatarSize.Small, DS.Web.UCenter.AvatarType.Virtual),
     };
     GroupMemberRepository.Add(groupMember);
     //程钢添加发送申请站内信
     if (!state)
     {
         var cap = GroupMemberRepository.Where(p => p.gId == gId && p.uType == 1).SingleOrDefault();
         var cap2 = GroupMemberRepository.Where(p => p.gId == gId && p.uType == 2).SingleOrDefault();
         //var nickname = this._MemberServices.getNickByUid(uid);
         var gname = _GroupServices.getGroupInfo(gId).gName;
         newsServices.SendSysMessage(Convert.ToDecimal(cap.myUid), uid + "@" + nickname + "&" + nickname + "申请加入" + gname + "游戏团,请您审核。<a href='/GameGroup/group/?gid=" + gId + "'>进入游戏团</a>", 5);
         if (cap2 != null)
         {
             newsServices.SendSysMessage(Convert.ToDecimal(cap2.myUid), uid + "@" + nickname + "&" + nickname + "申请加入" + gname + "游戏团,请您审核。<a href='/GameGroup/group/?gid=" + gId + "'>进入游戏团</a>", 5);
         }
     }
     return joinstate(state);
 }
Пример #4
0
 /// <summary>
 /// 创建新的 group_member 对象。
 /// </summary>
 /// <param name="autoId">autoId 属性的初始值。</param>
 /// <param name="postNum">postNum 属性的初始值。</param>
 /// <param name="gradeId">GradeId 属性的初始值。</param>
 public static group_member Creategroup_member(global::System.Int32 autoId, global::System.Int32 postNum, global::System.Int32 gradeId)
 {
     group_member group_member = new group_member();
     group_member.autoId = autoId;
     group_member.postNum = postNum;
     group_member.GradeId = gradeId;
     return group_member;
 }