/// <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 fill Cash/Party combobox /// </summary> public void CashOrPartyComboFill() { try { TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill(); TransactionGeneralFillObj.CashOrPartyUnderSundryDrComboFill(cmbCashOrParty, true); } catch (Exception ex) { MessageBox.Show("DNREG01" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Accountledger combobox /// </summary> private void AccountLedgerComboFill() { try { TransactionsGeneralFill TransactionsGeneralFillObj = new TransactionsGeneralFill(); TransactionsGeneralFillObj.CashOrPartyComboFill(cmbAccountLedger, true); } catch (Exception ex) { MessageBox.Show("ODPO:1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Salesman combobox /// </summary> public void salesmancombofill() { TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill(); try { transactionGeneralFillObj.SalesmanViewAllForComboFill(cmbSalesMan, true); } catch (Exception ex) { MessageBox.Show("RIReport:03" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void VoucherTypeComboFill() { TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill(); try { transactionGeneralFillObj.VoucherTypeComboFill(cmbVoucherType, "Rejection In", true); } catch (Exception ex) { MessageBox.Show("RIRgstr:03" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Cash Or Party combobox /// </summary> public void CashOrPartyComboFill() { try { TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill(); isDontExecuteCashorParty = true; TransactionGeneralFillObj.CashOrPartyComboFill(cmbCashOrParty, true); isDontExecuteCashorParty = false; } catch (Exception ex) { MessageBox.Show("MRR3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// BankAccount Combobox fill function /// </summary> public void bankAccountComboFill() { try { DataTable dtbl = new DataTable(); AccountLedgerSP spAccountLedger = new AccountLedgerSP(); TransactionsGeneralFill obj = new TransactionsGeneralFill(); dtbl = obj.BankComboFill(); cmbBankAccount.DataSource = dtbl; cmbBankAccount.ValueMember = "ledgerId"; cmbBankAccount.DisplayMember = "ledgerName"; cmbBankAccount.SelectedIndex = -1; } catch (Exception ex) { MessageBox.Show("BR:2" + 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) { MessageBox.Show("MSR4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill AccountyLedger combobox /// </summary> public void LedgerComboFill() { try { DataTable dtbl = new DataTable(); TransactionsGeneralFill obj = new TransactionsGeneralFill(); dtbl = obj.AccountLedgerComboFill(); DataRow dr = dtbl.NewRow(); dr[0] = 0; dr[2] = "All"; dtbl.Rows.InsertAt(dr, 0); cmbAccountLedger.DataSource = dtbl; cmbAccountLedger.DisplayMember = "ledgerName"; cmbAccountLedger.ValueMember = "ledgerId"; } catch (Exception ex) { MessageBox.Show("RR2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill CashOrBank combobox /// </summary> public void CashOrBankComboFill() { try { DataTable dtbl = new DataTable(); TransactionsGeneralFill Obj = new TransactionsGeneralFill(); dtbl = Obj.BankOrCashComboFill(false); DataRow dr = dtbl.NewRow(); dr[1] = 0; dr[0] = "All"; dtbl.Rows.InsertAt(dr, 0); cmbBankOrCash.DataSource = dtbl; cmbBankOrCash.ValueMember = "ledgerId"; cmbBankOrCash.DisplayMember = "ledgerName"; cmbBankOrCash.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show("PRP2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// grid CellValueChanged for do the basic calculation and unit selection /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvProductBOM_CellValueChanged(object sender, DataGridViewCellEventArgs e) { try { CheckInvalidEntries(e); ProductSP spProduct = new ProductSP(); TransactionsGeneralFill trstGnFill = new TransactionsGeneralFill(); if (e.RowIndex > -1) { if (e.ColumnIndex == dgvProductBOM.Columns["dgvcmbRawMaterial"].Index) { if (dgvProductBOM.Rows[e.RowIndex].Cells["dgvcmbRawMaterial"] != null) { dgvProductBOM.Rows[e.RowIndex].Cells["dgvtxtUnit"].Value = spProduct.ProductUnit(Convert.ToDecimal(dgvProductBOM.Rows[e.RowIndex].Cells[1].Value)); DataTable dtblunitconversionViewAll = new DataTable(); decimal decProductId = Convert.ToDecimal(dgvProductBOM.Rows[e.RowIndex].Cells["dgvcmbRawMaterial"].Value); dtblunitconversionViewAll = trstGnFill.UnitViewAllByProductId(dgvProductBOM, decProductId.ToString(), e.RowIndex); DataRow drow = dtblunitconversionViewAll.NewRow(); drow["unitName"] = string.Empty; drow["unitId"] = 0; dtblunitconversionViewAll.Rows.InsertAt(drow, 0); DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)(dgvProductBOM.Rows[e.RowIndex].Cells["dgvcmbUnit"]); cell.DataSource = dtblunitconversionViewAll; cell.ValueMember = "unitId"; cell.DisplayMember = "unitName"; if (dtblunitconversionViewAll.Rows[0][4] != null && dtblunitconversionViewAll.Rows[0][4] != DBNull.Value) { dgvProductBOM.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(dtblunitconversionViewAll.Rows[0][4].ToString()); } } } } } catch (Exception ex) { MessageBox.Show("PB:21" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }