private void BtnAddUser_Click(object sender, RoutedEventArgs e) { Window screenNewUser = new CustomerAdd(); screenNewUser.Show(); this.Close(); }
private void BtnUserEdit_Click(object sender, RoutedEventArgs e) { //Button click to show the UsersAdd screen. Window srcUsersAdd = new CustomerAdd(); srcUsersAdd.Show(); this.Close(); //.Show() lets user click parent window //.ShowDialog does not let user click parent window }
private void BtnCreateUser_Click(object sender, RoutedEventArgs e) { if (BtnCreateUser.Content.Equals("Cancel")) { if (backgroundWorker.IsBusy) { backgroundWorker.CancelAsync(); } } else { Window showCustAdd = new CustomerAdd(); showCustAdd.Show(); this.Close(); } }
private void BtnModifyUser_Click(object sender, RoutedEventArgs e) { selectedIndex = lstUserList.SelectedIndex; if (selectedIndex != -1) { selectedUser = users[selectedIndex]; //Create message to verify edit. string message = "Are you sure you want to edit: " + selectedUser.Username + "?"; MessageBoxResult readUser = MessageBox.Show(message, "Accept Modify", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (readUser == MessageBoxResult.Yes) { Window edit = new CustomerAdd(selectedUser); edit.Show(); this.Close(); } } }