/// <summary> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCurrency_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtDate.Focus(); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //POP UP { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; if (cmbCurrency.SelectedIndex >= 0) { frmCurrencyObj.CallFromExchangerate(this, Convert.ToDecimal(cmbCurrency.SelectedValue.ToString())); } else { Messages.InformationMessage("Select Currency"); cmbCurrency.Focus(); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnCurrencyAdd_Click(sender, e); } } catch (Exception ex) { formMDI.infoError.ErrorString = "ER41:" + ex.Message; } }
/// <summary> /// Function toi call this form from Currency Form /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) //PopUp { try { base.Show(); this.frmCurrencyObj = frmCurrencyDetails; CurrencyComboFill(); cmbCurrency.SelectedValue = decId; cmbCurrency.Focus(); frmCurrencyObj.Close(); frmCurrencyObj = null; } catch (Exception ex) { formMDI.infoError.ErrorString = "ER12:" + ex.Message; } }
//PopUp /// <summary> /// Function toi call this form from Currency Form /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) { try { base.Show(); this.frmCurrencyObj = frmCurrencyDetails; CurrencyComboFill(); cmbCurrency.SelectedValue = decId; cmbCurrency.Focus(); frmCurrencyObj.Close(); frmCurrencyObj = null; } catch (Exception ex) { MessageBox.Show("ER12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function toi call this form from Currency Form /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) //PopUp { try { base.Show(); this.frmCurrencyObj = frmCurrencyDetails; CurrencyComboFill(); cmbCurrency.SelectedValue = decId; cmbCurrency.Focus(); frmCurrencyObj.Close(); frmCurrencyObj = null; } catch (Exception ex) { MessageBox.Show("ER12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// From keydown for Showing curresponding popup and create Quick access in Keybord entrys /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmContraVoucher_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Escape) { if (PublicVariables.isMessageClose) { Messages.CloseMessage(this); } else { this.Close(); } } if (dgvContraVoucher.CurrentRow != null) { if (dgvContraVoucher.CurrentCell.ColumnIndex == dgvContraVoucher.Columns["dgvcmbBankorCashAccount"].Index) { if (dgvContraVoucher.CurrentCell == dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"]) { //--------------------For ledger Popup------------------------------------// if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)//Ledger popup { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; btnSave.Focus(); dgvContraVoucher.Focus(); if (dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value != null && dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value.ToString() != "") { decimal decLedgerIdForPopUp = Convert.ToDecimal(dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value.ToString()); btnSave.Focus(); dgvContraVoucher.Focus(); frmLedgerPopupObj.CallFromContraVoucher(this, decLedgerIdForPopUp, ""); } } } } if (dgvContraVoucher.CurrentCell == dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"]) { if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)//Ledger creation { SendKeys.Send("{F10}"); if (dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value != null) { strBankOrCashAccount = dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value.ToString(); } else { strBankOrCashAccount = string.Empty; } frmAccountLedgerObj = new frmAccountLedger(); frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedgerObj.CallFromContraVoucher(this, true); } } if (dgvContraVoucher.CurrentCell == dgvContraVoucher.CurrentRow.Cells["dgvcmbCurrency"]) { if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; btnSave.Focus(); dgvContraVoucher.Focus(); if (dgvContraVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value != null && dgvContraVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString() != "") { btnSave.Focus(); dgvContraVoucher.Focus(); frmCurrencyObj.CallFromContraVoucher(this, Convert.ToDecimal(dgvContraVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString())); } } } } if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control) //Save { btnSave.Focus(); if (dgvContraVoucher.Columns["dgvcmbBankorCashAccount"].Selected) { btnSave.Select(); } btnSave_Click(sender, e); } if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control) //Delete { if (btnDelete.Enabled) { btnDelete_Click(sender, e); } } } catch (Exception ex) { MessageBox.Show("CV:49" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Its for Search and fill the Currency's are available in current date /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) { try { decimal decExchangeRateId = 0; ExchangeRateBll BllExchangeRate = new ExchangeRateBll(); decExchangeRateId = BllExchangeRate.GetExchangeRateId(decId, Convert.ToDateTime(txtContraVoucherDate.Text)); dgvContraVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value = decExchangeRateId; base.Show(); this.frmCurrencyObj = frmCurrencyDetails; frmCurrencyObj.Close(); frmCurrencyObj = null; } catch (Exception ex) { MessageBox.Show("CV:06" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Clear button click and checking the other forms is opend or not and close it if its opend /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnClear_Click(object sender, EventArgs e) { try { Clear(); if (frmAgeingObj != null) { frmAgeingObj.Close(); frmAgeingObj = null; } if (frmChequeReportObj != null) { frmChequeReportObj.Close(); frmChequeReportObj = null; } if (frmContraRegisterObj != null) { frmContraRegisterObj.Close(); frmContraRegisterObj = null; } if (frmContraReportObj != null) { frmContraReportObj.Close(); frmContraReportObj = null; } if (frmCurrencyObj != null) { frmCurrencyObj.Close(); frmCurrencyObj = null; } if (frmDayBookObj != null) { frmDayBookObj.Close(); frmDayBookObj = null; } if (frmLedgerDetailsObj != null) { frmLedgerDetailsObj.Close(); frmLedgerDetailsObj = null; } if (frmLedgerPopupObj != null) { frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } } catch (Exception ex) { MessageBox.Show("CV:40" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// From keydown for Quick access like Save and Delete functions /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmPaymentVoucher_KeyDown(object sender, KeyEventArgs e) { try { if (cmbBankorCash.Focused) { if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbBankorCash.SelectedIndex != -1) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPaymentVoucher(this, Convert.ToDecimal(cmbBankorCash.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account"); cmbBankorCash.Text = string.Empty; } } } else { if (dgvPaymentVoucher.CurrentRow != null) { if (dgvPaymentVoucher.CurrentCell.ColumnIndex == dgvPaymentVoucher.Columns["dgvcmbAccountLedger"].Index) { if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { btnSave.Focus(); dgvPaymentVoucher.Focus(); if (dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value != null && dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPaymentVoucher(this, Convert.ToDecimal(dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value.ToString()), string.Empty); } else { Messages.InformationMessage("Select any ledger"); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { //SendKeys.Send("{F10}"); frmAccountLedgerObj = new frmAccountLedger(); frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedgerObj.CallFromPaymentVoucher(this, string.Empty); } } else if (dgvPaymentVoucher.CurrentCell.ColumnIndex == dgvPaymentVoucher.Columns["dgvcmbCurrency"].Index) { if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (dgvPaymentVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value != null && dgvPaymentVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString() != string.Empty) { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; frmCurrencyObj.CallFromPaymentVoucher(this, Convert.ToDecimal(dgvPaymentVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString())); } else { Messages.InformationMessage("Select any currency "); } } } } } if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control) { btnSave_Click(sender, e); } if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control) { btnDelete_Click(sender, e); } if (e.KeyCode == Keys.Escape) { if (PublicVariables.isMessageClose) { Messages.CloseMessage(this); } else { this.Close(); } } } catch (Exception ex) { MessageBox.Show("PV64:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call this form from frmCurrencyDetails form /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) //PopUp { try { base.Show(); this.frmCurrencyObj = frmCurrencyDetails; GridCurrencyComboFill(); dgvPaymentVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value = decId; frmCurrencyObj.Close(); frmCurrencyObj = null; } catch (Exception ex) { MessageBox.Show("PV4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For the shortcut keys /// Esc for form closing /// ctrl+s for save /// ctrl+d for delete /// alt+c for ledger creation /// ctrl+f for ledger popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmJournalVoucher_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Escape) { if (PublicVariables.isMessageClose) { Messages.CloseMessage(this); } else { this.Close(); } } if (dgvJournalVoucher.RowCount > 0) { //-----------------------for ledger creation----------------------------------// if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)//Ledger creation { if (dgvJournalVoucher.CurrentCell == dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"]) { // SendKeys.Send("{F10}"); frmAccountLedger accounLedgerObj = new frmAccountLedger(); accounLedgerObj.MdiParent = formMDI.MDIObj; if (dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value != null && dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty) { string strLedgerName = dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].FormattedValue.ToString(); accounLedgerObj.CallFromJournalVoucher(this, strLedgerName); } else { string strLedgerName = string.Empty; accounLedgerObj.CallFromJournalVoucher(this, strLedgerName); } } } //========================================================================// //--------------------For ledger Popup------------------------------------// if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)//Ledger popup { if (dgvJournalVoucher.CurrentCell == dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"]) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; if (dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value != null && dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty) { decLedgerIdForPopUp = Convert.ToDecimal(dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value.ToString()); frmLedgerPopupObj.CallFromJournalVoucher(this, decLedgerIdForPopUp, string.Empty); } } } //========================================================================// if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (dgvJournalVoucher.CurrentCell == dgvJournalVoucher.CurrentRow.Cells["dgvcmbCurrency"]) { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; if (dgvJournalVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value != null && dgvJournalVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString() != string.Empty) { frmCurrencyObj.CallFromJournalVoucher(this, Convert.ToDecimal(dgvJournalVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value.ToString())); } } } } //-----------------------CTRL+S Save-----------------------------// if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control) //Save { btnSave_Click(sender, e); } //===============================================================// //-----------------------CTRL+D Delete-----------------------------// if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control) //Delete { if (btnDelete.Enabled) { btnDelete_Click(sender, e); } } //=====================================================================// } catch (Exception ex) { MessageBox.Show("JV51:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// To change the currency from currency popup /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) //PopUp { ExchangeRateSP spExchangeRate = new ExchangeRateSP(); try { frmCurrencyObj.Close(); CurrencyComboFill(); decId = spExchangeRate.GetExchangeRateId(decId, Convert.ToDateTime(txtDate.Text)); dgvJournalVoucher.CurrentRow.Cells["dgvcmbCurrency"].Value = decId; dgvJournalVoucher.Focus(); } catch (Exception ex) { MessageBox.Show("JV3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbCurrency /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCurrency_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtFinancialYearFrom.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbCurrency.Text == string.Empty || cmbCurrency.SelectionStart == 0) { txtPincode.Focus(); txtPincode.SelectionStart = 0; txtPincode.SelectionLength = 0; } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //POP UP { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; if (cmbCurrency.SelectedIndex >= 0) { frmCurrencyObj.CallFromCmpany(this, Convert.ToDecimal(cmbCurrency.SelectedValue.ToString())); } else { Messages.InformationMessage("Select currency"); cmbCurrency.Focus(); } } } catch (Exception ex) { MessageBox.Show("CR40:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On Clear button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnClear_Click(object sender, EventArgs e) { try { clear(); if (frmAgeingObj != null) { frmAgeingObj.Close(); frmAgeingObj = null; } if (frmBillallocationObj != null) { frmBillallocationObj.Close(); frmBillallocationObj = null; } if (frmCurrencyObj != null) { frmCurrencyObj.Close(); frmCurrencyObj = null; } if (frmCreditNoteReportObj != null) { frmCreditNoteReportObj.Close(); frmCreditNoteReportObj = null; } if (CreditNoteRegisterObj != null) { CreditNoteRegisterObj.Close(); CreditNoteRegisterObj = null; } if (frmLedgerDetailsObj != null) { frmLedgerDetailsObj.Close(); frmLedgerDetailsObj = null; } if (frmPartyBalanceObj != null) { frmPartyBalanceObj.Close(); frmPartyBalanceObj = null; } } catch (Exception ex) { MessageBox.Show("CRNT:51" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCurrency_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtDate.Focus(); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { frmCurrencyObj = new frmCurrencyDetails(); frmCurrencyObj.MdiParent = formMDI.MDIObj; if (cmbCurrency.SelectedIndex >= 0) { frmCurrencyObj.CallFromExchangerate(this, Convert.ToDecimal(cmbCurrency.SelectedValue.ToString())); } else { Messages.InformationMessage("Select Currency"); cmbCurrency.Focus(); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnCurrencyAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("ER38:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// To change the currency from currency popup /// </summary> /// <param name="frmCurrencyDetails"></param> /// <param name="decId"></param> public void CallFromCurrenCyDetails(frmCurrencyDetails frmCurrencyDetails, decimal decId) { ExchangeRateBll BllExchangeRate = new ExchangeRateBll(); try { frmCurrencyObj.Close(); CurrencyComboFill(); decId = BllExchangeRate.GetExchangeRateId(decId, Convert.ToDateTime(txtDate.Text)); dgvCreditNote.CurrentRow.Cells["dgvcmbCurrency"].Value = decId; dgvCreditNote.Focus(); } catch (Exception ex) { MessageBox.Show("CRNT:09" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }