public void SaveAccount(AddAccountModel model) { bool isValid = SaveFacade.Validate(model); if (!isValid) { throw new ArgumentException("An account with that name already exists"); } IAccount account = SaveFacade.Apply(model); Service.AddAccount(account); }
private void SaveExecute() { try { service.AddAccount(Account); MessageBox.Show("Registration completed."); register.Close(); } catch { MessageBox.Show("Username already exists, please choose another username"); } }