private void Btn_delete_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("هل تريد حذف الطيار", "عمليه الحذف", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    d.DeleteDelivery(Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value));
                    MessageBox.Show("تم مسح الطيار بنجاح", "عمليه الحذف", MessageBoxButtons.OK, MessageBoxIcon.None);


                    dataGridView1.DataSource = d.SelectDeliveryInformation();
                    clears();
                }
                else
                {
                    MessageBox.Show("تم الغاء عمليه الحذف");
                    clears();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    protected void btn_ok_Click(object sender, EventArgs e)
    {
        Delivery Deletedeli = new Delivery();
        int      deliId     = int.Parse(txt_deli_id.Text);

        Deletedeli.DeleteDelivery(deliId);
        Response.Write("<script>alert('Success ');</script>");
    }
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            if (e.Column.Name == "update")
            {
                if (gridView1.RowCount > 0)
                {
                    lable_num.Text   = gridView1.GetFocusedRowCellValue(ID_Delivery).ToString();
                    txt_name.Text    = gridView1.GetFocusedRowCellValue(Name_Delivery).ToString();
                    txt_address.Text = gridView1.GetFocusedRowCellValue(Address).ToString();
                    txt_phone.Text   = gridView1.GetFocusedRowCellValue(phone).ToString();

                    btn_save.Enabled = false;

                    btn_update.Enabled = true;
                }
            }
            else if (e.Column.Name == "delete")
            {
                try
                {
                    if (MessageBox.Show("هل تريد حذف الطيار", "عمليه الحذف", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        d.DeleteDelivery(Convert.ToInt32(gridView1.GetFocusedRowCellValue(ID_Delivery)));
                        MessageBox.Show("تم مسح الطيار بنجاح", "عمليه الحذف", MessageBoxButtons.OK, MessageBoxIcon.None);


                        gridControl1.DataSource = d.SelectDeliveryInformation();
                        clears();
                    }
                    else
                    {
                        MessageBox.Show("تم الغاء عمليه الحذف");
                        clears();
                    }
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }