private void InsertNewUser() { string query = $"INSERT INTO [dbo].[User] (FirstName, LastName, Password, Barcode) VALUES ('{firstName}', '{lastName}', '{PasswordHash.Hash(SecureStringToString(password))}', '{barcode}')"; var response = userData.AddNewUser(query); if (response.Count > 0 && response.Error == null) { MsgBox.Show("Un nou utilizator a fost adaugat in baza de date!", " ", MessageBoxButton.OK, MessageBoxImage.Information); StartupVM.UIDispatcher[nameof(RegisterVM)].CloseUI(); } else { MsgBox.Show("Utilizatorul nu a fost adaugat in baza de date din cauza unei erori. Va rog sa incercati din nou!", " ", MessageBoxButton.OK, MessageBoxImage.Error); } }
public string Register(User user) { return(userData.AddNewUser(user)); }