public UserGroupResult Create(UserGroupParam param)
        {
            Data.Entity.UserGroup entity = UserGroupParamConverter.Convert(param, null);
            UserGroupDao.Save(entity);

            return(UserGroupResultConverter.Convert(entity));
        }
Esempio n. 2
0
        public override UserGroupMembership Build()
        {
            if (_createdBy == null)
            {
                _createdBy = Create.A.User();
            }
            if (_userGroup == null)
            {
                _userGroup = Create.A.UserGroup();
            }
            if (_user == null)
            {
                _user = Create.A.User();
            }

            UserGroupMembership membership = new UserGroupMembership(_userGroup,
                                                                     _user,
                                                                     UserGroupMembershipType.Member,
                                                                     new EntityCreatedDto(_createdBy, _createdAt));

            _userGroupDao.Save(membership);
            _userGroupDao.Flush();

            return(membership);
        }
Esempio n. 3
0
        public override UserGroup Build()
        {
            if (_createdBy == null)
            {
                _createdBy = Create.A.User();
            }

            UserGroup userGroup = new UserGroup(new UserGroupDto(_additionalInformation, _name, _accepteedBalance), new EntityCreatedDto(_createdBy, _createdAt));

            _userGroupDao.Save(userGroup);
            _userGroupDao.Flush();
            return(userGroup);
        }
Esempio n. 4
0
        public override Account Build()
        {
            Account account;

            if (_userGroupMembership == null)
            {
                _userGroupMembership = Create.A.UserGroupMembership();
                account = _userGroupMembership.Account;
            }
            else
            {
                account = new Account(_userGroupMembership);
                _userGroupDao.Save(_userGroupMembership.UserGroup);
            }

            return(account);
        }