/// <summary> /// Sets the current year tax rates. /// </summary> private void SetCurrentYearTaxRates() { if (iboTaxRateRef.iclcTaxRateRef != null) { doTaxRateRef ldoCurrentTaxRate = this.iboTaxRateRef.iclcTaxRateRef.Where(x => x.tax_year == DateTime.Now.Year).FirstOrDefault(); this.idecCurrentTaxRate = ldoCurrentTaxRate.tax_rate; this.idecImportedRate = ldoCurrentTaxRate.imported_rate; } }
/// <summary> /// Adds the tax rate reference. /// </summary> /// <param name="aintTaxYear">The aint tax year.</param> /// <param name="adecTaxRate">The adec tax rate.</param> /// <param name="adecImportedRates">The adec imported rates.</param> /// <returns></returns> private doTaxRateRef AddTaxRateRef(int aintTaxYear, decimal adecTaxRate, decimal adecImportedRates) { doTaxRateRef ldoTaxRateRef = new doTaxRateRef(); ldoTaxRateRef.tax_year = aintTaxYear; ldoTaxRateRef.tax_rate = adecTaxRate; ldoTaxRateRef.imported_rate = adecImportedRates; return(ldoTaxRateRef); }
/// <summary> /// Gets the Tax Rate Ref Details. /// </summary> /// <returns></returns> public void LoadDetailsFromFile() { //Get the Tax Rate Ref from the file List <string[]> llstTaxRateRef = ProductInventoryHelper.LoadFileData(ProductInventoryHelper.TAX_RATE_REF_FILE_NAME); if (llstTaxRateRef != null) { //Create and fill Data object of Tax Rate Ref foreach (string[] larrTaxRate in llstTaxRateRef) { doTaxRateRef ldoTaxRateRef = new doTaxRateRef(); ldoTaxRateRef.tax_year = Convert.ToInt32(larrTaxRate[0]); ldoTaxRateRef.tax_rate = Convert.ToDecimal(larrTaxRate[1]); ldoTaxRateRef.imported_rate = Convert.ToDecimal(larrTaxRate[2]); //Add to Tax Rate Ref collection in order to get all the Product list in collection iclcTaxRateRef.Add(ldoTaxRateRef); } } }