Пример #1
0
 public QuoteRepository(MasterDataService masterDataService, MotorVehicleDetailsService motorVehicleDetailsService, QuickQuoteService quickQuoteService)
 {
     this._masterDataService          = masterDataService;
     this._motorVehicleDetailsService = motorVehicleDetailsService;
     this._quickQuoteService          = quickQuoteService;
     this._masterDetails = new MasterDetails();
     this._carDetails    = new MotorVehicleDetails();
     this._quickQuote    = new QuickQuote();
     this._vehicleInfo   = new VehicleInfo();
     this._insuredInfo   = new InsuredInfo();
 }
Пример #2
0
        private void btnGetQuote_Click(object sender, EventArgs e)
        {
            InsuranceQuoteServiceClient svcInsuranceQuote = new InsuranceQuoteServiceClient();
            InsuredInfo        objInsuredInfo             = new InsuredInfo();
            InsuranceQuoteInfo objQuoteInfo;

            objInsuredInfo.Name             = txtInsuredName.Text;
            objInsuredInfo.Address          = txtInsuredAddress.Text;
            objInsuredInfo.Age              = txtInsuredAge.Text;
            objInsuredInfo.VehicleMake      = txtVehicleMake.Text;
            objInsuredInfo.VehicleYearBuilt = txtVehicleYearBuilt.Text;

            try
            {
                objQuoteInfo          = svcInsuranceQuote.GetQuote(objInsuredInfo);
                lblMonthlyAmount.Text = string.Format("Your premium will be ${0} per month.", objQuoteInfo.MontlyTotal);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Service Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void btnGetQuote_Click(object sender, EventArgs e)
        {
            InsuranceQuoteServiceClient svcInsuranceQuote = new InsuranceQuoteServiceClient();
            InsuredInfo objInsuredInfo = new InsuredInfo();
            InsuranceQuoteInfo objQuoteInfo;

            objInsuredInfo.Name = txtInsuredName.Text;
            objInsuredInfo.Address = txtInsuredAddress.Text;
            objInsuredInfo.Age = txtInsuredAge.Text;
            objInsuredInfo.VehicleMake = txtVehicleMake.Text;
            objInsuredInfo.VehicleYearBuilt = txtVehicleYearBuilt.Text;

            try
            {
                objQuoteInfo = svcInsuranceQuote.GetQuote(objInsuredInfo);
                lblMonthlyAmount.Text = string.Format("Your premium will be ${0} per month.", objQuoteInfo.MontlyTotal);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Service Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
 private InsuredDetails MapInsuredDetails(InsuredInfo insuredDetails)
 {
     if (insuredDetails != null)
     {
         List <string> addressLine = new List <string>();
         addressLine.Add(insuredDetails.AddressLine1);
         addressLine.Add(insuredDetails.AddressLine2);
         return(new InsuredDetails
         {
             address = new Address
             {
                 lines = addressLine,
                 city = insuredDetails.City,
                 state = "NA",
                 zipCode = insuredDetails.ZipCode
             },
             firstName = insuredDetails.FirstName,
             secondName = insuredDetails.SecondName,
             lastName = insuredDetails.LastName
         });
     }
     return(new InsuredDetails());
 }