/// <summary> /// Function to reset form /// </summary> public void Clear() { try { txtVoucherDateFrom.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); txtVoucherDateTo.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); dtpVoucherDateFrom.Value = PublicVariables._dtCurrentDate; dtpVoucherDateFrom.MinDate = PublicVariables._dtFromDate; dtpVoucherDateFrom.MaxDate = PublicVariables._dtToDate; dtpVoucherDateTo.Value = PublicVariables._dtCurrentDate; dtpVoucherDateTo.MinDate = PublicVariables._dtFromDate; dtpVoucherDateTo.MaxDate = PublicVariables._dtToDate; dtpSalaryMonth.Value = PublicVariables._dtCurrentDate; dtpSalaryMonth.MinDate = PublicVariables._dtFromDate; dtpSalaryMonth.MaxDate = PublicVariables._dtToDate; txtVoucherNo.Clear(); cmbVoucherTypeName.SelectedIndex = -1; VoucherTypeNameComboFill(); TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedIndex = -1; GridFill(); } catch (Exception ex) { MessageBox.Show("MSR3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to reset form /// </summary> public void Clear() { try { txtVoucherDateFrom.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); txtVoucherDateTo.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); dtpVoucherDateFrom.Value = PublicVariables._dtCurrentDate; dtpVoucherDateFrom.MinDate = PublicVariables._dtFromDate; dtpVoucherDateFrom.MaxDate = PublicVariables._dtToDate; dtpVoucherDateTo.Value = PublicVariables._dtCurrentDate; dtpVoucherDateTo.MinDate = PublicVariables._dtFromDate; dtpVoucherDateTo.MaxDate = PublicVariables._dtToDate; dtpSalaryMonth.Value = PublicVariables._dtCurrentDate; dtpSalaryMonth.MinDate = PublicVariables._dtFromDate; dtpSalaryMonth.MaxDate = PublicVariables._dtToDate; txtVoucherNo.Clear(); cmbVoucherTypeName.SelectedIndex = -1; VoucherTypeNameComboFill(); TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedIndex = -1; GridFill(); } catch (Exception ex) { formMDI.infoError.ErrorString = "MSR3:" + ex.Message; } }
/// <summary> /// BankOrCashComboFill function /// </summary> private void BankOrCashComboFill() { try { TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill(); TransactionGeneralFillObj.CashOrBankComboFill(cmbCashOrBank, true); } catch (Exception ex) { MessageBox.Show("RV1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Combofill function of Cash or Bank /// </summary> /// <param name="cmbBankOrcash"></param> public void BankOrCashComboFill(ComboBox cmbBankOrcash) { try { TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbBankOrcash, false); } catch (Exception ex) { MessageBox.Show("CV:01" + 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; TransactionsGeneralFill obj = new TransactionsGeneralFill(); 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> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmMonthlySalaryVoucher_Load(object sender, EventArgs e) { try { lblCashOrBankIndicator.Visible = true; lblVoucherDateIndicator.Visible = true; lblVoucherNoIndicator.Visible = true; TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbCashOrBankAcc, false); dtpMonth.Value = PublicVariables._dtCurrentDate; dtpMonth.MinDate = PublicVariables._dtFromDate; dtpMonth.MaxDate = PublicVariables._dtToDate; dtpVoucherDate.Value = PublicVariables._dtCurrentDate; dtpVoucherDate.MinDate = PublicVariables._dtFromDate; dtpVoucherDate.MaxDate = PublicVariables._dtToDate; dtpVoucherDate.CustomFormat = "dd-MMMM-yyyy"; if (isEditMode == false) { Clear(); } GridFill(isEditMode); } catch (Exception ex) { MessageBox.Show("MSV19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill cash/Bank combobox while return from AccountLedger when creating new ledger /// </summary> /// <param name="decId"></param> public void ReturnFromAccountLedgerForm(decimal decId) { try { TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbCashOrBankAcc, false); cmbCashOrBankAcc.SelectedValue = decId.ToString(); this.Enabled = true; cmbCashOrBankAcc.Focus(); } catch (Exception ex) { MessageBox.Show("MSV17:" + 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> /// Function to fill BankorCash combobox while return from Ledger creation when creating new ledger /// </summary> /// <param name="decId"></param> /// <param name="str"></param> public void ReturnFromAccountLedgerForm(decimal decId, string str) { try { if (str == "CashOrBank") { if (decId != 0) { TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbBankorCash, false); cmbBankorCash.SelectedValue = decId.ToString(); } cmbBankorCash.Focus(); } else { if (decId != 0) { int inCurrentRowIndex = dgvPaymentVoucher.CurrentRow.Index; if (inCurrentRowIndex == dgvPaymentVoucher.Rows.Count - 1) { dgvPaymentVoucher.Rows.Add(); } dgvPaymentVoucher.CurrentRow.HeaderCell.Value = "X"; dgvPaymentVoucher.CurrentRow.HeaderCell.Style.ForeColor = Color.Red; DataTable dtbl = new DataTable(); AccountLedgerSP spAccountLedger = new AccountLedgerSP(); dtbl = spAccountLedger.AccountLedgerViewAll(); DataGridViewComboBoxCell dgvccCashOrBank = (DataGridViewComboBoxCell)dgvPaymentVoucher[dgvPaymentVoucher.Columns["dgvcmbAccountLedger"].Index, dgvPaymentVoucher.Rows[inCurrentRowIndex].Index]; DataRow dr = dtbl.NewRow(); dr["ledgerId"] = "0"; dr["ledgerName"] = string.Empty; dtbl.Rows.InsertAt(dr, 0); dgvccCashOrBank.DataSource = dtbl; dgvccCashOrBank.ValueMember = "ledgerId"; dgvccCashOrBank.DisplayMember = "ledgerName"; dgvPaymentVoucher.Rows[inCurrentRowIndex].Cells["dgvcmbAccountLedger"].Value = decId; dgvPaymentVoucher.Rows[inCurrentRowIndex].Cells["dgvcmbAccountLedger"].Selected = true; } } this.Enabled = true; this.BringToFront(); } catch (Exception ex) { MessageBox.Show("PV29:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmDailySalaryVoucher_Load(object sender, EventArgs e) { try { txtVoucherNo.Select(); dtpDate.Value = PublicVariables._dtCurrentDate; dtpDate.MinDate = PublicVariables._dtFromDate; dtpDate.MaxDate = PublicVariables._dtToDate; dtpDate.CustomFormat = "dd-MMMM-yyyy"; dtpSalaryDate.Value = PublicVariables._dtCurrentDate; dtpSalaryDate.MinDate = PublicVariables._dtFromDate; dtpSalaryDate.MaxDate = PublicVariables._dtToDate; TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbCashorBankAccount, false); if (isEditmode == false) { Clear(); } DailySalaryVoucherDetailsGridfill(isEditmode); } catch (Exception ex) { MessageBox.Show("DSV18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmAdvancePayment_Load(object sender, EventArgs e) { try { dtpSalaryMonth.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); dtpDate.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); dtpCheckDate.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy"); TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashOrBank, false); EmployeeComboFill(); btnAdvancePaymentDelete.Enabled = false; Clear(); isLoad = true; dtpDate.MinDate = PublicVariables._dtFromDate; dtpDate.MaxDate = PublicVariables._dtToDate; } catch (Exception ex) { MessageBox.Show("AP22:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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) //PopUp { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; if (strComboTypes == "CashOrBank") { TransactionsGeneralFill obj = new TransactionsGeneralFill(); 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> /// Function to call this form from frmLedgerPopup to view details /// </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(cmbCashOrBankAcc, false); cmbCashOrBankAcc.SelectedValue = decId; cmbCashOrBankAcc.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { MessageBox.Show("MSV12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Cash/Bank combobox while return from frmAccountLedger in case of creating new ledger /// </summary> /// <param name="decId"></param> public void ReturnFromAccountLedgerForm(decimal decId) { try { TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashOrBank, false); cmbCashOrBank.SelectedValue = decId.ToString(); if (decId.ToString() != "0") { cmbCashOrBank.SelectedValue = decId; } else if (strLedgerId != string.Empty) { cmbCashOrBank.SelectedValue = strLedgerId; } else { cmbCashOrBank.SelectedIndex = -1; } this.Enabled = true; cmbCashOrBank.Focus(); } catch (Exception ex) { MessageBox.Show("AP19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill cashorbank combobox /// </summary> public void CashOrBankComboFill() { try { TransactionsGeneralFill TransactionsGeneralFillObj = new TransactionsGeneralFill(); TransactionsGeneralFillObj.CashOrBankComboFill(cmbCashOrBank, false); } catch (Exception ex) { MessageBox.Show("SJ:28" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Account ledger combobox while return from Account ledger creation when creating new ledger /// </summary> /// <param name="decId"></param> /// <param name="str"></param> public void ReturnFromAccountLedgerForm(decimal decId, string str)//From AccountLedger form { try { if (str == "CashOrBank") { if (decId != 0) { TransactionsGeneralFill Obj = new TransactionsGeneralFill(); Obj.CashOrBankComboFill(cmbCashOrBank, false); cmbCashOrBank.SelectedValue = decId.ToString(); } cmbCashOrBank.Focus(); } else { if (decId != 0) { DataTable dtbl = new DataTable(); AccountLedgerSP spAccountLedger = new AccountLedgerSP(); dtbl = spAccountLedger.AccountLedgerViewAll(); DataGridViewComboBoxCell dgvccCashOrBank = (DataGridViewComboBoxCell)dgvReceiptVoucher[dgvReceiptVoucher.Columns["dgvcmbAccountLedger"].Index, dgvReceiptVoucher.CurrentRow.Index]; dgvccCashOrBank.DataSource = dtbl; dgvccCashOrBank.ValueMember = "ledgerId"; dgvccCashOrBank.DisplayMember = "ledgerName"; dgvReceiptVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].Value = decId; } } this.Enabled = true; this.BringToFront(); } catch (Exception ex) { MessageBox.Show("RV29:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }