private void addToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //Add
     Frm_XLKN_DVKH_Details a = new Frm_XLKN_DVKH_Details();
     a.type = "0";
     a.ShowDialog();
     LoadData();
 }
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //Edit
     if (dataGridView1.Rows.Count == 0)
     {
         MessageBox.Show("Please choose 1 row for editing");
         return;
     }
     Frm_XLKN_DVKH_Details a = new Frm_XLKN_DVKH_Details();
     a.type = "1";
     a.ref_no = dataGridView1[0, dataGridView1.CurrentCell.RowIndex].Value.ToString();
     //a.ID = dataGridView1[1, dataGridView1.CurrentCell.RowIndex].Value.ToString();
     a.ShowDialog();
     LoadData();
 }