public void Login(Login_Form log)
        {
            string constr = "Data Source=orcl;User Id=hr;Password=hr;";

            string emaill = "select email from customer";

            adapterr = new OracleDataAdapter(emaill, constr);
            dataSett = new DataSet();
            adapterr.Fill(dataSett);

            for (int i = 0; i < dataSett.Tables[0].Rows.Count; i++)
            {
                if (dataSett.Tables[0].Rows[i]["email"].ToString() == log.email_txt_box.Text)
                {
                    Catalogue cat = new Catalogue();
                    cat.setCustomerEmail(log.email_txt_box.Text);

                    string constrr = "Data Source=orcl;User Id=hr;Password=hr;";

                    string            password  = "******";
                    OracleDataAdapter adapterrr = new OracleDataAdapter(password, constrr);
                    adapterrr.SelectCommand.Parameters.Add("email", log.email_txt_box.Text);
                    DataSet dataSettt = new DataSet();
                    adapterrr.Fill(dataSettt);

                    for (int j = 0; j < dataSettt.Tables[0].Rows.Count; j++)
                    {
                        if (dataSettt.Tables[0].Rows[j]["CUSTOMER_PASSWORD"].ToString() == log.password_txt_box.Text)
                        {
                            MessageBox.Show("U R N");

                            cat.Show();

                            break;
                        }
                    }
                    break;
                }
                else if (dataSett.Tables[0].Rows[i]["email"].ToString() != log.email_txt_box.Text && i == dataSett.Tables[0].Rows.Count - 1)
                {
                    MessageBox.Show("this email or password does not exist");
                }
            }
        }
Exemplo n.º 2
0
        private void Buy_Button_Click(object sender, EventArgs e)
        {
            Catalogue cat = new Catalogue();

            cat.Show();
        }