private void btnSave_Click(object sender, RoutedEventArgs e) { UserModel userModel = new UserModel(tbxFirstName.Text, tbxLastName.Text, tbxPasswordFirst.Password, tbxEmail.Text, tbxTele.Text); if (AddUser.ValidateAddUser(tbxFirstName, tbxLastName, tbxPasswordFirst, tbxPasswordSecond, tbxEmail, tbxTele)) { if (cbxBoss.IsChecked == true) { AddUser.AddBoss(userModel); AddUser.ClearText(tbxFirstName, tbxLastName, tbxPasswordFirst, tbxPasswordSecond, tbxEmail, tbxTele, cbxBoss); cbUser.Items.Clear(); HandleItems.FillUserList(cbUser); } else { AddUser.AddNewUser(userModel); AddUser.ClearText(tbxFirstName, tbxLastName, tbxPasswordFirst, tbxPasswordSecond, tbxEmail, tbxTele, cbxBoss); cbUser.Items.Clear(); HandleItems.FillUserList(cbUser); } } }
private void Button_Click_3(object sender, RoutedEventArgs e) { var userID = cbUser.SelectedItem.ToString().Split('.')[0]; AddUser.DeleteUser(Convert.ToInt16(userID), cbUser); HandleItems.FillUserList(cbUser); }
public Settings() { InitializeComponent(); FillUserInformation(); HandleItems.FillUserList(cbUser); }