/// <summary> /// Enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashBankAC_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbVoucherTypeName.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbCashBankAC.Text == string.Empty || cmbCashBankAC.SelectionStart == 0) { txtVoucherNo.SelectionStart = 0; txtVoucherNo.SelectionLength = 0; txtVoucherNo.Focus(); } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbCashBankAC.SelectedIndex != -1) { if (cmbCashBankAC.Focused) { cmbCashBankAC.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashBankAC.DropDownStyle = ComboBoxStyle.DropDownList; } frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromMonthlySalaryRegister(this, Convert.ToDecimal(cmbCashBankAC.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account"); cmbCashBankAC.Text = string.Empty; } } } catch (Exception ex) { MessageBox.Show("MSR18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// Function to call frmLedgerPopup form to select and view ledgers /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; TransactionsGeneralFillBll obj = new TransactionsGeneralFillBll(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedValue = decId; cmbCashBankAC.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("MSR4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmLedgerPopup form to select and view ledgers /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) //PopUp { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedValue = decId; cmbCashBankAC.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { formMDI.infoError.ErrorString = "MSR4:" + ex.Message; } }
/// <summary> /// Function to call frmLedgerPopup form to select and view ledgers /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) //PopUp { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; TransactionsGeneralFillBll obj = new TransactionsGeneralFillBll(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedValue = decId; cmbCashBankAC.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("MSR4:" + 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> /// Enterkey and backspace navigation of cmbCashOrParty /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbPricinglevel.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbCashOrParty.Text == string.Empty || cmbCashOrParty.SelectionStart == 0) { txtSalesQuotationDate.Focus(); txtSalesQuotationDate.SelectionStart = 0; txtSalesQuotationDate.SelectionLength = 0; } } /*----new salesman creation -------------------*/ if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewLedger_Click(sender, e); } /*----------Showing ledger pop up window---------------*/ if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbCashOrParty.Focus()) { if (cmbCashOrParty.Focused) { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromSalesQuotation(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryDeptors"); } else { Messages.InformationMessage("select any ledger"); } } } } catch (Exception ex) { MessageBox.Show("SQ:70" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) { try { base.Show(); this.frmLedgerPopUpObj = frmLedgerPopup; if (strComboTypes == "CashOrSundryDeptors") { CashOrPartyComboFill(); cmbCashOrParty.SelectedValue = decId; } frmLedgerPopUpObj.Close(); frmLedgerPopUpObj = null; } catch (Exception ex) { MessageBox.Show("DN18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enter key and Backspace navigation and quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrBankAcc_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (dgvMonthlySalary.RowCount > 0) { dgvMonthlySalary.Focus(); dgvMonthlySalary.Rows[0].Cells["cmbStatus"].Selected = true; dgvMonthlySalary.CurrentCell = dgvMonthlySalary.Rows[0].Cells["cmbStatus"]; } else { txtNarration.Focus(); } } if (e.KeyCode == Keys.Back) { if (dtpMonth.Enabled != false) { dtpMonth.Focus(); } else { txtVoucherDate.Focus(); } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbCashOrBankAcc.SelectedIndex != -1) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromMonthlySalaryVoucher(this, Convert.ToDecimal(cmbCashOrBankAcc.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account "); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnAccountLedgerAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("MSV37:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For Enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbBank_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbBank.Text = strBankNameText; txtcheckNo.Focus(); txtcheckNo.SelectionStart = 0; txtcheckNo.SelectionLength = 0; } else if (e.KeyCode == Keys.Back) { if (cmbBank.Text == string.Empty || cmbBank.SelectionStart == 0) { txtAmount.Focus(); txtAmount.SelectionStart = 0; txtAmount.SelectionLength = 0; } } else if (e.Alt && e.KeyCode == Keys.C) { SendKeys.Send("{F10}"); btnNewAccountLedger2_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbBank.Focused) { cmbBank.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbBank.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbBank.SelectedIndex != -1) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPdcReceivableVoucher(this, Convert.ToDecimal(cmbBank.SelectedValue.ToString()), "Bank"); this.Enabled = false; } else { Messages.InformationMessage("Select any Bank account"); cmbBank.Text = string.Empty; } } } catch (Exception ex) { MessageBox.Show("PR49:" + 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> /// 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> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtCustomer.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbPricingLevel.Enabled == true) { cmbPricingLevel.Focus(); } else { cmbSalesModeOrderNo.Focus(); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewSalesAccount_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbSalesAccount.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromSalesInvoice(this, Convert.ToDecimal(cmbSalesAccount.SelectedValue.ToString()), "SalesAccount"); } else { Messages.InformationMessage("Select any Sales Account"); } } } catch (Exception ex) { MessageBox.Show("SI: 134" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtCreditPeriod.Focus(); } if (e.KeyCode == Keys.Back) { if (txtDate.Enabled == true) { txtDate.Focus(); txtDate.SelectionLength = 0; txtDate.SelectionStart = 0; } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewLedger_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbCashOrParty.Focused) { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromSalesInvoice(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryDeptors"); } else { Messages.InformationMessage("Select any cash or party"); } } } catch (Exception ex) { MessageBox.Show("SI: 133" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call this form from frmLedgerPopup to view details and for updation /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) //PopUp { try { this.Enabled = true; this.frmLedgerPopUpObj = frmLedgerPopup; if (strComboTypes == "CashOrSundryDeptors") { CashorPartyComboFill(cmbCashOrParty); cmbCashOrParty.SelectedValue = decId; } else if (strComboTypes == "SalesAccount") { SalesAccountComboFill(cmbSalesAccount); cmbSalesAccount.SelectedValue = decId; } frmLedgerPopUpObj.Close(); frmLedgerPopUpObj = null; } catch (Exception ex) { MessageBox.Show("SI: 57" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key, backspace navigation and create new ledger from here /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (txtDueDate.Enabled) { txtDueDate.Focus(); txtDueDate.SelectionStart = 0; txtDueDate.SelectionLength = 0; } } if (e.KeyCode == Keys.Back) { if (txtDate.Enabled) { txtDate.Focus(); txtDate.SelectionLength = 0; txtDate.SelectionStart = 0; } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPurchaseOrder(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryCreditors"); } else { Messages.InformationMessage("Select any cash or party"); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)//new ledger add { btnCashOrPartyAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("PO64:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Clear button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnClear_Click(object sender, EventArgs e) { try { Clear(); if (frmDayBookObj != null) { frmDayBookObj.Close(); frmDayBookObj = null; } if (frmLedgerPopupObj != null) { frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } if (frmProductSearchPopupObj != null) { frmProductSearchPopupObj.Close(); frmProductSearchPopupObj = null; } if (frmPurchaseOrderRegisterObj != null) { frmPurchaseOrderRegisterObj.Close(); frmPurchaseOrderRegisterObj = null; } if (frmPurchaseOrderReportObj != null) { frmPurchaseOrderReportObj.Close(); frmPurchaseOrderReportObj = null; } if (objVoucherSearch != null) { objVoucherSearch.Close(); objVoucherSearch = null; } } catch (Exception ex) { MessageBox.Show("PO50:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; TransactionGeneralFillObj.CashOrPartyComboFill(cmbCashOrParty, false); cmbCashOrParty.SelectedValue = decId; frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("PO23:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) //PopUp { TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill(); try { base.Show(); this.frmLedgerPopUpObj = frmLedgerPopup; if (strComboTypes == "CashOrSundryDeptors") { transactionGeneralFillObj.CashOrPartyUnderSundryDrComboFill(cmbCashOrParty, false); cmbCashOrParty.SelectedValue = decId; } frmLedgerPopUpObj.Close(); frmLedgerPopUpObj = null; } catch (Exception ex) { MessageBox.Show("SQ:15" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="str"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string str) { try { this.Enabled = true; if (str == "CashOrBank") { TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbBankorCash, false); cmbBankorCash.SelectedValue = decId; cmbBankorCash.Focus(); } else { dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value = decId; dgvPaymentVoucher.Focus(); } frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("PV6:" + 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> /// Enterkey and backspace navigation of cmbPurchaseAccount /// Alt+c for purchase account creation /// Ctrl+f for popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbPurchaseAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbVoucherType.Focus(); } else if (e.KeyCode == Keys.Back) { if (cmbPurchaseAccount.Text == string.Empty || cmbPurchaseAccount.SelectionStart == 0) { cmbCurrency.Focus(); } } else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnPurchaseacntAdd_Click(sender, e); } else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { cmbCashOrParty.DropDownStyle = (cmbCashOrParty.Focused) ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList; if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPurchaseReturn(this, Convert.ToDecimal(cmbPurchaseAccount.SelectedValue.ToString()), "PurchaseAccount"); } else { Messages.InformationMessage("Select any purchase account"); } } } catch (Exception ex) { MessageBox.Show("PR:100" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For EnterKey and backSpace Navigation and popup open /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbBankAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { dgvContraVoucher.Focus(); } if (e.KeyCode == Keys.Back) { txtContraVoucherDate.Focus(); txtContraVoucherDate.SelectionStart = 0; txtContraVoucherDate.SelectionLength = 0; } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbBankAccount.Focused) { cmbBankAccount.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbBankAccount.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbBankAccount.SelectedIndex != -1) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromContraVoucher(this, Convert.ToDecimal(cmbBankAccount.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account "); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnBankAccountAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("CV:52" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// Its the function for find and select purticular cash or bank ledger in a popup window /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; if (strComboTypes == "CashOrBank") { TransactionsGeneralFillBll obj = new TransactionsGeneralFillBll(); obj.CashOrBankComboFill(cmbBankAccount, false); cmbBankAccount.SelectedValue = decId; } else { dgvContraVoucher.CurrentRow.Cells["dgvcmbBankorCashAccount"].Value = decId; } frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("CV:11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbServiceAC /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbServiceAC_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbCurrency.Focus(); cmbCurrency.SelectionLength = 0; cmbCurrency.SelectionStart = 0; } if (e.KeyCode == Keys.Back) { if (cmbServiceAC.Text == string.Empty || cmbServiceAC.SelectionStart == 0) { txtCreditPeriod.Focus(); txtCreditPeriod.SelectionStart = 0; txtCreditPeriod.SelectionLength = 0; } } /*-------------------------------------------------Ledger pop up when Ctrl+F----------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbServiceAC.Focused) { cmbServiceAC.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbServiceAC.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbServiceAC.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromServiceVoucher(this, Convert.ToDecimal(cmbServiceAC.SelectedValue.ToString()), "ServiceAccount"); } else { Messages.InformationMessage("Select any service Account"); } } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ } catch (Exception ex) { MessageBox.Show("SV 68 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
// Ledger pop up /// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboType"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboType) { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; if (strComboType == "Account Ledger") { cmbAccountNameFill(); cmbAccountLedger.SelectedValue = decId; } else if (strComboType == "Bank") { cmbBankAccountFill(); cmbBank.SelectedValue = decId; } frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("PR7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbCashOrparty /// Alt+c for cashorparty creation /// Ctrl+f for popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled == true) { cmbCurrency.Focus(); } else { cmbPurchaseAccount.Focus(); } } else if (e.KeyCode == Keys.Back) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnCashorPartyAdd_Click(sender, e); } else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { cmbCashOrParty.DropDownStyle = (cmbCashOrParty.Focused) ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList; if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPurchaseReturn(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryCreditors"); } else { Messages.InformationMessage("Select any cash or party"); } } } catch (Exception ex) { MessageBox.Show("PR:98" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For Navigation , Search Ledger and also create a new ledger /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbDeliveryMode.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbCashOrParty.Text == string.Empty || cmbCashOrParty.SelectionStart == 0) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } } // Cash or Party POP UP when Ctrl+F if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromDeliveryNote(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryDeptors"); } else { Messages.InformationMessage("Select any cash or party"); } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnCashOrParty_Click(sender, e); } } // Cash or Party New Creation when Alt+C if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { btnCashOrParty_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("DN75:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// To select the ledger from ledger popup /// </summary> /// <param name="decId"></param> /// <param name="frmLedgerPopUpObj"></param> public void CallFromLedgerPopup(decimal decId, frmLedgerPopup frmLedgerPopUpObj) //PopUp { try { frmLedgerPopUpObj.Close(); dgvJournalVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value = decId; dgvJournalVoucher.Focus(); } catch (Exception ex) { MessageBox.Show("JV4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbCashOrParty /// For shortcut keys /// ctrl+f for ledger popup /// Alt+c for ledger creation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtCreditPeriod.Focus(); txtCreditPeriod.SelectionLength = 0; txtCreditPeriod.SelectionStart = txtCreditPeriod.Text.Length; } if (e.KeyCode == Keys.Back) { if (cmbCashParty.Text == string.Empty || cmbCashParty.SelectionStart == 0) { txtVoucherDate.Focus(); txtVoucherDate.SelectionStart = 0; txtVoucherDate.SelectionLength = 0; } } /*-------------------------------------------------Ledger pop up when Ctrl+F----------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Ledger pop up { if (cmbCashParty.Focused) { cmbCashParty.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashParty.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbCashParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromServiceVoucher(this, Convert.ToDecimal(cmbCashParty.SelectedValue.ToString()), "CashOrSundryCreditors"); } else { Messages.InformationMessage("Select any cash or party"); } } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)//Ledger creation { SendKeys.Send("{F10}"); btnAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("SV 66 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function for Call from Account Ledger popup /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboTypes"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboTypes) { TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill(); try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; if (strComboTypes == "CashOrSundryCreditors") { TransactionGeneralFillObj.CashOrPartyComboFill(cmbCashOrParty, false); cmbCashOrParty.SelectedValue = decId; } else if (strComboTypes == "PurchaseAccount") { PurchaseAccountComboFill(); cmbPurchaseAccount.SelectedValue = decId; } frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("PR:26" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
// Ledger pop up /// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> /// <param name="strComboType"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId, string strComboType) { try { this.frmLedgerPopupObj = frmLedgerPopup; if (strComboType == "ServiceAccount") { ServiceAcoountComboFill(); cmbServiceAC.SelectedValue = decId; cmbServiceAC.Focus(); } else if (strComboType == "CashOrSundryCreditors") { CashOrPartyComboFill(); cmbCashParty.SelectedValue = decId; cmbCashParty.Focus(); } frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("SV 15 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//PopUp /// <summary> /// Function to call frmLedgerPopup form to select and view Ledger /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; cmbCashorBankAccount.SelectedValue = decId; cmbCashorBankAccount.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("DSV16:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }