예제 #1
0
        private void btnCreateInsurance_Click(object sender, RoutedEventArgs e)
        {
            AirlineInsurance.InsuranceType  type  = (AirlineInsurance.InsuranceType)cbType.SelectedItem;
            AirlineInsurance.InsuranceScope scope = (AirlineInsurance.InsuranceScope)cbScope.SelectedItem;
            AirlineInsurance.PaymentTerms   terms = (AirlineInsurance.PaymentTerms)cbTerms.SelectedItem;
            Boolean allAirliners = cbAllAirliners.IsChecked.Value;
            int     lenght       = Convert.ToInt16(cbLength.SelectedItem);
            int     amount       = Convert.ToInt32(slAmount.Value);

            AirlineInsurance insurance = AirlineInsuranceHelpers.CreatePolicy(this.Airline.Airline, type, scope, terms, allAirliners, lenght, amount);
        }
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            AirlineInsurance.InsuranceType  type  = (AirlineInsurance.InsuranceType)cbType.SelectedItem;
            AirlineInsurance.InsuranceScope scope = (AirlineInsurance.InsuranceScope)cbScope.SelectedItem;
            AirlineInsurance.PaymentTerms   terms = (AirlineInsurance.PaymentTerms)cbTerms.SelectedItem;
            Boolean allAirliners = cbAllAirliners.IsChecked.Value;
            int     lenght       = Convert.ToInt16(ucLength.Value);
            int     amount       = Convert.ToInt32(cbAmount.SelectedItem);

            AirlineInsurance insurance = AirlineInsuranceHelpers.CreatePolicy(this.Airline, type, scope, terms, allAirliners, lenght, amount);

            if (PopUpConfirmInsurance.ShowPopUp(insurance) != null)
            {
                this.Airline.addInsurance(insurance);
            }

            clearValues();
        }