f0bea75284
All the changes necessary to save shopping cart to DB
27 lines
637 B
C#
27 lines
637 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace RMDataManagerLibrary
|
|
{
|
|
public class ConfigHelper
|
|
{
|
|
public static 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;
|
|
}
|
|
}
|
|
}
|