private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     if (s == "Home")
     {
         past.Show();
         past.Form1_Load(past, e);
     }
     else if (s == "Restaurants")
     {
         past1.Show();
         past1.all_restaurants_Load(past1, e);
     }
     else if (s == "Making Reservation")
     {
         past2.Show();
         past2.making_reservation_Load(past2, e);
     }
     else if (s == "My_reservation")
     {
         past3.Show();
         past3.my_reservations_Load(past3, e);
     }
     else if (s == "Restaurant_profile")
     {
         past4.Show();
         past4.Restaurant_Profile_Load(past4, e);
     }
     this.Hide();
 }
Example #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            log_in.logged_in = false;
            if (s == "Home")
            {
                past.Show();
                past.Form1_Load(past, e);
            }
            else if (s == "Restaurants")
            {
                past1.Show();
                past1.all_restaurants_Load(past1, e);
            }
            else if (s == "Making Reservation")
            {
                past2.Show();
                past2.making_reservation_Load(past2, e);
            }
            else if (s == "Restaurant_profile")
            {
                past3.Show();
                past3.Restaurant_Profile_Load(past3, e);
            }

            this.Hide();
        }
Example #3
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     if (s == "Home")
     {
         past.Show();
         past.Form1_Load(past, e);
         this.Hide();
     }
 }
Example #4
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     if (s == "Home")
     {
         past1.Show();
         past1.Form1_Load(past1, e);
         this.Hide();
     }
     else if (s == "Restaurants")
     {
         past.Show();
         past.all_restaurants_Load(past, e);
         this.Hide();
     }
 }
