void GetOptionsandTaxValues() { OptionsEntity oData = new OptionsEntity(); IPandSCostPriceListRepository pandsRepository = new PandSCostPriceListRepository(); oData = pandsRepository.GetOptionDetails(); if (oData != null) { this.CurrencyName = oData.CurrencyCode; //there is no currency name field in database this.CurrencyCode = oData.CurrencyCode; this.CurrencyFormat = oData.NumberFormat; this.DateFormat = oData.DateFormat; this.DecimalPlaces = oData.DecimalPlaces; if (oData.ShowAmountIncGST == true) { this.ShowIncTaxTrue = true; this.ShowExcTaxTrue = false; //int decimalpoints = Convert.ToInt32(DecimalPlaces); //foreach (var item in this.PurchaseQuotationList) //{ // item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmount), decimalpoints).ToString(); //} //this.PurchaseQuotationList = this.PurchaseQuotationList.Where(x => x.ExcIncGST == true).ToList(); } else { this.ShowIncTaxTrue = false; this.ShowExcTaxTrue = true; int decimalpoints = Convert.ToInt32(DecimalPlaces); //foreach (var item in this.PurchaseQuotationList) //{ // //item.QuotationAmount = item.QuotationAmountExcGST; // //item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmountExcGST), decimalpoints).ToString(); // item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmount), decimalpoints).ToString(); //} //commented on 23 May 2017 //if (this.PurchaseQuotationList != null) // this.PurchaseQuotationList = this.PurchaseQuotationList.Where(x => x.ExcIncGST == false).ToList(); } } else { this.CurrencyName = "USD"; this.CurrencyCode = "USD"; this.CurrencyFormat = "en-US"; this.DateFormat = "dd/MM/yyyy"; } var objDefaultTax = pandsRepository.GetTaxes().FirstOrDefault(); if (objDefaultTax != null) { this.TaxName = objDefaultTax.TaxName; } else { this.TaxName = "GST"; } }
private void RefreshData() { IPandSCostPriceListRepository pandsRepository = new PandSCostPriceListRepository(); this.PandSCostPriceList = pandsRepository.GetPandSList().OrderBy(x => x.PandSName).ToList(); this.ShowAllCount = this.PandSCostPriceList.Count(); this.ShowSelectedCount = 0; FullList = this.PandSCostPriceList.ToList(); DefaultList = this.PandSCostPriceList.ToList(); this.PandSCostPriceListcmb = this.PandSCostPriceList.OrderBy(x => x.PandSName).ToList(); this.PandSCostPriceListcmbCode = this.PandSCostPriceList.OrderBy(x => x.PandSName).ToList(); this.PandSCostPriceListcmbCat1 = this.PandSCostPriceList.GroupBy(x => x.Category1).Select(e => e.First()).OrderBy(x => x.Category1).ToList(); this.PandSCostPriceListcmbCat2 = this.PandSCostPriceList.GroupBy(x => x.Category2).Select(e => e.First()).OrderBy(x => x.Category2).ToList(); allPosition.Category1 = "All"; allPosition.Category2 = "All"; this.PandSCostPriceListcmbCat1.Insert(0, allPosition); this.PandSCostPriceListcmbCat2.Insert(0, allPosition); GetOptionsandTaxValues(); this.ShowAllTrue = true; this.ShowBoth = true; this.ShowSelectedTrue = false; this.ShowProducts = false; this.ShowServices = false; if (this.ShowIncTaxTrue == true) { foreach (var item in this.PandSCostPriceList) { item.StandardCostPriceStr = item.PandSStdCostPriceaftGST.ToString(); item.AverageCostPriceStr = item.PandSAveCostPriceaftGST.ToString(); item.LastPurPricStr = item.PandSLastPurPriceaftGST.ToString(); } } else { foreach (var item in DefaultList) { item.StandardCostPriceStr = item.PandSStdCostPricebefGST.ToString(); item.AverageCostPriceStr = item.PandSAveCostPricebefGST.ToString(); item.LastPurPricStr = item.PandSLastPurPricebefGST.ToString(); } } }