private void addBook(String isbn) { if (tb_titleBook.Text == "" || tb_authorName.Text == "" || tb_editorName.Text == "" || tb_genreName.Text == "" || tb_resumeLivre.Text == "") { return; } String bookTitle = tb_titleBook.Text; String bookAuthor = tb_authorName.Text; String bookEditor = tb_editorName.Text; String bookGenres = tb_genreName.Text; String bookResume = tb_resumeLivre.Text; List <Modele.Auteur> lstAuteurs = getAuthors(bookAuthor); List <Modele.Genre> lstGenres = getGenres(bookGenres); Modele.Oeuvre oeuvre = new Modele.Oeuvre(bookTitle, bookResume, isbn, lstGenres, lstAuteurs); Modele.Exemplaire exemplaire; if (bookEditor != "" && bookEditor != null) { Modele.Editeur editeur = new Modele.Editeur(bookEditor); exemplaire = new Modele.Exemplaire(oeuvre, editeur); } else { exemplaire = new Modele.Exemplaire(oeuvre); } this.Gestionnaire.AddExemplaire(exemplaire); this.mainWindow.Gestionnaire = this.Gestionnaire; this.mainWindow.UpdateListe(); }
public SortableListView(Modele.Gestionnaire gestionnaire, MainWindow w) { InitializeComponent(); this.ListeLivre = new ObservableCollection <Livre>(); this.Gestionnaire = gestionnaire; this.ListeExemplaires = gestionnaire.ListeExemplaires; WidthColumn = (int)(lv_Livres.Width); SetListViewItems(); DataContext = this; this.window = w; }
public AddBookLayout(Modele.Gestionnaire _gestionnaire, Window win, MainWindow mainWindow) { InitializeComponent(); tbk_authorName.Text = "Nom de l'auteur"; tbk_editorName.Text = "Nom de l'éditeur"; tbk_genreName.Text = "Genre du livre"; tbk_titleBook.Text = "Titre du livre"; this.Gestionnaire = _gestionnaire; tbk_ISBNBook.Text = "Numéro ISBN du livre"; this.w = win; this.mainWindow = mainWindow; }
public MainWindow() { this.WindowState = WindowState.Maximized; InitializeComponent(); this.Gestionnaire = new Modele.Gestionnaire(); this.listeAffichage = new SortableListView(this.Gestionnaire, this); this.detailsBook = new BookLayout(); liste.Content = this.listeAffichage; details.Navigate(this.detailsBook); ListeRetourAttente lra = new ListeRetourAttente(); Window win = new Window(); win.Title = "Liste des livres en attentes de retour"; win.Content = lra; win.SizeToContent = SizeToContent.WidthAndHeight; win.ResizeMode = System.Windows.ResizeMode.NoResize; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); }
private void btn_annuler_Click(object sender, RoutedEventArgs e) { this._win.Close(); Modele.Gestionnaire gestionnaire = new Modele.Gestionnaire(); gestionnaire.DeletePret(_pret); }
public void UpdateListView(Modele.Gestionnaire gestionnaire) { this.Gestionnaire = gestionnaire; this.ListeExemplaires = gestionnaire.ListeExemplaires; SetListViewItems(); }