Retail_manager/RMWPFInterfaceLibrary/Helpers/ConfigHelper.cs
s459315 0957963cad Added Taxable to Products
Added the ability to tax products for sale
2022-07-23 23:56:50 +02:00

27 lines
655 B
C#

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RMWPFInterfaceLibrary.Helpers
{
public class ConfigHelper : IConfigHelper
{
public decimal GetTaxRate()
{
string rateText = ConfigurationManager.AppSettings["taxRate"];
bool isValidTaxRate = Decimal.TryParse(rateText, out decimal output);
if (isValidTaxRate == false)
{
throw new ConfigurationErrorsException("The taxRate is not setup properly");
}
return output;
}
}
}