예제 #1
0
 public void AddEmailToClub(UserDTO caller, EmailDTO email)
 {
     NullCheck.ThrowArgumentNullEx(caller, email);
     CheckPermission(caller);
     email = email.Id == 0 ? DbEntityExistensChecker.TryGetExistingEmailFromDb(email) ?? DbEntityAdder.AddEmailToDb(email) : email;
     SaveRelationToDb(CreateRelation(email));
 }
예제 #2
0
 private Clubs_EmailsDTO GetRelation(EmailDTO email)
 {
     email = email.Id == 0 ? DbEntityExistensChecker.TryGetExistingEmailFromDb(email) : email;
     return(ServiceLocator.ClubsEmailsService.FindBy(
                ceJunc => ceJunc.ClubId == Id && ceJunc.EmailId == email.Id)
            .First());
 }
예제 #3
0
파일: RoleHandler.cs 프로젝트: ooleoole/Ros
        public void AddRoleRelation(UserDTO caller, UserDTO user, EmailDTO email, Role role)
        {
            NullCheck.ThrowArgumentNullEx(user, email);
            _target.CheckPermission(caller);
            user  = user.Id == 0 ? DbEntityExistensChecker.TryGetExistingUserFromDb(user) ?? DbEntityAdder.AddUserToDb(user) : user;
            email = email.Id == 0 ? DbEntityExistensChecker.TryGetExistingEmailFromDb(email) ?? DbEntityAdder.AddEmailToDb(email) : email;

            AddRoleRelationToDb(CreateRoleRelation(user, email, role));
        }