コード例 #1
0
 private void BackMainWindow_Click(object sender, RoutedEventArgs e)
 {
     ListOfAccount.writeFromListToFile();
     AdministratorMode admWindow = new AdministratorMode();
     admWindow.Show();
     Close();
 }
コード例 #2
0
        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();
                        }
                    }
                }
            }
        }
コード例 #3
0
 private void BackMainWindow_Click(object sender, RoutedEventArgs e)
 {
     if (ListOfAccount.strLogin == "ADMIN" && ListOfAccount.bCheakAdmin == true)
     {
         AdministratorMode amWindow = new AdministratorMode();
         amWindow.Show();
         Close();
     }
     else
     {
         MainWindow mnWindow = new MainWindow();
         mnWindow.Show();
         Close();
     }
 }
コード例 #4
0
 private void BackMainWindowClick(object sender, RoutedEventArgs e)
 {
     AdministratorMode amWindow = new AdministratorMode();
     amWindow.Show();
     Close();
 }