public bool SetRoleForConferenceAndAccount(int conferenceId, string login, int roleId) { var account = _repository.GetAccountByLogin(login); if (account == null) { return(false); } var newConferenceStaff = new ConferenceStaff() { ConferenceId = conferenceId, AccountId = account.AccountId, RoleId = roleId }; try { _repository.AddConferenceStaff(newConferenceStaff); } catch { return(false); } return(true); }