This repository was archived by the owner on Dec 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormAccount.cs
More file actions
63 lines (59 loc) · 2.05 KB
/
FormAccount.cs
File metadata and controls
63 lines (59 loc) · 2.05 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 CodeForger.CodeForgerDBDataSetTableAdapters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CodeForger
{
public partial class FormAccount : Form
{
public FormAccount()
{
InitializeComponent();
this.BackgroundImage = Properties.Resources.fundal;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonRegister_Click(object sender, EventArgs e)
{
var form = new FormLogin();
form.Show();
this.Hide();
form.FormClosed += (s, args) =>
{
this.Show();
};
}
private void buttonLogin_Click(object sender, EventArgs e)
{
UsersTableTableAdapter adapter = new UsersTableTableAdapter();
CodeForgerDBDataSet.UsersTableDataTable data = adapter.GetData();
//MessageBox.Show(data.Rows[0][1].ToString());
for (int i = 0; i < data.Rows.Count; i++)
{
//MessageBox.Show(data.Rows[i][1].ToString());
if (string.Equals(data.Rows[i][2].ToString().Trim(), textBoxEmail.Text.Trim()))
{
//MessageBox.Show("Email corect!");
if (string.Equals(data.Rows[i][3].ToString().Trim(), textBoxPassword.Text.Trim()))
{
MessageBox.Show("Email and password are correct!");
Properties.Settings.Default.RememberAccount = checkBoxRemember.Checked;
Properties.Settings.Default.AccountLogin = i;
Properties.Settings.Default.Save();
//MessageBox.Show(i + "");
this.Close();
}
}
}
}
}
}