private void buttonMaj_Click(object sender, RoutedEventArgs e) { Navire NavireAModifier = (Navire)dataGridListeNavire.SelectedValue; AccesAuxDonneesNavire.ModifierNavire(NavireAModifier); dataGridListeNavire.Items.Refresh(); }
private void buttonSupprimer_Click(object sender, RoutedEventArgs e) { Navire NavireASupprime = (Navire)dataGridListeNavire.SelectedValue; AccesAuxDonneesNavire.SupprimerNavire(NavireASupprime); LesNavires.Remove(NavireASupprime); dataGridListeNavire.Items.Refresh(); }
private void Page_Loaded(object sender, RoutedEventArgs e) { LesPilotes = AccesAuxDonneesPilote.ChargerPilotes(); ComboBoxPiloteArrivee.DataContext = LesPilotes; ComboBoxPiloteDepart.DataContext = LesPilotes; LesAgents = AccesAuxDonneesAgent.ChargerAgents(); ComboBoxAgent.DataContext = LesAgents; LesNavires = AccesAuxDonneesNavire.ChargerNavires(); ComboBoxNumLlyods.DataContext = LesNavires; LesPorts = AccesAuxDonneesPort.ChargerPorts(); ComboBoxPorProv.DataContext = LesPorts; ComboBoxPorDest.DataContext = LesPorts; LesTypesDeCargaisons = AccesAuxDonneesTypesDeCargaisons.ChargerTypesDeCargaisons(); ComboBoxTypeFret.DataContext = LesTypesDeCargaisons; }
private void buttonEnregistrer_Click(object sender, RoutedEventArgs e) { LeNavire.NumCom = Convert.ToInt32(ComboBoxNumCom.Text); LeNavire.CodPor = ComboBoxCodPor.Text; LeNavire.CTyNav = ComboBoxCTyNav.Text; LeNavire.NumArm = Convert.ToInt32(ComboBoxNumArm.Text); LeNavire.DatDre = (DateTime)DatePickerDatDre.SelectedDate; AccesAuxDonneesNavire.AjouterNavire(LeNavire);// Insertion de l'objet dans le BD // Raz des TextBox textBoxNumLlo.Text = ""; textBoxNomNav.Text = ""; textBoxAnnCon.Text = ""; DatePickerDatDre.Text = ""; textBoxLarNav.Text = ""; textBoxLongNav.Text = ""; textBoxTirEau.Text = ""; textBoxProNav.Text = ""; textBoxCapNav.Text = ""; ComboBoxNumCom.Text = ""; ComboBoxNumArm.Text = ""; ComboBoxCTyNav.Text = ""; ComboBoxCodPor.Text = ""; }
public PageListeNavire() { InitializeComponent(); LesNavires = AccesAuxDonneesNavire.ChargerNavires(); this.DataContext = LesNavires; }