-
Notifications
You must be signed in to change notification settings - Fork 0
/
Login.cs
44 lines (38 loc) · 1.35 KB
/
Login.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
using System;
using System.Windows.Forms;
namespace CashMeInside
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
private void resetButton_Click(object sender, EventArgs e)
{
usernameInput.Text = "";
passwordInput.Text = "";
; }
private void loginButton_Click(object sender, EventArgs e)
{
string username = usernameInput.Text;
string password = passwordInput.Text;
Tables tablesWindow = new Tables();
tablesWindow.usernameLabelText = username;
if ((username == "admin" && password == "admin123") || (username == "waiter" && password == "waiter123"))
{
this.Hide();
tablesWindow.ShowDialog();
this.Close();
}
else
{
MessageBox.Show("The entered username or password is incorrect.", "Something is wrong!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void forgotPasswordLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show("Well, that's not good... I feel sorry for you.", "You really forgot your password?", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}