Esempio n. 1
0
        public bool AddFriendToGroup(string friendName, string groupName)
        {
            MessageManager mm = new MessageManager();

            bool isExistTheGroupName = mm.IsExistTheGroup(groupName);

            if (!isExistTheGroupName)
            {
                return(false);
            }
            bool isExistTheFriendName = mm.Exist(friendName);

            if (!isExistTheFriendName)
            {
                return(false);
            }

            GroupMembers gm = new GroupMembers();

            gm.GroupName   = groupName;
            gm.GroupMember = friendName;
            gm.IsPass      = true;
            try
            {
                mm.AddFriendToGroup(gm);
            }
            catch (Exception)
            {
                throw;
            }

            return(true);
        }