Exemple #1
0
        // 根据邀请码注册,需要加为好友
        public static void ProcessFriend(User newRegUser, MvcContext ctx)
        {
            IInviteService inviteService = new InviteService();
            IFriendService friendService = new FriendService();

            int friendId = ctx.PostInt("friendId");

            if (friendId <= 0)
            {
                return;
            }

            String friendCode = ctx.Post("friendCode");

            Result result = inviteService.Validate(friendId, friendCode);

            if (result.HasErrors)
            {
                return;
            }

            friendService.AddInviteFriend(newRegUser, friendId);
        }