/// <summary> /// Fills controls for updation on cell double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvPayhead_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { PayHeadInfo infoPayhead = new PayHeadInfo(); PayHeadSP spPayhead = new PayHeadSP(); infoPayhead = spPayhead.PayHeadView(Convert.ToDecimal(dgvPayhead.CurrentRow.Cells["dgvtxtPayheadId"].Value.ToString())); txtPayheadName.Text = infoPayhead.PayHeadName; cmbPayheadType.Text = infoPayhead.Type; strPayheadType = cmbPayheadType.Text; txtPayheadNarration.Text = infoPayhead.Narration; btnPayheadSave.Text = "Update"; btnPayheadDelete.Enabled = true; strPayHeadName = infoPayhead.PayHeadName; decPayHeadId = Convert.ToDecimal(dgvPayhead.CurrentRow.Cells["dgvtxtPayheadId"].Value.ToString()); if (spPayhead.payheadTypeCheckeferences(infoPayhead.PayHeadId, txtPayheadName.Text, cmbPayheadType.Text, txtPayheadNarration.Text)) { if (e.RowIndex != -1) { cmbPayheadType.Enabled = true; } } else { cmbPayheadType.Enabled = false; } } } catch (Exception ex) { MessageBox.Show("PH14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public PayHeadInfo PayHeadView(decimal payHeadId) { try { InfoPayHead = SPPayHead.PayHeadView(payHeadId); } catch (Exception ex) { MessageBox.Show("CB:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(InfoPayHead); }