private void add_Click(object sender, EventArgs e) { LIC_KIHD_MW.Address addre = new LIC_KIHD_MW.Address("", "", "", ""); LIC_KIHD_MW.PolicyHolder holder = new LIC_KIHD_MW.PolicyHolder("", "", "", addre); LIC_KIHD_MW.Beneficiary BENE = new LIC_KIHD_MW.Beneficiary("", ""); LIC_KIHD_MW.Policy po = new LIC_KIHD_MW.Policy(holder, "", 1, 1, 1, 1, 1, 1, 1, "", "", "", "", BENE, ""); po.addBeneficiary(policyN, firstName.Text, lastName.Text); addBeneficiary addMore = new addBeneficiary(policyN); Hide(); addMore.Closed += (s, arges) => this.Close(); addMore.ShowDialog(); }
private void comfirm_Click(object sender, EventArgs e) { LIC_KIHD_MW.Address addre = new LIC_KIHD_MW.Address("", "", "", ""); LIC_KIHD_MW.PolicyHolder holder = new LIC_KIHD_MW.PolicyHolder("", "", "", addre); LIC_KIHD_MW.Beneficiary BENE = new LIC_KIHD_MW.Beneficiary("", ""); LIC_KIHD_MW.Policy po = new LIC_KIHD_MW.Policy(holder, "", 1, 1, 1, 1, 1, 1, 1, "", "", "", "", BENE, ""); // List<LIC_KIHD_MW.Beneficiary> beneficiary = new List<LIC_KIHD_MW.Beneficiary>(); DateTime dod = DateTime.Parse(dateOfBirth.Text); string policynumber = po.PolicyNumReg(firstName.Text, LastName.Text, dod, StreetAdress.Text, CityLabel.Text, StateLabel.Text, zipCode.Text, FatherAgeAtDeath.Text , MotherAgeAtDeath.Text, CigarettesPerDay.Text, SmokingHistory.Text, BloodPressure.Text, AverageGrams.Text, hd, ca, ho , DangerousActivities.Text, payoffA, monthPremium, agentID); addBeneficiary addB = new addBeneficiary(policynumber); addB.Closed += (s, arges) => this.Close(); // complete register and return back MessageBox.Show("The policy had been created successfully, and your policy number is " + policynumber); addB.ShowDialog(); }