Exemplo n.º 1
0
 public PawnCalcItem(Pawn pawn)
 {
     if (pawn.Amount > 0)
     {
         numberofguns = pawn.NumberOfFirearms;
         amount       = pawn.Amount;
         InterestCalcEngine calcengine30;
         try
         {
             calcengine30 = new InterestCalcEngine(pawn, pawn.Date.Date.AddDays(30), false);
         }
         catch (Exception Ex)
         {
             throw new Exception("Unable to Calculate Interest", Ex);
         }
         MonthlyInterestAmount = "Monthly Interest is: " + calcengine30.MonthlyInterest.ToString("c2");
         FinanceCharge         = "Finaince Charge is: " + calcengine30.Interest.ToString("c2");
         //FinanceCharge = (R.FirearmFee * GunCount) + R.StorageFee + R.PreparationAmount + (R.MonthlyInterestAmount * 3)
         PickupCost = "Pickup cost is" + (calcengine30.Interest + (calcengine30.MonthlyInterest * 2) + pawn.Amount).ToString("c2");
         RenewCost  = "Renew Cost is: " + (calcengine30.Interest + (calcengine30.MonthlyInterest * 2)).ToString("c2");
         By30       = "By " + pawn.Date.Date.AddDays(30).ToString("d") + ", " + (calcengine30.Interest + (calcengine30.MonthlyInterest * 0) + pawn.Amount).ToString("c2") + " is due";
         By60       = "By " + pawn.Date.Date.AddDays(60).ToString("d") + ", " + (calcengine30.Interest + (calcengine30.MonthlyInterest * 1) + pawn.Amount).ToString("c2") + " is due";
         By90       = "By " + pawn.Date.Date.AddDays(90).ToString("d") + ", " + (calcengine30.Interest + (calcengine30.MonthlyInterest * 2) + pawn.Amount).ToString("c2") + " is due";
     }
 }
Exemplo n.º 2
0
        public PawnQueueItem(Data.Pawn pawn, PawnCalcSelection selection)
        {
            Pawn = pawn;
            PawnCalcSelection = selection;

            selections = new Collection <PawnCalcSelection>();

            decimal interestNow = new InterestCalcEngine(pawn, DateTime.Now.Date, false).Interest;
            decimal interest90  = new InterestCalcEngine(pawn, Pawn.Date.Date.AddDays(90), false).Interest;
            decimal interest90PlusInterestOnly = new InterestCalcEngine(pawn, Pawn.Date.Date.AddDays(90), true).Interest;

            if (Pawn.Date.Date.AddDays(90) > DateTime.Now.Date)                                                                                                            // hasn't expired
            {
                selections.Add(new PawnCalcSelection(PawnActionEnum.Redeem, DateTime.Now.Date, interestNow + Pawn.Amount, interestNow, true, ""));                         // Today
                selections.Add(new PawnCalcSelection(PawnActionEnum.Renew, Pawn.Date.Date.AddDays(90), interest90, interest90, true, ""));                                 // 90 day
            }
            else                                                                                                                                                           // has expired
            {
                selections.Add(new PawnCalcSelection(PawnActionEnum.Redeem, DateTime.Now.Date, interestNow + Pawn.Amount, interestNow, true, ""));                         // setup + interest
                selections.Add(new PawnCalcSelection(PawnActionEnum.Renew, Pawn.Date.Date.AddDays(90), interest90, interest90, true, "Backdate"));                         // renew backdate (90 day), default
                selections.Add(new PawnCalcSelection(PawnActionEnum.Renew, DateTime.Now.Date, interest90PlusInterestOnly, interest90PlusInterestOnly, false, "Int Only")); // renew today, extra interest only
                selections.Add(new PawnCalcSelection(PawnActionEnum.Renew, DateTime.Now.Date, interestNow, interestNow, false, "Full"));                                   // renew today, full setup
            }
        }