private void btnCreateHangar_Click(object sender, RoutedEventArgs e) { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); ServiceAirNautis.Hangar hangar = new ServiceAirNautis.Hangar(); if (!String.IsNullOrEmpty(txtBoxHangarCapacity.Text)) { int capacity_value; if (int.TryParse(txtBoxHangarCapacity.Text, out capacity_value)) { if (capacity_value > 0) { hangar.Capacity = capacity_value; if (airNautisService.CreateHangar(hangar)) { MessageBox.Show(string.Format("Hangar successfully created with {0} capacity!", capacity_value), "Success", MessageBoxButton.OK); DialogResult = true; } else { MessageBox.Show("Sorry, please verify fields", "Error", MessageBoxButton.OK); } } else { MessageBox.Show("The capacity value needs to be greater than zero", "Alert", MessageBoxButton.OK); txtBoxHangarCapacity.Text = ""; txtBoxHangarCapacity.Focus(); } } else { MessageBox.Show("Value of the field Capacity needs to be a number", "Error", MessageBoxButton.OK); } } }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); this.Populate_DataGrid(); }
public Display_Details() { InitializeComponent(); airNautisService = new ServiceAirNautis.AirNautisServiceClient(); fill_ComboBox(); }
public Deactivate_Airplane() { InitializeComponent(); airNautisService = new ServiceAirNautis.AirNautisServiceClient(); fill_ComboBox(); }
public New_InTravel() { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); InitializeComponent(); fill_ComboBox(); }
public Full_Details(int airplane_id) { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); InitializeComponent(); Fill_Information(airplane_id); }
public Hangar_airplanes(int hangar_number) { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); InitializeComponent(); Fill_Information(hangar_number); }
public Details_Hangar() { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); InitializeComponent(); Populate_Hangar(); }
public Historic_Travel() { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); InitializeComponent(); Populate_Historic(); }
private void btnAddAirplane_Click(object sender, RoutedEventArgs e) { airNautisService = new ServiceAirNautis.AirNautisServiceClient(); ServiceAirNautis.Airplane airplane = new ServiceAirNautis.Airplane(); if (!String.IsNullOrEmpty(txtBoxModel.Text) && !String.IsNullOrEmpty(txtBoxYear.Text) && !String.IsNullOrEmpty(txtBoxCapacity.Text)) { int year_value, capacity_value; if (int.TryParse(txtBoxYear.Text, out year_value)) { if (year_value <= 1970) { MessageBox.Show("Sorry, for reasons of safety we only accept modern airplanes", "Alert", MessageBoxButton.OK); txtBoxYear.Focus(); } if (year_value <= 2013) { if (int.TryParse(txtBoxCapacity.Text, out capacity_value)) { if (capacity_value <= 0) { MessageBox.Show("The capacity value needs to be greater than zero", "Error", MessageBoxButton.OK); txtBoxCapacity.Text = ""; txtBoxCapacity.Focus(); } if (capacity_value > 0 && capacity_value <= 1000) { airplane.Model = txtBoxModel.Text.Trim(); airplane.Year = year_value; airplane.Capacity = capacity_value; airplane.Active = true; if (airNautisService.InsertAirplane(airplane)) { MessageBox.Show(string.Format("Airplane {0} successfully added!", txtBoxModel.Text), "Success", MessageBoxButton.OK); DialogResult = true; } else { MessageBox.Show("Sorry, please verify fields", "Error", MessageBoxButton.OK); } } else { MessageBox.Show("Sorry, no airplane has that number of capacity", "Alert", MessageBoxButton.OK); } } else { MessageBox.Show("Value of the field Capacity needs to be a number", "Error", MessageBoxButton.OK); } } else { MessageBox.Show("Wrong Year value", "Error", MessageBoxButton.OK); txtBoxYear.Focus(); } } else { MessageBox.Show("Value of the field Year needs to be a number", "Error", MessageBoxButton.OK); } } }