Beispiel #1
0
        private void BtnReject_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Records Rejected");
            Endorsement end = sq.Endorsements.Where(x => x.Policynumber == txtPolicyNumber.Text).OrderByDescending(x => x.TransactionId).First();

            end.EndorsementStatus = "Changes Rejected";
            sq.SaveChanges();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Endorsement end = new Endorsement();

            try
            {
                DateTime dt       = Convert.ToDateTime(txtDob.Text);
                Customer customer = sq.Customers.Where(x => x.Dob == dt).Select(x => x).FirstOrDefault();
                end.CustId       = customer.CustId;
                end.Policynumber = txtPolicyNumber.Text;
                InsuranceProduct product = sq.InsuranceProducts.Where(x => x.Products == txtProductName.Text).Select(x => x).FirstOrDefault();
                end.ProductId               = product.ProductId;
                end.InsuredName             = txtInsuredName.Text;
                end.InsuredAge              = Convert.ToInt32(txtAge.Text);
                end.Dob                     = Convert.ToDateTime(txtDob.Text);
                end.Nominee                 = txtNominee.Text;
                end.Relation                = txtRelation.Text;
                end.Address                 = txtAddress.Text;
                end.Telephone               = txtTelephone.Text;
                end.PremiumPaymentFrequency = txtPaymentFrequency.Text;
                if (btnMale.IsChecked == true)
                {
                    end.Gender = "Male";
                }
                else
                {
                    end.Gender = "Female";
                }
                if (btnSmoker.IsChecked == true)
                {
                    end.Smoker = "Smoker";
                }
                else
                {
                    end.Smoker = "NonSmoker";
                }
                sq.Endorsements.Add(end);
                sq.SaveChanges();
            }
            catch (Exception)
            {
                throw;
            }

            MessageBox.Show("Request Sent");
        }
Beispiel #3
0
        private void BtnAccept_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Policy p1 = sq.Policys.Single(x => x.PolicyNumber == txtPolicyNumber.Text);
                Policy p2 = sq1.Policys.Single(x => x.PolicyNumber == txtPolicyNumber.Text);
                p2.InsuredName             = txtInsuredName.Text;
                p2.InsuredAge              = Convert.ToInt32(txtAge.Text);
                p2.Nominee                 = txtNominee.Text;
                p2.Relation                = txtRelation.Text;
                p2.PremiumPaymentFrequency = txtPaymentFrequency.Text;
                sq1.SaveChanges();

                Customer c1 = sq.Customers.Single(x => x.CustId == p1.Customerno);
                c1.Dob = Convert.ToDateTime(txtDob.Text);
                if (btnMale.IsChecked == true)
                {
                    c1.Gender = "Male";
                }
                else
                {
                    c1.Gender = "Female";
                }
                c1.Address   = txtAddress.Text;
                c1.Telephone = txtTelephone.Text;
                if (btnSmoker.IsChecked == true)
                {
                    c1.Smoker = "Smoker";
                }
                else
                {
                    c1.Smoker = "NonSmoker";
                }

                MessageBox.Show("Records Accepted");
                sq.SaveChanges();
                Endorsement end = sq.Endorsements.Where(x => x.Policynumber == txtPolicyNumber.Text).OrderByDescending(x => x.TransactionId).First();
                end.EndorsementStatus = "Changes Accepted";
                sq.SaveChanges();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }