Esempio n. 1
0
 private void ButtonEnterPin_Click(object sender, EventArgs e)
 {
     if (!MaskedPinTextBox.MaskCompleted)
     {
         if (lang == 1)
         {
             MessageBox.Show("Введіть PIN ще раз.", "Некоректні дані", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         if (lang == 2)
         {
             MessageBox.Show("Enter the PIN again.", "Incorrect data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         if (Ac1.CheckPinVerification(card_number, MaskedPinTextBox.Text))
         {
             pin_tries = 0;
             TabFrames1.SelectedTab = tabMainMenu;
         }
         else
         {
             if (pin_tries <= 1)
             {
                 if (lang == 1)
                 {
                     MessageBox.Show("Введіть PIN ще раз.", "Неправильний PIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 if (lang == 2)
                 {
                     MessageBox.Show("Enter the PIN again.", "Wrong PIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 pin_tries++;
             }
             else
             {
                 if (lang == 1)
                 {
                     MessageBox.Show("Ви тричі ввели неправильний PIN. Задля безпеки картка була заблокована." +
                                     " Зверніться у найближче віділленя банкомату.", "Картка заблокована", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 if (lang == 2)
                 {
                     MessageBox.Show("You have entered the wrong PIN three times. For security reasons, " +
                                     "the card was blocked. Contact your nearest ATM branch.", "Card is blocked", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 pin_tries = 0;
                 Ac1.BlockCard(card_number);
                 TabFrames1.SelectedTab = tabWelcome;
             }
         }
     }
     MaskedPinTextBox.Text = "";
 }