protected void Button1_Click1(object sender, EventArgs e) { adminProps a = new adminProps(); a.Username = TextBox1.Text; a.Password = TextBox2.Text; adminBLL A = new adminBLL(); int b = A.SelectBLL(a); if (b > 0) { Session["username"] = TextBox1.Text; Response.Redirect("AdminPortal.aspx"); } else { if (TextBox1.Text.Equals("") && TextBox2.Text.Equals("")) { Label1.Text = "Write Username and Password First"; } else if (TextBox1.Text.Equals("")) { Label1.Text = "Write Username First"; } else if (TextBox2.Text.Equals("")) { Label1.Text = "Write Password First"; } else { Label1.Text = "Incorrect Username or Password"; } } }
protected void Button2_Click(object sender, EventArgs e) { adminProps a = new adminProps(); a.Username = TextBox1.Text; a.Email = TextBox5.Text; a.Password = TextBox3.Text; a.Gender = DropDownList1.Text; adminBLL A = new adminBLL(); A.UpdateBLL(a); TextBox1.Text = ""; TextBox5.Text = ""; TextBox3.Text = ""; Label1.Text = "Admin data is updated successfully!"; }