private void CreateApplicationButton_Click(object sender, System.EventArgs e)
 {
     if (ApplicationInStockRadioButton.Checked)
     {
         Application = new UIApplicationsInStock(NameOfBuyerTextBox.Text, _car)
             {
                 CellNumber = CallNumberTextBox.Text
             };
     }
     if (ApplicationOfDeliveryRadioButton.Checked)
     {
         Application = new UIApplicationsForDelayedDelivery(NameOfBuyerTextBox.Text, _car,
                                                            Convert.ToInt32(PercentTextBox.Text))
             {
                 CellNumber = CallNumberTextBox.Text
             };
     }
     DialogResult = DialogResult.OK;
     Close();
 }
 public CalculateApplicationForm(Applications application)
 {
     _application = application;
     InitializeComponent();
     NameOfBuyerValueLabel.Text = _application.NameOfBuyer;
     CallNumberValueLabel.Text = _application.CellNumber;
     if (_application is UIApplicationsForDelayedDelivery)
     {
         var app = (UIApplicationsForDelayedDelivery)_application;
         PercentValueLabel.Text = app.SalePercent.ToString()+" %";
     }
     if (_application is UIApplicationsInStock)
     {
         PercentLabel.Visible = false;
     }
     CarInformationLabel.Text = Rus_Resources.CalculateApplicationForm_CalculateApplicationForm_CarModel +
                                _application.Car.Name +
                                Rus_Resources.CalculateApplicationForm_CalculateApplicationForm_CarCost +
                                _application.СalculateCost();
 }
Example #3
0
 public void RemoveApplication(Applications application)
 {
     _applicationsForPurchase.Remove(application);
 }
Example #4
0
 public void AddApplication(Applications application)
 {
     _applicationsForPurchase.Add(application);
 }