private void employeeGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { CRUDEmployee modifyEmployee = new CRUDEmployee(); modifyEmployee.crudEID.Text = this.employeeGrid.CurrentRow.Cells[0].Value?.ToString() ?? null; modifyEmployee.crudEFirstName.Text = this.employeeGrid.CurrentRow.Cells[1].Value?.ToString() ?? null; modifyEmployee.crudELastName.Text = this.employeeGrid.CurrentRow.Cells[2].Value?.ToString() ?? null; modifyEmployee.crudEEmail.Text = this.employeeGrid.CurrentRow.Cells[3].Value?.ToString() ?? null; modifyEmployee.crudECell.Text = this.employeeGrid.CurrentRow.Cells[4].Value?.ToString() ?? null; modifyEmployee.crudEPhone.Text = this.employeeGrid.CurrentRow.Cells[5].Value?.ToString() ?? null; modifyEmployee.crudEObligation.Text = employeeGrid.CurrentRow.Cells[7].Value?.ToString() ?? null; modifyEmployee.crudEIsDocChck.Checked = Convert.ToBoolean(this.employeeGrid.CurrentRow.Cells[6].Value); modifyEmployee.FormClosed += UpdateEmployeeGrid_FormClosed; modifyEmployee.ShowDialog(); }
private void addEmployeeBtn_Click(object sender, EventArgs e) { CRUDEmployee addEmployee = new CRUDEmployee(); addEmployee.crudEID.Text = null; addEmployee.crudEFirstName.Text = null; addEmployee.crudELastName.Text = null; addEmployee.crudEEmail.Text = null; addEmployee.crudECell.Text = null; addEmployee.crudEPhone.Text = null; //addEmployee.crudEIsDoc.Text = null; addEmployee.crudEObligation.Text = null; addEmployee.crudEIsDocChck.Checked = false; addEmployee.crudEDelete.Visible = false; addEmployee.FormClosed += UpdateEmployeeGrid_FormClosed; addEmployee.ShowDialog(); }