-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.cs
64 lines (59 loc) · 1.82 KB
/
manager.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
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;
using MySql.Data.MySqlClient;
namespace Restaurent
{
public partial class manager : Form
{
string q;
public manager()
{
InitializeComponent();
}
private void button6_Click(object sender, EventArgs e)
{
this.Hide();
Form1 f1 = new Form1();
f1.Show();
}
private void button1_Click(object sender, EventArgs e)
{
string constring = "datasource=Localhost;port=3306;username=root;password=karadi8015";
string query1 = "Select man_pass from restaurent.manager where man_username='" + this.man_username.Text + "';";
MySqlConnection con1 = new MySqlConnection(constring);
MySqlCommand cmd1 = new MySqlCommand(query1, con1);
MySqlDataReader myReader1;
try
{
con1.Open();
myReader1 = cmd1.ExecuteReader();
while (myReader1.Read())
{
q = (myReader1.GetValue(0).ToString());
}
//MessageBox.Show(q);
if (q == this.man_pass.Text)
{
this.Hide();
man2 f4 = new man2();
f4.Show();
}
else
{
MessageBox.Show("Invalid Username/Password... Try Again");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}