private void ButtonClick2(object sender, RoutedEventArgs e) { ListOfAccount.strLogin = ""; Account newAccount = new Account(); newAccount = ListOfAccount.account[0]; if (Name.Text == "") { Message.Content = "Введите имя"; } else { if (Password.Password == newAccount.bPassword && Name.Text == "ADMIN") { ListOfAccount.strLogin = Name.Text; ChangePassoword chWindow = new ChangePassoword(); chWindow.Show(); Close(); } else { int iCheck = ListOfAccount.Authorization(Name.Text, Password.Password); if (iCheck == 1) { if (ListOfAccount.strLogin == "ADMIN") { AdministratorMode amWindow = new AdministratorMode(); amWindow.Show(); Close(); } else { ChangePassoword chWindow = new ChangePassoword(); chWindow.Show(); Close(); } } if (iCheck == 2) { Message.Content = "Логин заблокирован"; } if (iCheck == 0) { if (j < 2) { Message.Content = "Не существует имени c таким паролем"; j++; } else { Close(); } } } } }
private void ChangePassword_Click(object sender, RoutedEventArgs e) { ChangePassoword cpWindow = new ChangePassoword(); cpWindow.Show(); Close(); }