Beispiel #1
0
        protected override HashSet <Subject> GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string expTypes = termDict["ExposureTypes"].ToString();
            string COLTypes = termDict["CausesOfLoss"].ToString();

            ExposureTypeCollection termExp;
            COLCollection          termCOL;

            if (COLTypes == "")
            {
                termCOL = contractSubject.CauseOfLossSet;
            }
            else
            {
                termCOL = new COLCollection(COLTypes);
            }

            if (expTypes == "")
            {
                termExp = contractSubject.ExposureTypes;
            }
            else
            {
                termExp = ExposureTypeCollection.BuildFromString(expTypes);
            }

            string          termSchedule = termDict["Schedule"].ToString();
            ScheduleOfRITEs schedule     = ExpData.GetSchedule(termSchedule);

            bool isPerRisk = false;

            if (termDict.ContainsKey("PerRisk") & termDict["PerRisk"].ToString() == "True")
            {
                isPerRisk = true;
            }

            PrimarySubject sub = new PrimarySubject(schedule, termExp, termCOL, isPerRisk);

            //DO NOT Explode
            //if (termDict.ContainsKey("PerRisk")
            //    & termDict["PerRisk"].ToString() == "True")
            //    return new HashSet<Subject>(ExplodeSubjectForPerRisk(sub).Cast<Subject>());
            //else
            //    return new HashSet<Subject>(){sub};

            return(new HashSet <Subject>()
            {
                sub
            });
        }
Beispiel #2
0
        protected override HashSet <Subject> GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string expTypes = termDict["ExposureTypes"].ToString();
            string COLTypes = termDict["CausesOfLoss"].ToString();

            ExposureTypeCollection termExp;
            COLCollection          termCOL;

            if (COLTypes == "")
            {
                termCOL = contractSubject.CauseOfLossSet;
            }
            else
            {
                termCOL = new COLCollection(COLTypes);
            }

            if (expTypes == "")
            {
                termExp = contractSubject.ExposureTypes;
            }
            else
            {
                termExp = ExposureTypeCollection.BuildFromString(expTypes);
            }

            string termSchedule = termDict["Schedule"].ToString();
            ScheduleOfContracts grossSchedule;
            ScheduleOfContracts cededSchedule;

            if (termSchedule == "")
            {
                ReinsuranceSubject treatyConCub = contractSubject as ReinsuranceSubject;
                grossSchedule = treatyConCub.GrossSchedule;
                cededSchedule = treatyConCub.CededSchedule;
            }
            else
            {
                throw new NotSupportedException("Cannot support treaty terms with Schedule Of Contract subjects...");
            }

            return(new HashSet <Subject>()
            {
                new ReinsuranceSubject(grossSchedule, cededSchedule, termExp, termCOL)
            });
        }
Beispiel #3
0
        private bool SetDeclarations(Declarations graph_declarations, Dictionary <String, Object> cdl_declarations, out string message)
        {
            message = "";
            try
            {
                graph_declarations.Name = Convert.ToString(cdl_declarations["Name"]);

                if (cdl_declarations.ContainsKey("Currency"))
                {
                    graph_declarations.Currency = Convert.ToString(cdl_declarations["Currency"]);
                }
                if (cdl_declarations.ContainsKey("Inception"))
                {
                    graph_declarations.Inception = Convert.ToDateTime(cdl_declarations["Inception"]);
                }
                else
                {
                    graph_declarations.Inception = DateTime.Now;
                }
                if (cdl_declarations.ContainsKey("Expiration"))
                {
                    graph_declarations.Expiration = Convert.ToDateTime(cdl_declarations["Expiration"]);
                }
                else
                {
                    graph_declarations.Expiration = graph_declarations.Inception.AddYears(1);
                }

                if (cdl_declarations.ContainsKey("ContractType"))
                {
                    graph_declarations.ContractType = Convert.ToString(cdl_declarations["ContractType"]);
                }
                else
                {
                    throw new NotSupportedException("This prototype requies CDL to specify a recognized Contract Type");
                }

                if (cdl_declarations.ContainsKey("CausesOfLoss"))
                {
                    graph_declarations.CausesofLoss = new COLCollection(Convert.ToString(cdl_declarations["CausesOfLoss"]));
                }
                else
                {
                    graph_declarations.CausesofLoss = CauseOfLoss.GetDefaultCOLs();
                }

                if (cdl_declarations.ContainsKey("ExposureTypes"))
                {
                    graph_declarations.ExposureTypes = ExposureTypeCollection.BuildFromString(Convert.ToString(cdl_declarations["ExposureTypes"]));
                }
                else
                {
                    graph_declarations.ExposureTypes = ExposureTypeCollection.GetDefaultExposureTypes();
                }

                if (cdl_declarations.ContainsKey("Schedule"))
                {
                    try { graph_declarations.Schedule = expData.GetSchedule(Convert.ToString(cdl_declarations["Schedule"])); }
                    catch (Exception ex) { graph_declarations.Schedule = null; }
                }

                if (cdl_declarations.ContainsKey("GrossPosition"))
                {
                    graph_declarations.GrossPosition = Convert.ToString(cdl_declarations["GrossPosition"]).Split(',').ToList();
                }
                else
                {
                    graph_declarations.GrossPosition = new List <string>();
                }

                if (cdl_declarations.ContainsKey("CededPosition"))
                {
                    graph_declarations.CededPosition = Convert.ToString(cdl_declarations["CededPosition"]).Split(',').ToList();
                }
                else
                {
                    graph_declarations.CededPosition = new List <string>();
                }

                //Handle Claims Adjustment Options
                if (cdl_declarations.ContainsKey("Claims Adjustment Options"))
                {
                    Dictionary <String, Object> ClaimsAdjustmentOptions = cdl_declarations["Claims Adjustment Options"] as Dictionary <String, Object>;
                    if (ClaimsAdjustmentOptions.ContainsKey("Claims Adjustment Sublimits"))
                    {
                        string sublimitAdjustment = ClaimsAdjustmentOptions["Claims Adjustment Sublimits"].ToString();
                        if (sublimitAdjustment == "Net Of Deductible")
                        {
                            graph_declarations.GroundUpSublimits = false;
                        }
                        else if (sublimitAdjustment == "GroundUp")
                        {
                            graph_declarations.GroundUpSublimits = true;
                        }
                        else
                        {
                            throw new JSONParseException("Cannot support Claims Adjustment Option for Sublimits: " + sublimitAdjustment);
                        }
                    }

                    if (ClaimsAdjustmentOptions.ContainsKey("Claims Adjustment Deductibles"))
                    {
                        string dedAdjustment = ClaimsAdjustmentOptions["Claims Adjustment Deductibles"].ToString();
                        if (dedAdjustment == "Absorbable")
                        {
                            graph_declarations.MinimumAbsorbingDed = true;
                        }
                        else
                        {
                            throw new JSONParseException("Cannot support Claims Adjustment Option for Deductibles: " + dedAdjustment);
                        }
                    }
                }

                //Get Hours clause declarations
                graph_declarations.HoursClauses = new List <HoursClause>();
                Object[] hoursclauses;
                if (cdl_declarations.ContainsKey("Hours Clauses"))
                {
                    hoursclauses = cdl_declarations["Hours Clauses"] as object[];
                    List <Object> lst_hoursclauses = hoursclauses.OfType <Object>().ToList();

                    foreach (Dictionary <String, Object> hc in lst_hoursclauses)
                    {
                        HoursClause objHC = new HoursClause();
                        objHC.SetHoursClause(hc);
                        graph_declarations.HoursClauses.Add(objHC);
                    }

                    graph_declarations.IsHoursClause = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }