public Shoping(UserDTO userDTO) { InitializeComponent(); _bll = new BLLClass(); this.userDTO = userDTO; LoadBooks(); }
public EditBook(Grid parent, Books books, BookDTO bookDTO) { InitializeComponent(); _bll = new BLLClass(); this.books = books; this.parent = parent; this.bookDTO = bookDTO; LoadCBoxex(); txtbox_BookName.Text = bookDTO.Name; numeric_pagescount.Value = bookDTO.PagesCount; datepicker_publishYear.SelectedDate = new DateTime(bookDTO.PublishYear, 1, 1); int index = 0; foreach (var item in comboBox_Author.Items) { if ((item as AuthorDTO).Id == bookDTO.AuthorId) { break; } index++; } comboBox_Author.SelectedIndex = index; index = 0; foreach (var item in comboBox_genre.Items) { if ((item as GenreDTO).Id == bookDTO.GenreId) { break; } index++; } comboBox_genre.SelectedIndex = index; index = 0; foreach (var item in comboBox_publisher.Items) { if ((item as PublisherDTO).Id == bookDTO.PublisherId) { break; } index++; } comboBox_publisher.SelectedIndex = index; index = 0; if (bookDTO.SequelToId != 0) { foreach (var item in comboBox_SequelTo.Items) { if ((item as BookDTO).Id == bookDTO.SequelToId) { break; } index++; } comboBox_SequelTo.SelectedIndex = index; } }
public AddBook(Grid parent, Books books) { InitializeComponent(); _bll = new BLLClass(); this.books = books; this.parent = parent; LoadCBoxex(); }
public AddProduct(Grid parent, Products products) { InitializeComponent(); this.parent = parent; this.products = products; _bll = new BLLClass(); comboBox_Book.ItemsSource = _bll.GetBooksForProducts(); comboBox_Book.DisplayMemberPath = nameof(BookDTO.Name); }
public SearchBooks(UserDTO user) { InitializeComponent(); _bll = new BLLClass(); this.user = user; var genres = _bll.GetGenres().ToList(); genres.Insert(0, new GenreDTO() { Id = 0, Name = "All genres" }); comboBox_genre.ItemsSource = genres; comboBox_genre.DisplayMemberPath = nameof(GenreDTO.Name); comboBox_genre.SelectedIndex = 0; LoadBooks(); }
public Rating() { InitializeComponent(); _bll = new BLLClass(); List <BookDTO> booksDTOs = new List <BookDTO>(); booksDTOs.Add(_bll.MostSalledBook()); dataGrid_book.ItemsSource = booksDTOs; List <AuthorDTO> authorDTOs = new List <AuthorDTO>(); authorDTOs.Add(_bll.MostWriterAuthor()); dataGrid_author.ItemsSource = authorDTOs; List <GenreDTO> genreDTOs = new List <GenreDTO>(); genreDTOs.Add(_bll.MostPopularGenre()); dataGrid_genre.ItemsSource = genreDTOs; }
public Books() { InitializeComponent(); _bll = new BLLClass(); LoadBooks(); }
public Authors() { InitializeComponent(); _bll = new BLLClass(); LoadAuthors(); }
public Publishers() { InitializeComponent(); _bll = new BLLClass(); LoadPublishers(); }
public Products() { InitializeComponent(); _bll = new BLLClass(); LoadProducts(); }