/// <summary> /// Calls corresponding voucher on ViewDetails button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnViewDetails_Click(object sender, EventArgs e) { try { if (dgvReceiptRegister.SelectedRows.Count > 0) { frmReceiptVoucher frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; decimal decPaymentmasterId = Convert.ToDecimal(dgvReceiptRegister.CurrentRow.Cells["dgvtxtreceiptMasterId"].Value.ToString()); frmReceiptVoucher open = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher; if (open == null) { frmReceiptVoucherObj.WindowState = FormWindowState.Normal; frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; frmReceiptVoucherObj.CallFromReceiptRegister(this, decPaymentmasterId); } else { open.MdiParent = formMDI.MDIObj; open.BringToFront(); open.CallFromReceiptRegister(this, decPaymentmasterId); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } } catch (Exception ex) { formMDI.infoError.ErrorString = "RR14:" + ex.Message; } }
/// <summary> /// Cell double click for Updation in selected item frmReceiptVoucher /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvReceiptReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (dgvReceiptReport.CurrentRow != null) { if (dgvReceiptReport.CurrentRow.Index == e.RowIndex) { if (dgvReceiptReport.CurrentRow.Cells["dgvtxtReceiptMasterId"].Value != null && dgvReceiptReport.CurrentRow.Cells["dgvtxtReceiptMasterId"].Value.ToString() != string.Empty) { frmReceiptVoucher frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; decimal decReceiptmasterId = Convert.ToDecimal(dgvReceiptReport.CurrentRow.Cells["dgvtxtreceiptMasterId"].Value.ToString()); frmReceiptVoucher open = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher; if (open == null) { frmReceiptVoucherObj.WindowState = FormWindowState.Normal; frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; frmReceiptVoucherObj.CallFromReceiptReport(this, decReceiptmasterId); } else { open.MdiParent = formMDI.MDIObj; open.BringToFront(); open.CallFromReceiptReport(this, decReceiptmasterId); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } } } } catch (Exception ex) { formMDI.infoError.ErrorString = "RRP13:" + ex.Message; } }