-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram_ForgetPass.cs
More file actions
63 lines (56 loc) · 1.83 KB
/
Copy pathProgram_ForgetPass.cs
File metadata and controls
63 lines (56 loc) · 1.83 KB
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
using MySql.Data.MySqlClient;
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 DormitoryManagment
{
public partial class ForgetPass : DMForm
{
static private int sentCount = 0;
static private string sentEmail = null;
public ForgetPass()
{
InitializeComponent();
}
private void Information_Click(object sender, EventArgs e)
{
}
private void Send_Click(object sender, EventArgs e)
{
Program.conn.Open();
string sql = "SELECT * FROM Users WHERE Email = '" + EmailInput.Text + "'";
MySqlCommand cmd = new MySqlCommand(sql, Program.conn);
MySqlDataReader rdr = cmd.ExecuteReader();
if (rdr.HasRows)
{
if (sentCount >= 1 && sentEmail == EmailInput.Text) MessageBox.Show("I have sent again!\nCheck your email before click SEND more","Caution",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
else if (sentEmail != EmailInput.Text) sentCount = 0;
NotFound.Visible = false;
Sent.Visible = true;
sentCount++;
}
else
{
NotFound.Visible = true;
Sent.Visible = false;
}
rdr.Close();
Program.conn.Close();
sentEmail = EmailInput.Text;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Return_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
DMForm startScreen = new StartScreen();
Navigate(ref startScreen);
}
}
}