예제 #1
0
        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);
        }
예제 #2
0
 private void SaveExecute()
 {
     try
     {
         service.AddAccount(Account);
         MessageBox.Show("Registration completed.");
         register.Close();
     }
     catch
     {
         MessageBox.Show("Username already exists, please choose another username");
     }
 }