コード例 #1
0
        public void RemoveDelivaryBoy(Remove_Delivery_Boy booy)
        {
            delivery_boy     boy  = new delivery_boy();
            string           ordb = "Data source=orcl;User Id=hr; Password=hr;";
            OracleConnection conn;

            conn = new OracleConnection(ordb);
            conn.Open();
            OracleCommand cmd = new OracleCommand();

            cmd.Connection = conn;


            cmd.CommandText = "delete from Delivery_boy where Delivery_boy_ID=:id";

            cmd.Parameters.Add("id", booy.cmb_Delivery_boy_delete.Text);
            int r = cmd.ExecuteNonQuery();

            if (r != -1)
            {
                booy.cmb_Delivery_boy_delete.Items.RemoveAt(booy.cmb_Delivery_boy_delete.SelectedIndex);
                booy.Full_Name_del_Delivery_Boy_box.Text = "";
                booy.Phone_del_Delivery_Boy_box.Text     = "";
                booy.No_Orders_del_delivery_boy_box.Text = "";



                MessageBox.Show("Delivery Boy deleted");
            }
        }
        private void Remove_delivery_boy_Click(object sender, EventArgs e)
        {
            Remove_Delivery_Boy rem_boy = new Remove_Delivery_Boy();

            rem_boy.Show();
        }