示例#1
0
 /// <summary>
 /// Cell double click to open the curresponding details into the form JournalVoucher for updation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvJournalReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             if (dgvJournalReport.CurrentRow.Index == e.RowIndex)
             {
                 decimal           decMasterId          = Convert.ToDecimal(dgvJournalReport.Rows[e.RowIndex].Cells["dgvtxtJournalMasterId"].Value.ToString());
                 frmJournalVoucher frmJournalVoucherObj = new frmJournalVoucher();
                 frmJournalVoucher open = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher;
                 if (open == null)
                 {
                     frmJournalVoucherObj.WindowState = FormWindowState.Normal;
                     frmJournalVoucherObj.MdiParent   = formMDI.MDIObj;
                     frmJournalVoucherObj.CallFromJournalReport(this, decMasterId);
                 }
                 else
                 {
                     open.MdiParent = formMDI.MDIObj;
                     open.BringToFront();
                     open.CallFromJournalReport(this, decMasterId);
                     if (open.WindowState == FormWindowState.Minimized)
                     {
                         open.WindowState = FormWindowState.Normal;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("JVREP31:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#2
0
 /// <summary>
 /// Calls Corresponding voucher for updation on 'ViewDetails' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnViewDetails_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvJournalRegister.CurrentRow != null)
         {
             frmJournalVoucher frmJournalVoucherObj = new frmJournalVoucher();
             frmJournalVoucher open        = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher;
             decimal           decMasterId = Convert.ToDecimal(dgvJournalRegister.CurrentRow.Cells["dgvtxtJournalMasterId"].Value.ToString());
             if (open == null)
             {
                 frmJournalVoucherObj.WindowState = FormWindowState.Normal;
                 frmJournalVoucherObj.MdiParent   = formMDI.MDIObj;
                 frmJournalVoucherObj.CallFromJournalRegister(this, decMasterId);
             }
             else
             {
                 open.MdiParent = formMDI.MDIObj;
                 open.BringToFront();
                 open.CallFromJournalRegister(this, decMasterId);
                 if (open.WindowState == FormWindowState.Minimized)
                 {
                     open.WindowState = FormWindowState.Normal;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("JREG8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }