public void UpdateAccount(Account item) { var oldItem = _accounts.FirstOrDefault(i => i.ID == item.ID); if (oldItem != null) { oldItem = item; } }
public void DeleteAccount(Account item) { _accounts.Remove(item); }
private void AddAccount(Account item) { _accountRepository.AddAccount(item); }
public void AddAccount(Account item) { item.ID = _accounts.Last().ID + 1; _accounts.Add(item); }
private void Register() { IsNameRegistered(); if (nameTaken) { //error return; } if (IsPasswordBad()) { //Error; return; } var item = new Account { Username = userName, Password = password, IsAdmin = false, Email = email }; AddAccount(item); NavigationService.Navigate(typeof(LoginView)); }