-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmPinIDEntry.cs
69 lines (64 loc) · 2.29 KB
/
frmPinIDEntry.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*Gavin Rodgers
* 3309 ATM Project
* This the Pin and ID entry code that handles the second form of ATM for pin and name entry
* Last edited: 10/13/18
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ATM
{
public partial class frmPinIDEntry : Form
{
//Initializes the pin ID entry form
public frmPinIDEntry()
{
InitializeComponent();
}
//handles the OK click buttons to confirm the user credentials, loads frmTransactionEntry
//if match is found
private void btnOK_Click(object sender, EventArgs e)
{
GlobalDataClass.ATMBank.Tries();
if (txtPIN.Text.Length == 4 && GlobalDataClass.ATMBank.accountTry() == false)
{
int access = GlobalDataClass.customer.VerifyNumberAndPin(txtName.Text, txtPIN.Text);
if (access == 3)
{
GlobalDataClass.FormsCode = "frmTransactionEntry";
this.Hide();
Form frmPinIDEntry = new frmTransactionEntry();
frmPinIDEntry.ShowDialog();
this.Visible = false;
this.Close();
}
else if (access == 1)
{
txtName.Text = "";
txtName.Focus();
}
else if(access == 2)
{
txtPIN.Text = "";
txtPIN.Focus();
}
}
else if(GlobalDataClass.ATMBank.accountTry() == true)
{
MessageBox.Show("Please go see bank Manager", "Account Locked");
this.Close();
}
else if(txtPIN.Text.Length != 4)
{
MessageBox.Show("Please Enter a valid name and 4 digit Pin number \n"+ "Remaining Tries: "
+ GlobalDataClass.ATMBank.remainingTries().ToString(), "Entry Error");
}
}
}
}