public List<TaxRate> GetTaxRates() { List<TaxRate> rates = new List<TaxRate>(); string[] data = File.ReadAllLines(@"Data\Taxes.txt"); for (int i = 1; i < data.Length; i++) { string[] row = data[i].Split(','); TaxRate toAdd = new TaxRate(); toAdd.State = row[0]; toAdd.TaxPercent = decimal.Parse(row[2]); rates.Add(toAdd); } return rates; }
public List<TaxRate> GetTaxRates() { List<TaxRate> rates = new List<TaxRate>(); //string[] data = File.ReadAllLines(@"C:\MyMastery\mastery-project\FlooringProgram\FlooringProgram.Tests\Data\Taxes.txt"); // Danny Path string[] data = File.ReadAllLines(@"C:\MasteryProject\FlooringProgram\FlooringProgram.Tests\Data\Taxes.txt"); for (int i = 1; i < data.Length; i++) { string[] row = data[i].Split(','); TaxRate toAdd = new TaxRate(); toAdd.State = row[0]; toAdd.TaxPercent = decimal.Parse(row[1]); rates.Add(toAdd); } return rates; }
public List<TaxRate> GetTaxRates() { List<TaxRate> rates = new List<TaxRate>(); decimal Tax = 0.00m; string[] data = File.ReadAllLines(@"Data\Orders\Taxes.txt"); for (int i = 1; i < data.Length; i++) { string[] row = data[i].Split(','); TaxRate toAdd = new TaxRate(); toAdd.State = row[0]; var IsTax = decimal.TryParse(row[1], out Tax); toAdd.TaxPercent = Tax; rates.Add(toAdd); } return rates; }