Beispiel #1
0
 /// <summary>
 /// Calls corresponding voucher on ViewDetails button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnViewDeatils_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvStockJournalRegister.CurrentRow != null)
         {
             frmStockJournal frmStockJournalObj = new frmStockJournal();
             frmStockJournal open       = Application.OpenForms["frmStockJournal"] as frmStockJournal;
             decimal         dcRegister = Convert.ToDecimal(dgvStockJournalRegister.CurrentRow.Cells["dgvtxtStockJournalMasterId"].Value.ToString());
             if (open == null)
             {
                 frmStockJournalObj.WindowState = FormWindowState.Normal;
                 frmStockJournalObj.MdiParent   = formMDI.MDIObj;
                 frmStockJournalObj.CallFromStockJournalRegister(this, dcRegister);
             }
             else
             {
                 open.MdiParent = formMDI.MDIObj;
                 open.BringToFront();
                 open.CallFromStockJournalRegister(this, dcRegister);
                 if (open.WindowState == FormWindowState.Minimized)
                 {
                     open.WindowState = FormWindowState.Normal;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SJREG:9" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Calls Corresponding StockJournal voucher to view details for updation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvStockJournalReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (dgvStockJournalReport.CurrentRow != null)
         {
             frmStockJournal frmStockJournalObj = new frmStockJournal();
             frmStockJournal open       = Application.OpenForms["frmStockJournal"] as frmStockJournal;
             decimal         dcRegister = Convert.ToDecimal(dgvStockJournalReport.CurrentRow.Cells["dgvtxtStockJournalMasterId"].Value.ToString());
             if (open == null)
             {
                 frmStockJournalObj.WindowState = FormWindowState.Normal;
                 frmStockJournalObj.MdiParent   = formMDI.MDIObj;
                 frmStockJournalObj.CallFromStockJournalReport(this, dcRegister);
             }
             else
             {
                 open.MdiParent = formMDI.MDIObj;
                 open.BringToFront();
                 open.CallFromStockJournalReport(this, dcRegister);
                 if (open.WindowState == FormWindowState.Minimized)
                 {
                     open.WindowState = FormWindowState.Normal;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SRR9:" + ex.Message;
     }
 }