Example #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (bunifuMetroTextbox1.Text == "" || bunifuMetroTextbox2.Text == "" || bunifuMetroTextbox3.Text == "" || bunifuMetroTextbox4.Text == "" || bunifuMetroTextbox5.Text == "")
     {
         MessageBox.Show("Please You should complete your information");
     }
     else if (bunifuMetroTextbox4.Text != bunifuMetroTextbox5.Text)
     {
         MessageBox.Show("Please The Password should be Same");
         bunifuMetroTextbox4.Text = bunifuMetroTextbox5.Text = "";
     }
     else
     {
         connection = new OracleConnection(conn);
         connection.Open();
         cmd             = new OracleCommand("select count(useremail) from useraccount where useremail ='" + bunifuMetroTextbox3.Text + "'", connection);
         cmd.CommandType = CommandType.Text;
         OracleDataReader Reader = cmd.ExecuteReader();
         int check1 = 0, check2 = 0;
         while (Reader.Read())
         {
             check1 = int.Parse(Reader[0].ToString());
         }
         cmd             = new OracleCommand("select count(email) from admins where email ='" + bunifuMetroTextbox3.Text + "'", connection);
         cmd.CommandType = CommandType.Text;
         Reader          = cmd.ExecuteReader();
         while (Reader.Read())
         {
             check2 = int.Parse(Reader[0].ToString());
         }
         if (check1 == 1 || check2 == 1)
         {
             MessageBox.Show("Account is already Exist");
             bunifuMetroTextbox3.Text = "";
         }
         else
         {
             string query = @"select * from UserAccount";
             adapter = new OracleDataAdapter(query, conn);
             ds      = new DataSet();
             adapter.Fill(ds);
             DataColumn[] d = new DataColumn[1];
             d[0] = ds.Tables[0].Columns[0];
             ds.Tables[0].PrimaryKey = d;
             DataRow r = ds.Tables[0].NewRow();
             r["useremail"]     = bunifuMetroTextbox3.Text;
             r["user_password"] = bunifuMetroTextbox4.Text;
             r["firstname"]     = bunifuMetroTextbox1.Text;
             r["lastname"]      = bunifuMetroTextbox2.Text;
             r["city"]          = bunifuDropdown4.selectedValue;
             ds.Tables[0].Rows.Add(r);
             builder = new OracleCommandBuilder(adapter);
             adapter.Update(ds.Tables[0]);
             MessageBox.Show("Account is Created");
             if (s == "Home")
             {
                 past.Show();
                 past.Form1_Load(past, e);
             }
             else if (s == "Restaurants")
             {
                 past1.Show();
                 past1.all_restaurants_Load(past1, e);
             }
             else if (s == "Making Reservation")
             {
                 past2.Show();
                 past2.making_reservation_Load(past2, e);
             }
             else if (s == "My_reservation")
             {
                 past3.Show();
                 past3.my_reservations_Load(past3, e);
             }
             else if (s == "Restaurant_profile")
             {
                 past4.Show();
                 past4.Restaurant_Profile_Load(past4, e);
             }
             this.Hide();
             Reader.Close();
             connection.Close();
             bunifuMetroTextbox1.Text = bunifuMetroTextbox2.Text = bunifuMetroTextbox3.Text = bunifuMetroTextbox4.Text = bunifuMetroTextbox5.Text = "";
         }
     }
 }
        private void button2_Click(object sender, EventArgs e)
        {
            string           name           = bunifuMetroTextbox1.Text;
            string           city           = bunifuDropdown4.selectedValue;
            string           street         = bunifuMetroTextbox8.Text;
            string           phone          = bunifuMetroTextbox3.Text;
            string           cuisine        = bunifuDropdown3.selectedValue;
            string           party_size     = bunifuMetroTextbox11.Text;
            string           min_price      = bunifuMetroTextbox5.Text;
            string           max_price      = bunifuMetroTextbox7.Text;
            string           exe_chef       = bunifuMetroTextbox6.Text;
            string           admin_email    = bunifuMetroTextbox10.Text;
            string           admin_password = bunifuMetroTextbox9.Text;
            string           payment_method = richTextBox1.Text;
            OracleConnection con            = new OracleConnection(Connection);

            con.Open();
            OracleCommand cmd = new OracleCommand("select count(email) from ADMINS where email='" + admin_email + "'", con);

            cmd.CommandType = CommandType.Text;

            OracleDataReader reader = cmd.ExecuteReader();
            int check  = 0;
            int check2 = 0;
            int check3 = 0;

            while (reader.Read())
            {
                check = int.Parse(reader[0].ToString());
            }
            reader.Close();
            cmd             = new OracleCommand("select count(RESNAME) from RESTAURANT where RESNAME='" + name + "'", con);
            cmd.CommandType = CommandType.Text;
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                check2 = int.Parse(reader[0].ToString());
            }
            reader.Close();
            cmd             = new OracleCommand("select count(useremail) from useraccount where useremail='" + admin_email + "'", con);
            cmd.CommandType = CommandType.Text;
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                check3 = int.Parse(reader[0].ToString());
            }
            if (check == 1 || check2 == 1 || check3 == 1)
            {
                MessageBox.Show("The Data is Exist");
            }
            else
            {
                OracleCommand cmd3 = new OracleCommand("insert_into_res_admin_pay", con);
                cmd3.CommandType = CommandType.StoredProcedure;
                // in parameters
                cmd3.Parameters.Add("res_name", name);
                cmd3.Parameters.Add("street", street);
                cmd3.Parameters.Add("res_location", city);  // city is location
                cmd3.Parameters.Add("phone", phone);
                cmd3.Parameters.Add("cusine", cuisine);
                cmd3.Parameters.Add("minp", Convert.ToInt32(min_price));
                cmd3.Parameters.Add("maxp", Convert.ToInt32(max_price));
                cmd3.Parameters.Add("maxpartysize", Convert.ToInt32(party_size));
                cmd3.Parameters.Add("exe_chef", exe_chef);
                cmd3.Parameters.Add("admin_email", admin_email);
                cmd3.Parameters.Add("admin_pass", admin_password);
                // cmd.Parameters.Add("pay", payment_method);
                int r = cmd3.ExecuteNonQuery();
                if (richTextBox1.Text != "")
                {
                    string[] arr = richTextBox1.Text.Split('\n');
                    foreach (string i in arr)
                    {
                        if (i == "")
                        {
                            continue;
                        }
                        OracleCommand cmda = new OracleCommand("insert into PAYMENTMETHOD values('" + name + "','" + i + "')", con);
                        cmda.CommandType = CommandType.Text;
                        cmda.ExecuteNonQuery();
                    }
                }
                if (s == "Home")
                {
                    past1.Show();
                    past1.Form1_Load(past1, e);
                }
                else if (s == "Restaurants")
                {
                    past2.Show();
                    past2.all_restaurants_Load(past2, e);
                }
                else if (s == "Making Reservation")
                {
                    past3.Show();
                    past3.making_reservation_Load(past3, e);
                }
                else if (s == "My_reservation")
                {
                    past4.Show();
                    past4.my_reservations_Load(past4, e);
                }
                else if (s == "Restaurant_profile")
                {
                    past5.Show();
                    past5.Restaurant_Profile_Load(past5, e);
                }
                this.Hide();
            }
            con.Close();
        }