protected void Button1_Click(object sender, EventArgs e) { userProps a = new userProps(); a.Username = TextBox1.Text; a.Password = TextBox2.Text; UserBLL A = new UserBLL(); int b = A.SelectBLL(a); if (b > 0) { Session["name"] = TextBox1.Text; Response.Redirect("ShopPortal.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"; } } }
public int DeleteDAL(userProps a) { connection(); query = "Delete UserData where Username = '******'"; cmd = new SqlCommand(query, con); int rs = cmd.ExecuteNonQuery(); con.Close(); return(rs); }
public int UpdateDAL(userProps a) { connection(); query = "Update UserData set Email ='" + a.Email + "',Password = '******',Gender = '" + a.Gender + "' where Username = '******'"; cmd = new SqlCommand(query, con); int rs = cmd.ExecuteNonQuery(); con.Close(); return(rs); }
public int InsertDAL(userProps a) { connection(); query = "Insert into UserData values('" + a.Username + "','" + a.Email + "','" + a.Password + "','" + a.Gender + "')"; cmd = new SqlCommand(query, con); int rs = cmd.ExecuteNonQuery(); con.Close(); return(rs); }
protected void Button3_Click(object sender, EventArgs e) { userProps a = new userProps(); a.Username = TextBox1.Text; UserBLL A = new UserBLL(); A.DeleteBLL(a); TextBox1.Text = ""; TextBox5.Text = ""; TextBox3.Text = ""; Label1.Text = "User data is deleted successfully!"; }
public int SelectDAL(userProps a) { connection(); query = "Select * from UserData where Username='******' and Password= '******'"; adapter = new SqlDataAdapter(query, con); DataTable tb = new DataTable(); int v = adapter.Fill(tb); if (tb.Rows.Count == 4) { } return(v); }
protected void Button2_Click(object sender, EventArgs e) { userProps a = new userProps(); a.Username = TextBox1.Text; a.Email = TextBox5.Text; a.Password = TextBox3.Text; a.Gender = DropDownList1.Text; UserBLL A = new UserBLL(); A.UpdateBLL(a); TextBox1.Text = ""; TextBox5.Text = ""; TextBox3.Text = ""; Label1.Text = "User data is updated successfully!"; }
public int SelectBLL(userProps u) { int i = U.SelectDAL(u); return(i); }
public int DeleteBLL(userProps u) { int i = U.DeleteDAL(u); return(i); }
public int UpdateBLL(userProps u) { int i = U.UpdateDAL(u); return(i); }
public int InsertBLL(userProps u) { int i = U.InsertDAL(u); return(i); }