Example #1
0
 /// <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;
     }
 }