Exemplo n.º 1
0
        public static void runScenarioSummary()
        {
            runCalcAction( ()=>{
                shts = oWB.Worksheets;
                oSheet = (Worksheet) shts["Projection Input Options"];
                InputOptionsPage userOptionsAndVerification = new InputOptionsPage(oSheet);

                RatingGroups groups = new RatingGroups("Rating Groups", true);
                PriorSurcharge priorSurcharge = new PriorSurcharge("Rating Groups", userOptionsAndVerification.modalAdj);
                NewSurcharge newSurcharge = new NewSurcharge("Rating Groups", userOptionsAndVerification.modalAdj);
                PriorPremiums priorPremiums = new PriorPremiums("Prior Premiums");
                NewPremiums newPremiums = new NewPremiums("New Premiums");
                Census census = new Census("Census");

                System.Data.DataTable rfTableMultipliers = groups.RFactors;
                System.Data.DataTable newPrm = Utility.ConvertListToDataTable(newPremiums.NewPrmLst);
                System.Data.DataTable oldPrm = Utility.ConvertListToDataTable(priorPremiums.OldPrmLst);
                newPrm = Utility.mdlPrm(newPrm, userOptionsAndVerification.modalAdj);
                oldPrm = Utility.mdlPrm(oldPrm, userOptionsAndVerification.modalAdj);
                System.Data.DataTable cns = Utility.ConvertListToDataTable(census.CnLst);
                List<System.Data.DataTable> prSurChrg = priorSurcharge.PSCharge;
                List<System.Data.DataTable> nwSurChrg = newSurcharge.NSCharge;


                //Code works in following way
                //1) optimalCarrierRates chooses best CARRIER rates for MIGRATION ONLY
                //2) ratesToAnchorOffOf is the CARRIER rates to anchor off of (this could be the same as 1) or it could be the second lowest cost carrier)
                //      these are all metallic levels at this point, the anchor plan level is selected later                    
                //3) optimalRatesAndFactors joins the subsidy factors to the optimal rates
                //4) anchoredPlans takes ratesToAnchorOffOf and only keeps the correct metallic level that the user selected
                //5) nwPrm uses the Anchored plans, calcs the subsidy based on the user selected subsidy option and then applies this to the optimalCarrierRates
                //6) fnlCns migrates the population to the correct plan level, then attaches surcharge amounts to the premiums
                //7) finalRateGrid simply attaches the non lowest cost carriers to the rates to provide a complete set of carrier rates. These are treated as a 
                //      buy up with the EE shouldering any burden of buying a non anchored plan.
                //8) prjTb produces exhibit output tabs
                //9) sendCalcLog logs the model use with the model logger

                System.Data.DataTable optimalCarrierRates = FindOptimalCarrierPremiums.FindPremiumCarrier(newPrm, userOptionsAndVerification.defaultAnchorPlan);  //Finds optimal rates
                System.Data.DataTable ratesToAnchorOffOf = FindOptimalCarrierPremiums.FindPremiumCarrier(newPrm, userOptionsAndVerification.ancPln);     //Allows the anchored plan to be different than optimal carrier
                System.Data.DataTable optimalRatesAndFactors = Utility.Join(rfTableMultipliers, optimalCarrierRates);     //Join on factors to optimal rates
                System.Data.DataTable anchoredPlans = AnchorPlans.GetAnchorPlans(ratesToAnchorOffOf, userOptionsAndVerification.ancPln, groups.baselineCoverageTier);     //Get anchor plan and join onto optimal rates and factors
                System.Data.DataTable nwPrm = SubsidyCalculation.CalcBaseSubsidy(optimalRatesAndFactors, anchoredPlans, userOptionsAndVerification);   //calculate Subsidy
                System.Data.DataTable fnlCns = SurchargeCombine.SurChrgCombine(MigrationEngine.mrgCnsPrm(cns, oldPrm, nwPrm, ref userOptionsAndVerification), prSurChrg, nwSurChrg);
                System.Data.DataTable finalRateGrid = Utility.CreateCombinedPremiumExhibit(newPrm, nwPrm);

                ProjectionResults.prjTb(fnlCns, finalRateGrid, userOptionsAndVerification, oWB);
                AxCalcEngineAPI.sendCalcLog(userOptionsAndVerification, urlName, modVersion);
            });
        }
