-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.aspx.cs
42 lines (33 loc) · 1.23 KB
/
registration.aspx.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class registration : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string q1, q2, dt, gen, bg;
dt = DateTime.Now.ToString("dd/MMM/yyyy");
DBManager dm = new DBManager();
gen = gender.SelectedItem.ToString();
bg = bloodgroup.SelectedItem.ToString();
q1 = "INSERT INTO TBL_REGISTRATION VALUES('" + name.Text + "','" + fname.Text + "','" + gen + "','" + bg + "','" + age.Text + "','" + weight.Text + "','" + contactno.Text + "','" + email.Text + "','" + address.InnerText + "','" + dt + "')";
q2 = "INSERT INTO TBL_LOGIN VALUES('" + userid.Text + "','" + pass.Text + "')";
bool x, y;
x = dm.InsertUpdateDelete(q1);
y = dm.InsertUpdateDelete(q2);
if (x == true && y == true)
{
Response.Write("<script>alert('Registration Successful!!')</script>");
}
else
{
Response.Write("<script>alert('Registration Unsuccessful!!')</script>");
}
}
}