Exemplo n.º 1
0
 public Policy()
 {
     policyNumber        = "";
     holder              = new PolicyHolder();
     fathersAgeAtDeath   = 0.0;
     motherAgeAtDeath    = 0.0;
     cigsPerDay          = 0.0;
     smokingHis          = 0.0;
     systolicBldPressure = 0.0;
     gramsFatPerDay      = 0.0;
     heartDisease        = false;
     cancer              = false;
     hospitalized        = false;
     dangerousActivities = "";
     startDate           = new DateTime();
     endDate             = new DateTime();
     representativeAgent = new Agent();
     payOffAmount        = 0.0;
     premium             = 0.0;
     beneficiary         = new Beneficiary();
 }
Exemplo n.º 2
0
        public List <Beneficiary> GetBeneficiaries()
        {
            List <Beneficiary> beneficiaries    = new List <Beneficiary>();
            string             connectionString = Settings.Default.SqlConnection;
            SqlConnection      conn             = new SqlConnection(connectionString);
            string             query            = "getBeneficiaries";
            SqlCommand         cmd = new SqlCommand(query, conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@policyNumber", policyNumber);
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                PAG340MiddleWare.Beneficiary newBeneficiary = new Beneficiary();
                newBeneficiary.PolicyNumber = policyNumber;
                newBeneficiary.getDataWithReader(reader);
                beneficiaries.Add(newBeneficiary);
            }
            return(beneficiaries);
        }
Exemplo n.º 3
0
 //This constructor takes in all the indicative date that will be used for the pricing of a new policy.
 public Policy(DateTime DOB, double inFathersAgeAtDeath, double inMothersAgeAtDeath, double inCigsPerDay, double inSmokingHis, double inSystolicBldPressure,
               double inGramsFatPerDay, bool inHeartDisease, bool inCancer, bool inHospitalized, string inDangerousActivities)
 {
     policyNumber        = "";
     holder              = new PolicyHolder();
     holder.BirthDate    = DOB;
     fathersAgeAtDeath   = inFathersAgeAtDeath;
     motherAgeAtDeath    = inMothersAgeAtDeath;
     cigsPerDay          = inCigsPerDay;
     smokingHis          = inSmokingHis;
     systolicBldPressure = inSystolicBldPressure;
     gramsFatPerDay      = inGramsFatPerDay;
     heartDisease        = inHeartDisease;
     cancer              = inCancer;
     hospitalized        = inHospitalized;
     dangerousActivities = inDangerousActivities;
     startDate           = new DateTime();
     endDate             = new DateTime();
     representativeAgent = new Agent();
     payOffAmount        = 0.0;
     premium             = 0.0;
     beneficiary         = new Beneficiary();
 }
Exemplo n.º 4
0
 public Policy(string inPolicyNumber, PolicyHolder inHolder, double inFathersAgeAtDeath, double inMothersAgeAtDeath, double inCigsPerDay, double inSmokingHis, double inSystolicBldPressure,
               double inGramsFatPerDay, bool inHeartDisease, bool inCancer, bool inHospitalized, string inDangerousActivities, DateTime inStartDate, DateTime inEndDate,
               Agent inRepresentativeAgent, double inPayOffAmount, double inPremium, Beneficiary inBeneficiary)
 {
     policyNumber        = inPolicyNumber;
     holder              = inHolder;
     fathersAgeAtDeath   = inFathersAgeAtDeath;
     motherAgeAtDeath    = inMothersAgeAtDeath;
     cigsPerDay          = inCigsPerDay;
     smokingHis          = inSmokingHis;
     systolicBldPressure = inSystolicBldPressure;
     gramsFatPerDay      = inGramsFatPerDay;
     heartDisease        = inHeartDisease;
     cancer              = inCancer;
     hospitalized        = inHospitalized;
     dangerousActivities = inDangerousActivities;
     startDate           = inStartDate;
     endDate             = inEndDate;
     representativeAgent = inRepresentativeAgent;
     payOffAmount        = inPayOffAmount;
     premium             = inPremium;
     beneficiary         = inBeneficiary;
 }