Exemplo n.º 1
0
        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";
                }
            }
        }
Exemplo n.º 2
0
        public int DeleteDAL(userProps a)
        {
            connection();
            query = "Delete UserData where Username = '******'";
            cmd   = new SqlCommand(query, con);
            int rs = cmd.ExecuteNonQuery();

            con.Close();
            return(rs);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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!";
        }
Exemplo n.º 6
0
        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!";
        }
Exemplo n.º 8
0
        public int SelectBLL(userProps u)
        {
            int i = U.SelectDAL(u);

            return(i);
        }
Exemplo n.º 9
0
        public int DeleteBLL(userProps u)
        {
            int i = U.DeleteDAL(u);

            return(i);
        }
Exemplo n.º 10
0
        public int UpdateBLL(userProps u)
        {
            int i = U.UpdateDAL(u);

            return(i);
        }
Exemplo n.º 11
0
        public int InsertBLL(userProps u)
        {
            int i = U.InsertDAL(u);

            return(i);
        }