Exemple #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmCustomersAddEdit frm = new frmCustomersAddEdit();

            frm.ShowDialog();
            Search();
        }
Exemple #2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (viewDuLieu.RowCount > 0 && viewDuLieu.FocusedRowHandle >= 0)
     {
         frmCustomersAddEdit frm = new frmCustomersAddEdit(viewDuLieu.GetRowCellValue(viewDuLieu.FocusedRowHandle, "Id").ToString());
         DialogResult        dr  = frm.ShowDialog();
         if (dr == DialogResult.OK)
         {
             int index = viewDuLieu.FocusedRowHandle;
             Search();
             try
             {
                 viewDuLieu.FocusedRowHandle = index;
             }
             catch { }
         }
     }
 }