public void GetIDPFromDialog() { if (bsPrevMonths.Count == 0 || bsPrevMonths.Current == null) { return; } if (dgvPrevMonths.CurrentRow == null || dgvPrevMonths.CurrentRow.IsNewRow) { return; } var fm = new Form_Persons(); fm.WhatToSelect = Form_Persons.EWhatToSelect.Person; var ret = fm.ShowMyDialogModal(); if (ret != DialogResult.OK) { return; } var dr = (dgvPrevMonths.CurrentRow.DataBoundItem as DataRowView).Row as KlonsADataSet.PASTDATARow; if (dgvPrevMonths.CurrentCell != null) { try { dgvPrevMonths.BeginEdit(false); var c = dgvPrevMonths.EditingControl as DataGridViewComboBoxEditingControl; c.SelectedValue = fm.SelectedValueInt; dgvPrevMonths.EndEdit(); } catch (Exception) { } } }
public void GetIDPFromDialog() { var fm = new Form_Persons(); fm.WhatToSelect = Form_Persons.EWhatToSelect.Both; var ret = fm.ShowMyDialogModal(); if (ret != DialogResult.OK) { return; } cbPerson.SelectedValue = fm.SelectedIDP; cbPosition.SelectedValue = fm.SelectedIDAM; }
public void GetIDPFromDialog() { if (bsShR.Count == 0 || bsShR.Current == null) { return; } if (dgvShR.CurrentRow == null || dgvShR.CurrentRow.IsNewRow) { return; } var fm = new Form_Persons(); fm.WhatToSelect = Form_Persons.EWhatToSelect.Both; var ret = fm.ShowMyDialogModal(); if (ret != DialogResult.OK) { return; } var dr = (dgvShR.CurrentRow.DataBoundItem as DataRowView).Row as KlonsADataSet.SALARY_SHEET_TEMPL_RRow; if (dgvShR.CurrentCell != null) { try { if (dgvShR.CurrentCell.OwningColumn == dgcShRIdP) { dgvShR.BeginEdit(false); var c = dgvShR.EditingControl as DataGridViewComboBoxEditingControl; c.SelectedValue = fm.SelectedIDP; dgvShR.EndEdit(); dr.IDAM = fm.SelectedIDAM; } if (dgvShR.CurrentCell.OwningColumn == dgcShRIdAM) { dgvShR.EndEdit(); dr.IDP = fm.SelectedIDP; dgvShR.BeginEdit(false); var c = dgvShR.EditingControl as DataGridViewComboBoxEditingControl; c.SelectedValue = fm.SelectedIDAM; dgvShR.EndEdit(); } } catch (Exception) { } } }