/// <summary>
 /// Call Corresponding Voucher to View details for updation in edit mode
 /// </summary>
 public void GotoSalesReturn()
 {
     try
     {
         frmSalesReturn objfrmSalesReturn = new frmSalesReturn();
         frmSalesReturn open = Application.OpenForms["frmSalesReturn"] as frmSalesReturn;
         if (open == null)
         {
             objfrmSalesReturn.WindowState = FormWindowState.Normal;
             objfrmSalesReturn.MdiParent = formMDI.MDIObj;
             objfrmSalesReturn.Show();
             objfrmSalesReturn.CallFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString()));
         }
         else
         {
             open.MdiParent = formMDI.MDIObj;
             if (open.WindowState == FormWindowState.Minimized)
             {
                 open.WindowState = FormWindowState.Normal;
             }
             else
             {
                 open.Activate();
             }
             open.CallFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString()));
             open.BringToFront();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("VS25:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Calls corresponding voucher on cell double click in Datagridview
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvSalesReturnRegister_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             if (dgvSalesReturnRegister.CurrentRow != null)
             {
                 isFromRegister = true;
                 inCurrenRowIndex = dgvSalesReturnRegister.CurrentRow.Index;
                 frmSalesReturn objfrmfrmSalesReturn = new frmSalesReturn();
                 frmSalesReturn open = Application.OpenForms["frmSalesReturn"] as frmSalesReturn;
                 if (open == null)
                 {
                     objfrmfrmSalesReturn.WindowState = FormWindowState.Normal;
                     objfrmfrmSalesReturn.MdiParent = formMDI.MDIObj;
                     objfrmfrmSalesReturn.Show();
                     objfrmfrmSalesReturn.CallFromSalesReturnRegister(this, Convert.ToDecimal(dgvSalesReturnRegister.CurrentRow.Cells["dgvSalesReturnMasterId"].Value.ToString()), isFromRegister, isSalesReturnActive);
                 }
                 else
                 {
                     isSalesReturnActive = true;
                     open.MdiParent = formMDI.MDIObj;
                     if (open.WindowState == FormWindowState.Minimized)
                     {
                         open.WindowState = FormWindowState.Normal;
                     }
                     else
                     {
                         open.Activate();
                     }
                     open.ClearToCallFromSaesReturnRegister();
                     open.CallFromSalesReturnRegister(this, Convert.ToDecimal(dgvSalesReturnRegister.CurrentRow.Cells["dgvSalesReturnMasterId"].Value.ToString()), isFromRegister, isSalesReturnActive);
                     open.BringToFront();
                 }
                 this.Enabled = false;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SRR13" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public void griddoubleclick()
 {
     try
     {
          
             if (dgvsalesReturnReport.CurrentRow != null)
             {
                 isFromReport = true;
                 inCurrenRowIndex = dgvsalesReturnReport.CurrentRow.Index;
                 frmSalesReturn objfrmfrmSalesReturn = new frmSalesReturn();
                 frmSalesReturn open = Application.OpenForms["frmSalesReturn"] as frmSalesReturn;
                 if (open == null)
                 {
                     objfrmfrmSalesReturn.WindowState = FormWindowState.Normal;
                     objfrmfrmSalesReturn.MdiParent = formMDI.MDIObj;
                     objfrmfrmSalesReturn.Show();
                     objfrmfrmSalesReturn.CallFromSalesReturnReport(this, Convert.ToDecimal(dgvsalesReturnReport.CurrentRow.Cells["dgvSalesReturnMasterId"].Value.ToString()), isFromReport, isSalesReturnActive);
                 }
                 else
                 {
                     isSalesReturnActive = true;
                     open.MdiParent = formMDI.MDIObj;
                     if (open.WindowState == FormWindowState.Minimized)
                     {
                         open.WindowState = FormWindowState.Normal;
                     }
                     else
                     {
                         open.Activate();
                     }
                     open.ClearToCallFromSaesReturnRegister();
                     open.CallFromSalesReturnReport(this, Convert.ToDecimal(dgvsalesReturnReport.CurrentRow.Cells["dgvSalesReturnMasterId"].Value.ToString()), isFromReport, isSalesReturnActive);
                     open.BringToFront();
                 }
                 this.Enabled = false;
             }
         }
     
     catch (Exception ex)
     {
         
        MessageBox.Show("SRRprt45:" + ex.Message, "Open sssMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }