Ejemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     System.Data.SqlClient.SqlConnection conn = konn.GetConn();
     try
     {
         conn.Open();
         string     queryDelete1 = "delete Transaksi_Pemesanan where ID_Transaksi = '" + list_Restoran.id + "'";
         string     queryDelete2 = "delete Mengambil_Data where ID_Transaksi = '" + list_Restoran.id + "'";
         SqlCommand cmd          = new SqlCommand(queryDelete2, conn);
         cmd.ExecuteNonQuery();
         cmd = new SqlCommand(queryDelete1, conn);
         cmd.ExecuteNonQuery();
         MessageBox.Show("Data Di Keranjang Akan Dihapus");
         list_Restoran a = new list_Restoran();
         a.Show();
         this.Hide();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         conn.Close();
     }
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            System.Data.SqlClient.SqlConnection conn = konn.GetConn();
            try
            {
                conn.Open();
                SqlDataReader reader  = null;
                string        sql     = "SELECT * FROM Customer WHERE Nomor_Telepon_Customer = '" + textBox1.Text + "'";
                SqlCommand    command = new SqlCommand(sql, conn);
                command.ExecuteNonQuery();
                reader = command.ExecuteReader();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        telp = reader["Nomor_Telepon_Customer"].ToString();
                    }
                    reader.Close();
                }


                if (textBox1.Text.Equals(telp))
                {
                    idCus = textBox1.Text;
                    list_Restoran a = new list_Restoran();
                    a.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Customer Tidak Ada Pada Database");
            }
            finally
            {
                conn.Close();
            }
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            string query = "update Transaksi_Pemesanan set status = 'proses' , Rating_Driver = @r1 where ID_Transaksi = '" + list_Restoran.id + "'";

            System.Data.SqlClient.SqlConnection conn = konn.GetConn();
            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand(query, conn);
                cmd.Parameters.AddWithValue("@r1", numericUpDown1.Value.ToString());
                cmd.ExecuteNonQuery();
                this.Hide();
                list_Restoran a = new list_Restoran();
                a.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                conn.Close();
            }
        }