Пример #1
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     objEmployeeInfoEdit = new EmployeeInfoEdit();
     objEmployeeInfoEdit.dtEmployeeInfoEdit = dtEmpInfo;
     objEmployeeInfoEdit.strFormMode        = "NEW";
     objEmployeeInfoEdit.ShowDialog();
     dtEmpInfo = objEmployeeInfoEdit.dtEmployeeInfoEdit;
     dGVEmployee.DataSource = dtEmpInfo;
 }
Пример #2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         if (dGVEmployee.SelectedRows.Count == 0 || dGVEmployee.SelectedCells[0].RowIndex == -1)
         {
             return;
         }
         objfrmEmployeeInfoEdit = new EmployeeInfoEdit();
         objfrmEmployeeInfoEdit.dtEmployeeInfoEdit = dtEmpInfo;
         objfrmEmployeeInfoEdit.strFormMode        = "EDIT";
         objfrmEmployeeInfoEdit.SetSelectedRecord(dGVEmployee.SelectedCells[0].RowIndex);
         objfrmEmployeeInfoEdit.ShowDialog();
         dtEmpInfo = objfrmEmployeeInfoEdit.dtEmployeeInfoEdit;
         dGVEmployee.DataSource = dtEmpInfo;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }