forked from YossefEFM/Election-Management
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSignUp.cs
73 lines (65 loc) · 2.36 KB
/
SignUp.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
65
66
67
68
69
70
71
72
73
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OracleClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Election_Management_System
{
public partial class SignUp : Form
{
string ordb = "Data Source = orcl ; User Id=SCOTT; password = tiger;";
OracleConnection conn;
public SignUp()
{
InitializeComponent();
}
private void Rigester_btn_Click(object sender, EventArgs e)
{
if(Pass_txt.Text.Equals(ConPass_txt.Text))
{
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = @"INSERT INTO USERS VALUES (:id , :name ,:password ,:BAddress ,:BDate ,:Notconfirmed ,:signed , :Voted , :Job) ";
cmd.CommandType = CommandType.Text;
//cmd.Parameters.Clear();
int ID = Convert.ToInt32(ID_txt.Text);
DateTime dateTime = Convert.ToDateTime(Birth_txt.Text);
String N = "n";
String V = "V";
String Y = "y";
cmd.Parameters.Add("id", ID);
cmd.Parameters.Add("name", Name_txt.Text);
cmd.Parameters.Add("Password", Pass_txt.Text);
cmd.Parameters.Add("BAddress", Address_txt.Text);
cmd.Parameters.Add("BDate",dateTime);
cmd.Parameters.Add("Notconfirmed", Y);
cmd.Parameters.Add("signed", N);
cmd.Parameters.Add("Voted", N);
cmd.Parameters.Add("Job", V);
int r =cmd.ExecuteNonQuery();
if(r != -1)
MessageBox.Show("Rigesteration done to confirm");
else
MessageBox.Show("Rigesteration not happened!!!!!!!!!!");
}
else
{
label7.Text = " The password is not correct";
}
}
private void SignUp_FormClosing(object sender, FormClosingEventArgs e)
{
conn.Dispose();
}
private void SignUp_Load(object sender, EventArgs e)
{ conn = new OracleConnection(ordb);
conn.Open();
}
}
}