public static IncomeTax GetIncomeTax(IncomeTaxRangeTypes incomeTaxRangeType) { string property_name = incomeTaxRangeType.ToString(); //Get the property inside IncomeTaxRangeConstants by a string Name var property = (typeof(IncomeTaxRangeConstants)).GetProperty(property_name, BindingFlags.NonPublic | BindingFlags.Static); //Get values from property var values = (Dictionary <IncomeTaxRangeTypes, IncomeTax>)property.GetValue(null, null); values.TryGetValue(incomeTaxRangeType, out IncomeTax result); return(result); }
public IIncomeTaxDiscountCalculator GetIncomeTaxFactory(IncomeTaxRangeTypes incomeTaxRangeTypes) { switch (incomeTaxRangeTypes) { case IncomeTaxRangeTypes.EXEMPT_RANGE: return(new IncomeTaxExemptRange()); case IncomeTaxRangeTypes.FIRST_RANGE: return(new IncomeTaxFirstRange()); case IncomeTaxRangeTypes.SECOND_RANGE: return(new IncomeTaxSecondRange()); case IncomeTaxRangeTypes.THIRD_RANGE: return(new IncomeTaxThirdRange()); default: throw new KeyNotFoundException(); } }
public IncomeTaxFactoryType(Type type, IncomeTaxRangeTypes incomeTaxType) { GetFactoryType = type; IncomeTaxType = incomeTaxType; }
internal IncomeTax(IncomeTaxRangeTypes type, double max_value, double discount) { TYPE = type; MAX_VALUE = max_value; DISCOUNT = discount; }