Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            String           oradb2 = "Data Source=DESKTOP-C9VNRJB;Persist Security Info=True;User ID=SYSTEM;Password=pogkaku";
            OracleConnection conn2  = new OracleConnection(oradb2);

            conn2.Open();
            OracleCommand comm2 = new OracleCommand();

            comm2.CommandText = "select booking_id from passenger_booking where aadhar_id = '" + aad + "'";
            comm2.CommandType = CommandType.Text;
            DataSet           ds2 = new DataSet();
            OracleDataAdapter da2 = new OracleDataAdapter(comm2.CommandText, conn2);

            da2.Fill(ds2, "Tbl_passenger");
            DataTable dt2 = ds2.Tables["Tbl_passenger"];
            int       t2  = dt2.Rows.Count;

            if (t2 == 0)
            {
                MessageBox.Show("No previous bookings!");
            }
            else
            {
                PREVBOOK f = new PREVBOOK(aad, fnam, mnam, lnam, age, sex, eml, ph1, ph2);
                f.Show();
                this.Hide();
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            PREVBOOK f = new PREVBOOK(aad, fnam, mnam, lnam, age, sex, eml, ph1, ph2);

            f.Show();
            this.Hide();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false && radioButton4.Checked == false && radioButton5.Checked == false)
            {
                MessageBox.Show("Select QOS!");
            }

            else
            {
                String           oradb = "Data Source=xe;Persist Security Info=True;User ID=SYSTEM;Password=pogkaku";
                OracleConnection conn  = new OracleConnection(oradb);
                conn.Open();
                OracleCommand comm = new OracleCommand();
                comm.CommandText = "select * from feedback where booking_id = '" + book_id + "'";
                comm.CommandType = CommandType.Text;
                DataSet           ds = new DataSet();
                OracleDataAdapter da = new OracleDataAdapter(comm.CommandText, conn);
                da.Fill(ds, "Tbl_feedback");
                DataTable dt = ds.Tables["Tbl_feedback"];
                count = dt.Rows.Count;
                conn.Close();

                if (count == 0)
                {
                    try
                    {
                        String           oradb1 = "Data Source=xe;Persist Security Info=True;User ID=SYSTEM;Password=pogkaku";
                        OracleConnection conn1  = new OracleConnection(oradb1);
                        conn1.Open();
                        OracleCommand comm1 = new OracleCommand();
                        comm1.CommandText = "select * from feedback";
                        comm1.CommandType = CommandType.Text;
                        DataSet           ds1 = new DataSet();
                        OracleDataAdapter da1 = new OracleDataAdapter(comm1.CommandText, conn1);
                        da1.Fill(ds1, "Tbl_feedback");
                        DataTable dt1 = ds1.Tables["Tbl_feedback"];
                        count2 = dt1.Rows.Count;
                        conn1.Close();

                        feed = "FD_" + count2;

                        String           oradb3 = "Data Source=xe;Persist Security Info=True;User ID=SYSTEM;Password=pogkaku";
                        OracleConnection conn3  = new OracleConnection(oradb3);
                        conn3.Open();
                        OracleCommand comm3 = new OracleCommand();
                        comm3.Connection  = conn3;
                        comm3.CommandText = "insert into feedback values('" + feed + "','" + book_id + "','" + qos + "')";
                        comm3.CommandType = CommandType.Text;

                        comm3.ExecuteNonQuery();
                        conn3.Close();

                        MessageBox.Show("Thanks for feedback");

                        PREVBOOK f = new PREVBOOK(aad, fnam, mnam, lnam, age, sex, eml, ph1, ph2);
                        f.Show();
                        this.Hide();
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            feed = "FD_" + 0;

                            String           oradb3 = "Data Source=xe;Persist Security Info=True;User ID=SYSTEM;Password=pogkaku";
                            OracleConnection conn3  = new OracleConnection(oradb3);
                            conn3.Open();
                            OracleCommand comm3 = new OracleCommand();
                            comm3.Connection  = conn3;
                            comm3.CommandText = "insert into feedback values('" + feed + "','" + book_id + "','" + qos + "')";
                            comm3.CommandType = CommandType.Text;

                            comm3.ExecuteNonQuery();
                            conn3.Close();

                            MessageBox.Show("Thanks for feedback");

                            PREVBOOK f = new PREVBOOK(aad, fnam, mnam, lnam, age, sex, eml, ph1, ph2);
                            f.Show();
                            this.Hide();
                        }
                        catch (Exception ex1)
                        {
                            MessageBox.Show("error");
                        }
                    }
                }

                else
                {
                    MessageBox.Show("Feedback already provided!");
                }
            }
        }