//PopUp
 /// <summary>
 /// Function to Return from frmAgainstBillDetails form to select voucher type and pending amount
 /// </summary>
 /// <param name="frmAgainstBillDetails"></param>
 /// <param name="strVoucherTypeId"></param>
 public void CallFromAgainstBillDetails(frmAgainstBillDetails frmAgainstBillDetails, string strVoucherTypeId)
 {
     try
     {
         base.Show();
         this.frmAgainstBillDetailsObj = frmAgainstBillDetails;
         dgvPartyBalance.CurrentRow.Cells["dgvcmbVoucherType"].Value = strVoucherTypeId;
         frmAgainstBillDetailsObj.Close();
         frmAgainstBillDetailsObj = null;
         CurrencyComboFill();
         dgvPartyBalance.CurrentRow.Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(1);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:11" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
 /// <summary>
 /// key navigation for frmPartyBalance form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPartyBalance_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (dgvPartyBalance.CurrentRow != null)
         {
             if (dgvPartyBalance.CurrentCell.ColumnIndex == dgvPartyBalance.Columns["dgvcmbVoucherType"].Index)
             {
                 if (dgvPartyBalance.CurrentRow.Cells["dgvcmbVoucherType"].Value != null && dgvPartyBalance.CurrentRow.Cells["dgvcmbVoucherType"].Value.ToString() != string.Empty)
                 {
                     if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up
                     {
                         frmAgainstBillDetails frmAgainstBillDetailsObj = new frmAgainstBillDetails();
                         frmAgainstBillDetailsObj.MdiParent = formMDI.MDIObj;
                         frmAgainstBillDetailsObj.CallFromPartyBalance(this, decLedgerId, strDebitOrCredit);
                     }
                 }
             }
         }
         if (e.KeyCode == Keys.Escape)
         {
             if (PublicVariables.isMessageClose)
             {
                 IsSaveOrEsc = true;
                 Messages.CloseMessage(this);
                 IsSaveOrEsc = false;
             }
             else
             {
                 IsSaveOrEsc = true;
                 Messages.CloseMessage(this);
                 IsSaveOrEsc = false;
             }
         }
         if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
         {
             btnSave.Focus();
             dgvPartyBalance.Focus();
             Save();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:29" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }