void loadEnchere() { lp = EnchereORM.listeEnchere(); myDataObject = new EnchereViewModel(); //LIEN AVEC la VIEW listeEncheres.ItemsSource = lp; // bind de la liste avec la source, permettant le binding. }
void loadEnchere() { Enchere = EnchereORM.listeEnchere(); myDataObjectEnchere = new EnchereViewModel(); //LIEN AVEC la VIEW EnchereCombobox.ItemsSource = Enchere; // bind de la liste avec la source, permettant le binding.#2#*/ }
void loadEncheres() { en = EnchereORM.listeEncheres(); myDataObjectEnchere = new EnchereViewModel(); ComboBoxEnchere.ItemsSource = en; //LIEN AVEC la VIEW /*listeEncheres.ItemsSource = lp; // bind de la liste avec la source, permettant le binding.*/ }
private void DeleteEnchere(object sender, RoutedEventArgs e) { if (ListeEncheresGrid.SelectedIndex >= 0 && ListeEncheresGrid.SelectedIndex < _encheres.Count) { EnchereORM.DeleteEnchere(_encheres.ElementAt(ListeEncheresGrid.SelectedIndex)); _encheres.RemoveAt(ListeEncheresGrid.SelectedIndex); } }
private void ModifyEnchere(object sender, RoutedEventArgs e) { if (InputDateHeureVente.SelectedDate != null || !string.IsNullOrEmpty(InputPrixProposer.Text)) { _enchere.PrixProposer = int.TryParse(InputPrixProposer.Text, out _) ? int.Parse(InputPrixProposer.Text) : 0; _enchere.IsAdjuger = InputIsAdjuger.IsChecked ?? false; _enchere.DateHeureVente = InputDateHeureVente.SelectedDate ?? DateTime.Now; if (_utilisateur == null) { InputOrdreAchat.Text = "ordreAchat1"; } if (string.IsNullOrEmpty(InputLotId.Text)) { InputLotId.Text = "lot1"; } if (string.IsNullOrEmpty(InputCommissaireId.Text)) { InputCommissaireId.Text = "commissaire1"; } // Donc ça c'est bon if (!string.IsNullOrEmpty(InputOrdreAchat.Text)) { _enchere.OrdreAchatEnchere = OrdreAchatORM.GetOrdreAchatById(InputOrdreAchat.Text); } if (!string.IsNullOrEmpty(InputLotId.Text)) { _enchere.LotEnchere = LotORM.GetLotById(InputLotId.Text); } if (!string.IsNullOrEmpty(InputCommissaireId.Text)) { _enchere.CommissaireEnchere = CommissaireORM.GetCommissaireById(InputCommissaireId.Text); } _enchere.UtilisateurEnchere = _utilisateur; EnchereORM.UpadateEnchere(_enchere); _win.Close(); } else { MessageBox.Show("Veuillez compléter tout les champs !"); } }
private void supprEnchere(object sender, RoutedEventArgs routedEventArgs) { if (listeEncheres.SelectedItem is EnchereViewModel) { EnchereViewModel toRemove = (EnchereViewModel)listeEncheres.SelectedItem; lp.Remove(toRemove); listeEncheres.Items.Refresh(); EnchereORM.supprimerEnchere(selectedEnchereId); } }
private void OnPropertyChanged(string info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); this.PropertyChanged(this, new PropertyChangedEventArgs(info)); EnchereORM.updateEnchere(this); } }
public ListeEncheresView(Window win = null, List <Enchere> selectedEncheres = null) { InitializeComponent(); _selectedEncheres = selectedEncheres; if (selectedEncheres == null) { selectMode.Visibility = Visibility.Collapsed; } _encheres = new ObservableCollection <Enchere>(EnchereORM.GetAllEnchere()); _contextEnchere = new Enchere(); GenerateDataList(); }
private void btnAjouter(object sender, RoutedEventArgs e) { myDataObject.id = EnchereDAL.getMaxIdEnchere() + 1; lp.Add(myDataObject); EnchereORM.insertEnchere(myDataObject); compteur = lp.Count(); // Comme on a inséré une Enchere, on crée un nouvel objet EnchereViewModel // Et on réatache tout ce qu'il faut pour que la vue soit propre myDataObject = new EnchereViewModel(); // Comme le contexte des élément de la vue est encore l'ancien EnchereViewModel, // On refait les liens entre age, slider, textbox, bouton et le nouveau EnchereViewModel date_vente_enchere.DataContext = myDataObject; ComboBoxLieu.DataContext = myDataObject; }
private void EnchereButton_Click(object sender, RoutedEventArgs e) { myDataObjectEnchere.idEnchereProperty = EnchereDAL.getMaxIdEnchere() + 1; c.Add(myDataObjectEnchere); EnchereORM.insertEnchere(myDataObjectEnchere); compteur = c.Count(); /*listeEncheres.Items.Refresh();*/ myDataObjectEnchere = new EnchereViewModel(); nomTextBox.DataContext = myDataObjectEnchere; heureTextBox.DataContext = myDataObjectEnchere; dateVenteTextBox.DataContext = myDataObjectEnchere; comboxBoxLieu.DataContext = myDataObjectEnchere; idAdmincomboBox.DataContext = myDataObjectEnchere; EnchereButton.DataContext = myDataObjectEnchere; }
public HomeTabView(MainWindow parent) { this.parent = parent; InitializeComponent(); DALconnection.OpenConnection(); // var user = UtilisateurORM.GetAllUtilisateur(); // var test = EnchereDAL.SelectAllEnchere(); // var user = EnchereORM.GetAllEnchere(); // var user = EnchereORM.GetEnchereById("enchere1"); // OrdreAchat ordreAchat = OrdreAchatORM.GetOrdreAchatById("ordreAchat1"); // Lot lot = LotORM.GetLotById("lot1"); // Commissaire commissaire = CommissaireORM.GetCommissaireById("commissaire1"); // // Enchere enchere = new Enchere("EnchereTestPOUEEEEET", 10.1, false, DateTime.Now, ordreAchat,lot,commissaire, new Utilisateur()); // EnchereORM.InsertOrAddNewEnchere(enchere); var list = EnchereORM.GetAllEnchere(); var i = 1; }
void loadEnchere() { enchere = EnchereORM.listeEnchere(); myDataObjectLot = new LotViewModel(); idEnchereComboBox.ItemsSource = enchere; }
void loadEnchere() { c = EnchereORM.listeEnchere(); myDataObjectEnchere = new EnchereViewModel(); /*listeEncheres.ItemsSource = c;*/ }