/// <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); } }
public void VoucherNoGeneration(DateTime salaryMonth) { TransactionsGeneralFill obj = new TransactionsGeneralFill(); AdvancePaymentSP spAdvancePayment = new AdvancePaymentSP(); if (strVoucherNo == string.Empty) { strVoucherNo = "0"; } strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment); if (Convert.ToDecimal(strVoucherNo) != spAdvancePayment.AdvancePaymentGetMaxPlusOne(decPaymentVoucherTypeId)) { strVoucherNo = spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId).ToString(); strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment); if (spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId) == "0") { strVoucherNo = "0"; strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment); } } if (isAutomatic) { SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP(); SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo(); infoSuffixPrefix = spSuffixPrefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate); string strPrefix = infoSuffixPrefix.Prefix; string strSuffix = infoSuffixPrefix.Suffix; strInvoiceNo = strPrefix + strVoucherNo + strSuffix; } }
/// <summary> /// Function to fill CashOrParty combobox /// </summary> public void CashOrPartyComboFill() { try { TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill(); TransactionGeneralFillObj.CashOrPartyComboFill(cmbCashOrParty, true); } catch (Exception ex) { MessageBox.Show("PIREP2:" + 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 fetch ladger Name Cash/Party ComboBox /// </summary> public void CashOrPartyComboFill() { TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill(); try { transactionGeneralFillObj.CashOrPartyUnderSundryDrComboFill(cmbCashorParty, true); } catch (Exception ex) { MessageBox.Show("RIReport:02" + 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); cmbCashOrParty.SelectedValue = 0; } catch (Exception ex) { MessageBox.Show("SVRT 7 : " + 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 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); } }
/// <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> /// 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> /// 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); } }
public ActionResult GetDailySalaryVoucherForModal(string salaryDate) { bool isSuccess = true; string message = string.Empty; string jsonResult = string.Empty; string jsonCombo = string.Empty; string strVoucherNo = string.Empty; string strTableName = "DailySalaryVoucherMaster"; try { VoucherTypeSP spVoucherType = new VoucherTypeSP(); DataTable dtblVouchetType = new DataTable(); dtblVouchetType = spVoucherType.VoucherTypeSelectionComboFill("Daily Salary Voucher"); int inCount = dtblVouchetType.Rows.Count; string voucherType = string.Empty; if (inCount == 1) { voucherType = dtblVouchetType.Rows[0].ItemArray[0].ToString(); decimal decDailyVoucherTypeId = decimal.Parse(voucherType); TransactionsGeneralFill TransactionsGeneralFillobj = new TransactionsGeneralFill(); DailySalaryVoucherMasterSP spmaster = new DailySalaryVoucherMasterSP(); strVoucherNo = spmaster.SalaryVoucherMasterGetMaxPlusOne(decDailyVoucherTypeId).ToString(); strVoucherNo = TransactionsGeneralFillobj.VoucherNumberAutomaicGeneration(decDailyVoucherTypeId, Convert.ToDecimal(strVoucherNo), Convert.ToDateTime(salaryDate), strTableName); } DataTable dtbl = DailySalaryVoucherDetailsGridfill(false, "0", salaryDate); jsonResult = Utils.ConvertDataTabletoString(dtbl); DailySalaryVoucherMasterSP spMaster = new DailySalaryVoucherMasterSP(); DataTable newDtbl = new DataTable(); newDtbl = spMaster.DailySalaryVoucherCashOrBankLedgersComboFill(); jsonCombo = Utils.ConvertDataTabletoString(newDtbl); } catch (Exception ex) { isSuccess = false; message = ex.Message; } return(Json(new { isSuccess, message, voucherNo = strVoucherNo, data = jsonResult, jsonCombo })); }
/// <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 Cash Or Bank 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); cmbCashOrBank.DataSource = dtbl; cmbCashOrBank.ValueMember = "ledgerId"; cmbCashOrBank.DisplayMember = "ledgerName"; cmbCashOrBank.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show("RRP2:" + 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); } }
public ActionResult CheckBankOrCash() { bool isBankAccount = false; try { TransactionsGeneralFill obj = new TransactionsGeneralFill(); DataTable cashOrBank = obj.CashOrBankComboFill(false); DataTable employee = EmployeeComboFill(); if (cashOrBank.Rows.Count > 0) { decimal cashOrBankId = (decimal)cashOrBank.Rows[0][1]; string cashOrBankName = (string)cashOrBank.Rows[0][0]; isBankAccount = CheckWhetherBankOrCash(cashOrBankId, cashOrBankName); } } catch (Exception ex) { return(Json(new { success = "true", ex = "AP2:" + ex.Message })); } return(Json(new { success = "true", ex = "no", isBankAccount })); }
public ActionResult GetAdvancePaymentDetails() { string jsonCashOrBank = string.Empty; string jsonEmployee = string.Empty; string jsonDate = string.Empty; try { CallFromVoucherTypeSelection(); VoucherNoGeneration(DateTime.UtcNow); jsonDate = DateTime.UtcNow.ToString("yyyy-MM-dd"); TransactionsGeneralFill obj = new TransactionsGeneralFill(); DataTable cashOrBank = obj.CashOrBankComboFill(false); DataTable employee = EmployeeComboFill(); jsonCashOrBank = Utils.ConvertDataTabletoString(cashOrBank); jsonEmployee = Utils.ConvertDataTabletoString(employee); } catch (Exception ex) { return(Json(new { success = "true", ex = "AP1:" + ex.Message })); } return(Json(new { success = "true", ex = "no", voucherNo = strVoucherNo, employee = jsonEmployee, cashOrBank = jsonCashOrBank, date = jsonDate })); }
public ActionResult GetAdvancePaymentEditDetails(string advancePaymentEditId) { try { decAdvancePaymentEditId = Convert.ToDecimal(advancePaymentEditId); AdvancePaymentSP spadvance = new AdvancePaymentSP(); AdvancePaymentInfo infoadvance = new AdvancePaymentInfo(); VoucherTypeSP spvouchertype = new VoucherTypeSP(); infoadvance = spadvance.AdvancePaymentView(decAdvancePaymentEditId); strVoucherNo = infoadvance.VoucherNo; string txtAdvanceVoucherNo = infoadvance.InvoiceNo; strInvoiceNo = infoadvance.InvoiceNo; string employeeId = infoadvance.EmployeeId.ToString(); string salaryMonth = infoadvance.SalaryMonth.ToString("yyyy-MM"); string txtDate = infoadvance.Date.ToString("yyyy-MM-dd"); string txtChequeDate = infoadvance.Date.ToString("yyyy-MM-dd"); string ledgerId = infoadvance.LedgerId.ToString(); string txtCheckNo = infoadvance.Chequenumber; string txtAmount = infoadvance.Amount.ToString(); string txtNarration = infoadvance.Narration; bool isBankAccount = false; decAdvancePaymentsId = decAdvancePaymentId; TransactionsGeneralFill obj = new TransactionsGeneralFill(); DataTable cashOrBank = obj.CashOrBankComboFill(false); DataTable employee = EmployeeComboFill(); string jsonCashOrBank = Utils.ConvertDataTabletoString(cashOrBank); string jsonEmployee = Utils.ConvertDataTabletoString(employee); if (cashOrBank.Rows.Count > 0) { decimal cashOrBankId = (decimal)cashOrBank.Rows[0][1]; string cashOrBankName = (string)cashOrBank.Rows[0][0]; isBankAccount = CheckWhetherBankOrCash(cashOrBankId, cashOrBankName); } decPaymentVoucherTypeId = infoadvance.VoucherTypeId; decPaymentSuffixPrefixId = infoadvance.SuffixPrefixId; isAutomatic = spvouchertype.CheckMethodOfVoucherNumbering(decPaymentVoucherTypeId); return(Json(new { success = "true", ex = "no", data = new { voucherNo = strVoucherNo, employee = jsonEmployee, employeeId, salaryMonth, chequeNo = txtCheckNo, date = txtDate, amount = txtAmount, cashOrBank = jsonCashOrBank, ledgerId, chequeDate = txtChequeDate, narration = txtNarration, isAutomatic, isBankAccount } })); } catch (Exception ex) { return(Json(new { success = "true", ex = "AP3:" + ex.Message })); } }