Exemplo n.º 2
0
 public static void runScenarioSummary()
 {
     runCalcAction(delegate {
         AxCalcEngineAPI.AxCalcEngineAPI.Initialize();
         shts = oWB.Worksheets;
         oSheet = (Worksheet) shts["Projection Input Options"];
         string ancPln = (string) oSheet.Range("anchorPlan").Value;
         string option = (string) oSheet.Range("subType").Value;
         string mgOpt = (string) oSheet.Range("migType").Value;
         string str4 = (string) oSheet.Range("projNme").Value;
         string inMode = (string) oSheet.Range("modal").Value;
         string outMode = (string) oSheet.Range("modalOut").Value;
         string str7 = (string) oSheet.Range("clientNme").Value;
         string str8 = oSheet.Range("clientID").Value.ToString();
         string str9 = "";
         double modalAdj = Utility.modalConvert(inMode, outMode);
         if ((string.IsNullOrEmpty(str7) || string.IsNullOrEmpty(str8)) || (str8.Length != 8))
         {
             throw new Exception("Enter valid client name and ID");
         }
         if (string.IsNullOrEmpty(str4))
         {
             throw new Exception("You must enter a projection name");
         }
         string displayName = "";
         try
         {
             displayName = AxCalcEngineAPI.AxCalcEngineAPI._user.DisplayName;
         }
         catch
         {
             throw new Exception("Establishing a Connection");
         }
         if (displayName.Equals("Offline User"))
         {
             throw new Exception("You must be connected to the Aon Network to run Ax Model");
         }
         RatingGroups groups = new RatingGroups("Rating Groups", true);
         PriorSurcharge surcharge = new PriorSurcharge("Rating Groups", modalAdj);
         NewSurcharge surcharge2 = new NewSurcharge("Rating Groups", modalAdj);
         PriorPremiums premiums = new PriorPremiums("Prior Premiums");
         NewPremiums premiums2 = new NewPremiums("New Premiums");
         Census census = new Census("Census");
         System.Data.DataTable first = groups.RFactors;
         System.Data.DataTable prm = Utility.convertListToDataTable(premiums2.NewPrmLst);
         System.Data.DataTable table3 = Utility.convertListToDataTable(premiums.OldPrmLst);
         prm = Utility.mdlPrm(prm, modalAdj);
         table3 = Utility.mdlPrm(table3, modalAdj);
         System.Data.DataTable cns = Utility.convertListToDataTable(census.CnLst);
         List<System.Data.DataTable> prSurChrg = surcharge.PSCharge;
         List<System.Data.DataTable> nwSurChrg = surcharge2.NSCharge;
         System.Data.DataTable second = Utility.findPremiumCarrier(prm, str9);
         System.Data.DataTable dt = Utility.findPremiumCarrier(prm, ancPln);
         System.Data.DataTable table7 = Utility.Join(first, second);
         System.Data.DataTable anc = Utility.getAnchorPlans(dt, ancPln, groups.bsCvTr);
         System.Data.DataTable nwPrm = Utility.calcBaseSubsidy(table7, anc, option, modalAdj);
         System.Data.DataTable fnlCns = Utility.SurChrgCombine(Utility.mrgCnsPrm(cns, table3, nwPrm, mgOpt), prSurChrg, nwSurChrg);
         groups = null;
         surcharge = null;
         surcharge2 = null;
         premiums = null;
         premiums2 = null;
         census = null;
         prjTb(fnlCns, nwPrm, str4);
         AxCalcEngineAPI.AxCalcEngineAPI.sendCalcLog(str7, str8, "http://axmodellogger.azurewebsites.net/Default.aspx", "AxModel_0.9");
     });
 }