Exemplo n.º 1
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            HomeSeller homeSeller = new HomeSeller();

            this.Hide();
            homeSeller.Show();
        }
        private void loginbtn_Click(object sender, EventArgs e)
        {
            using (con = new OracleConnection(ordb))
            {
                con.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection  = con;
                cmd.CommandText = "select USER_ID from users where E_MAIL =:email and PASSWORD = :pw";
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("email", emailtxt.Text.Trim().ToString());
                cmd.Parameters.Add("pw", passwordtxt.Text.Trim().ToString());
                OracleDataReader dr = cmd.ExecuteReader();
                int id = 0;
                while (dr.Read())
                {
                    id = Convert.ToInt32(dr[0]);
                }
                if (id == 0)
                {
                    MessageBox.Show("Invalid E-Mail Or Password !! ");
                }
                else
                {
                    GlobalID.ID     = id;
                    cmd.CommandText = "select USER_ID from sellers where USER_ID = " + id;
                    cmd.CommandType = CommandType.Text;
                    dr = cmd.ExecuteReader();

                    if (dr.Read())
                    {
                        HomeSeller hs = new HomeSeller();
                        hs.Show();
                        this.Hide();
                    }
                    else
                    {
                        HomerBidder hb = new HomerBidder();
                        hb.Show();
                        this.Hide();
                    }
                }
            }
        }