Esempio n. 1
0
 private void ButtonNextSC_Click(object sender, EventArgs e)
 {
     if (!maskedOldPin.MaskCompleted || !maskedNewPin.MaskCompleted)
     {
         if (lang == 1)
         {
             MessageBox.Show("Введіть дані ще раз.", "Невірні дані", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         if (lang == 2)
         {
             MessageBox.Show("Enter the data again.", "Incorrect data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         if (!Ac1.CheckPinVerification(card_number, maskedOldPin.Text))
         {
             if (pin_tries <= 2)
             {
                 if (lang == 1)
                 {
                     MessageBox.Show("Введіть старий PIN ще раз.", "Неправильний старий PIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 if (lang == 2)
                 {
                     MessageBox.Show("Enter the old PIN again.", "Wrong old 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;
                 maskedNewPin.Text      = "";
                 maskedOldPin.Text      = "";
             }
         }
         else
         {
             Ac1.ChangePin(card_number, maskedNewPin.Text, maskedOldPin.Text);
             if (lang == 1)
             {
                 MessageBox.Show("Операція пройшла успішна", "Результат", MessageBoxButtons.OK);
             }
             if (lang == 2)
             {
                 MessageBox.Show("The operation was successful", "Result", MessageBoxButtons.OK);
             }
             maskedNewPin.Text      = "";
             maskedOldPin.Text      = "";
             TabFrames1.SelectedTab = tabMainMenu;
         }
     }
 }