Example #1
0
        private static double PrimaryRebate(short yourage)
        {
            TaxRebateRates rebatesdata = LoadRebatesData();

            var primary   = rebatesdata.TaxRebates[0].PrimaryRebate;
            var primary65 = rebatesdata.TaxRebates[0].PrimaryRebate65;
            var primary75 = rebatesdata.TaxRebates[0].PrimaryRebate75;

            var rebatestruct = new TaxRebateStruct(primary, primary65, primary75);

            double totalrebates;

            if (yourage > 17 && yourage < 65)
            {
                totalrebates = rebatestruct.PrimaryRebate;
            }
            else if (yourage < 75)
            {
                totalrebates = rebatestruct.PrimaryRebate + rebatestruct.PrimaryRebate65;
            }
            else
            {
                totalrebates = rebatestruct.PrimaryRebate + rebatestruct.PrimaryRebate65 + rebatestruct.PrimaryRebate75;
            }

            return(totalrebates);
        }
Example #2
0
        private static double MedicalRebate(bool hasMedical, short numdependants)
        {
            double totalrebate = 0;

            try
            {
                TaxRebateRates rebatesdata = LoadRebatesData();

                var medicaltaxcredit     = rebatesdata.TaxRebates[0].MedicalTaxCredit;
                var medicaltaxcreditplus = rebatesdata.TaxRebates[0].MedicalTaxCreditPlus;

                if (hasMedical)
                {
                    if (numdependants == 0)
                    {
                        totalrebate = medicaltaxcredit;
                    }
                    else if (numdependants == 1)
                    {
                        totalrebate = medicaltaxcredit * 2;
                    }
                    else
                    {
                        totalrebate = (medicaltaxcredit * 2) + (medicaltaxcreditplus * (numdependants - 1));
                    }
                    return(totalrebate);
                }
            }
            catch (Exception exload)
            {
                throw new Exception(exload.Message);
            }
            return(totalrebate);
        }