‪Black Box
BBAccessPad.cs
Go to the documentation of this file.
2 using System.Windows.Forms;
3 
4 namespace ‪BBTasker
5 {
6  public partial class ‪BBAccessPad : Form
7  {
8  private string ‪passwordPin = "";
9  private string ‪passwordCheck = "9958";
10  public static bool ‪access = false;
11 
12  public ‪BBAccessPad()
13  {
15  }
16 
22  private void ‪btn01_Click(object sender, System.EventArgs e)
23  {
24  if (‪passwordPin.Length < 4)
25  {
26  ‪passwordPin += "1";
28  }
29  }
30 
36  private void ‪btn02_Click(object sender, System.EventArgs e)
37  {
38  if (‪passwordPin.Length < 4)
39  {
40  ‪passwordPin += "2";
42  }
43  }
44 
50  private void ‪btn03_Click(object sender, System.EventArgs e)
51  {
52  if (‪passwordPin.Length < 4)
53  {
54  ‪passwordPin += "3";
56  }
57  }
58 
64  private void ‪btn04_Click(object sender, System.EventArgs e)
65  {
66  if (‪passwordPin.Length < 4)
67  {
68  ‪passwordPin += "4";
70  }
71  }
72 
78  private void ‪btn05_Click(object sender, System.EventArgs e)
79  {
80  if (‪passwordPin.Length < 4)
81  {
82  ‪passwordPin += "5";
84  }
85  }
86 
92  private void ‪btn06_Click(object sender, System.EventArgs e)
93  {
94  if (‪passwordPin.Length < 4)
95  {
96  ‪passwordPin += "6";
98  }
99  }
100 
106  private void ‪btn07_Click(object sender, System.EventArgs e)
107  {
108  if (‪passwordPin.Length < 4)
109  {
110  ‪passwordPin += "7";
111  ‪pswBox.Text = ‪passwordPin;
112  }
113  }
114 
120  private void ‪btn08_Click(object sender, System.EventArgs e)
121  {
122  if (‪passwordPin.Length < 4)
123  {
124  ‪passwordPin += "8";
125  ‪pswBox.Text = ‪passwordPin;
126  }
127  }
128 
134  private void ‪btn09_Click(object sender, System.EventArgs e)
135  {
136  if (‪passwordPin.Length < 4)
137  {
138  ‪passwordPin += "9";
139  ‪pswBox.Text = ‪passwordPin;
140  }
141  }
142 
148  private void ‪btn0_Click(object sender, System.EventArgs e)
149  {
150  if (‪passwordPin.Length < 4)
151  {
152  ‪passwordPin += "0";
153  ‪pswBox.Text = ‪passwordPin;
154  }
155  }
156 
162  private void ‪btnEnter_Click(object sender, System.EventArgs e)
163  {
165  {
166  MessageBox.Show("Incorrect Password", "Access Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
167  ‪access = false;
168  ‪BBSensorErrorLog.‪SaveErrorData("Access Pad Incorrect Password ");
169  }
171  {
172  MessageBox.Show("Password Accepted", "Access Password", MessageBoxButtons.OK, MessageBoxIcon.Information);
173  ‪access = true;
174  ‪BBSensorErrorLog.‪SaveErrorData("Access Pad correct Password ");
175  }
176  this.Close();
177  }
178 
184  private void ‪btnClear_Click(object sender, System.EventArgs e)
185  {
186  if (‪passwordPin.Length > 0)
187  {
188  ‪passwordPin = ‪passwordPin.Remove(‪passwordPin.Length - 1);
189  ‪pswBox.Text = ‪passwordPin;
190  }
191  }
192  }
193 }
‪static bool access
Definition: BBAccessPad.cs:10
‪void btn08_Click(object sender, System.EventArgs e)
‪Keypad 08
Definition: BBAccessPad.cs:120
‪void btn09_Click(object sender, System.EventArgs e)
‪Keypad 09
Definition: BBAccessPad.cs:134
‪void btn04_Click(object sender, System.EventArgs e)
‪Keypad 04
Definition: BBAccessPad.cs:64
‪static void SaveErrorData(string error)
‪Log all the error that occurs in the program
‪void btn01_Click(object sender, System.EventArgs e)
‪Keypad 01
Definition: BBAccessPad.cs:22
‪void btn02_Click(object sender, System.EventArgs e)
‪Keypad 02
Definition: BBAccessPad.cs:36
‪void btn05_Click(object sender, System.EventArgs e)
‪Keypad 05
Definition: BBAccessPad.cs:78
‪void btnClear_Click(object sender, System.EventArgs e)
‪Clear access pin
Definition: BBAccessPad.cs:184
‪void InitializeComponent()
‪Required method for Designer support - do not modify the contents of this method with the code editor...
‪void btnEnter_Click(object sender, System.EventArgs e)
‪Check access pin
Definition: BBAccessPad.cs:162
‪void btn0_Click(object sender, System.EventArgs e)
‪Keypad 0
Definition: BBAccessPad.cs:148
‪void btn07_Click(object sender, System.EventArgs e)
‪Keypad 07
Definition: BBAccessPad.cs:106
‪System.Windows.Forms.TextBox pswBox
‪void btn03_Click(object sender, System.EventArgs e)
‪Keypad 03
Definition: BBAccessPad.cs:50
‪void btn06_Click(object sender, System.EventArgs e)
‪Keypad 06
Definition: BBAccessPad.cs:92