/// <summary>
 /// On 'ViewDetails' button click calls the corresponding Voucher
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnViewDetails_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvCreditNoteRegister.CurrentRow != null)
         {
             decimal       decMasterId      = Convert.ToDecimal(dgvCreditNoteRegister.CurrentRow.Cells["dgvtxtCreditNoteMasterId"].Value.ToString());
             frmCreditNote frmCreditNoteObj = new frmCreditNote();
             frmCreditNoteObj.MdiParent = formMDI.MDIObj;
             frmCreditNote open = Application.OpenForms["frmCreditNote"] as frmCreditNote;
             if (open == null)
             {
                 frmCreditNoteObj.WindowState = FormWindowState.Normal;
                 frmCreditNoteObj.MdiParent   = formMDI.MDIObj;
                 frmCreditNoteObj.CallFromCreditNoteRegister(this, decMasterId);
             }
             else
             {
                 open.MdiParent = formMDI.MDIObj;
                 open.BringToFront();
                 open.CallFromCreditNoteRegister(this, decMasterId);
                 if (open.WindowState == FormWindowState.Minimized)
                 {
                     open.WindowState = FormWindowState.Normal;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CRNTREG12:" + ex.Message;
     }
 }
Beispiel #2
0
        /// <summary>
        /// Cell double click to view the creditNote form with curresponding value to updation
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvCreditNoteReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1)
                {
                    if (dgvCreditNoteReport.CurrentRow.Index == e.RowIndex)
                    {
                        decimal decMasterId = Convert.ToDecimal(dgvCreditNoteReport.Rows[e.RowIndex].Cells["dgvtxtCreditNoteMasterId"].Value.ToString());

                        frmCreditNote frmCreditNoteObj = new frmCreditNote();

                        frmCreditNoteObj.MdiParent = formMDI.MDIObj;

                        frmCreditNote open = Application.OpenForms["frmCreditNote"] as frmCreditNote;
                        if (open == null)
                        {
                            frmCreditNoteObj.WindowState = FormWindowState.Normal;
                            frmCreditNoteObj.MdiParent   = formMDI.MDIObj;
                            frmCreditNoteObj.CallFromCreditNoteReport(this, decMasterId);
                        }
                        else
                        {
                            open.MdiParent = formMDI.MDIObj;
                            open.BringToFront();
                            open.CallFromCreditNoteReport(this, decMasterId);
                            if (open.WindowState == FormWindowState.Minimized)
                            {
                                open.WindowState = FormWindowState.Normal;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "CRNTREP15:" + ex.Message;
            }
        }