protected void Button1_Click(object sender, EventArgs e) { Classes.ClearText tx = new Classes.ClearText(); Classes.Login lo = new Classes.Login(); lo.Email = TextBox1.Text; lo.Password = TextBox2.Text; lo.GetLogin(lo); if (lo.role == "Admin" && lo.cond == true) { Response.Write("<script>alert('Welcome Admin')</script>"); Session["AdminInfo"] = TextBox1.Text; Response.Redirect("AdminHome.aspx"); } else if (lo.role == "User" && lo.cond == true) { Response.Write("<script>alert('Welcome User')</script>"); Session["UserInfo"] = TextBox1.Text; Response.Redirect("index.aspx"); } if (lo.cond == false) { Response.Write("<script>alert('Invalid User Id Or Password')</script>"); } tx.ClearTextbox(TextBox1, TextBox2); }
protected void Button2_Click(object sender, EventArgs e) { Classes.ClearText ct = new Classes.ClearText(); Classes.UserRegister ad = new Classes.UserRegister(); ad.CName = TextBox1.Text; if (RadioButton1.Checked) { gender = "Male"; } else { gender = "Female"; } ad.Cgender = gender; ad.CAge = TextBox3.Text; ad.GName = TextBox4.Text; ad.Grelation = TextBox5.Text; ad.Email = TextBox6.Text; ad.Password = TextBox7.Text; ad.pic = Label1.Text; ad.signUp(ad); Response.Write("<script>alert('Successfully Registered')</script>"); ct.ClearTextbox(TextBox1, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7); Image1.ImageUrl = ""; Label1.Text = ""; }
protected void Button1_Click(object sender, EventArgs e) { Classes.ClearText ct = new Classes.ClearText(); Classes.AdminRegister ad = new Classes.AdminRegister(); ad.Name = TextBox1.Text; ad.Email = TextBox2.Text; ad.Password = TextBox3.Text; ad.signUp(ad); Response.Write("<script>alert('Successfully Registered')</script>"); ct.ClearTextbox(TextBox1, TextBox2, TextBox3); }
protected void Button2_Click(object sender, EventArgs e) { Classes.ClearText cl = new Classes.ClearText(); Classes.Events ev = new Classes.Events(); ev.Name = TextBox1.Text; ev.Description = TextBox2.Text; ev.EventsPic = Label1.Text; ev.Date = TextBox3.Text; ev.Time = TextBox4.Text; ev.Add(ev); Response.Write("<script>alert('Sucessfully Inserted')</script>"); cl.ClearTextbox(TextBox1, TextBox2, TextBox3, TextBox4); Label1.Text = ""; Image1.ImageUrl = ""; }