private void button1_Click(object sender, EventArgs e) { bool registerSuccess = UserAccountHandler.RegisterNewUser(new DovetailUser(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, "employee", 10.0, true)); if (!registerSuccess) { textBox1.Clear(); textBox2.Clear(); MessageBox.Show("Registration Failed. Pick another User/Pass"); // may want to show error message text in-window, not popup return; } Close(); // close sign in window }
private void Sign_In() { bool signInSuccess = UserAccountHandler.UserSignIn(new DovetailUser(txtUsername.Text, txtPassword.Password)); if (!signInSuccess) { txtUsername.Clear(); txtPassword.Clear(); SignInAlertMsgLabel.Content = "Username or password is incorrect!"; return; } // Show main dashboard window DovetailMainForm dashboard = new DovetailMainForm(); dashboard.Show(); Close(); // close sign in window }
public MainWindowViewModel() { UserProfileHandler = new UserProfileHandler(); UserAccountHandler = new UserAccountHandler(); LoadedUserProfiles = new ObservableCollection <UserProfile>(UserProfileHandler.LoadAllUserProfiles()); }