Пример #1
0
 public Shoping(UserDTO userDTO)
 {
     InitializeComponent();
     _bll         = new BLLClass();
     this.userDTO = userDTO;
     LoadBooks();
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public AddBook(Grid parent, Books books)
 {
     InitializeComponent();
     _bll        = new BLLClass();
     this.books  = books;
     this.parent = parent;
     LoadCBoxex();
 }
Пример #4
0
 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);
 }
Пример #5
0
        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();
        }
Пример #6
0
        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;
        }
Пример #7
0
 public Books()
 {
     InitializeComponent();
     _bll = new BLLClass();
     LoadBooks();
 }
Пример #8
0
 public Authors()
 {
     InitializeComponent();
     _bll = new BLLClass();
     LoadAuthors();
 }
Пример #9
0
 public Publishers()
 {
     InitializeComponent();
     _bll = new BLLClass();
     LoadPublishers();
 }
Пример #10
0
 public Products()
 {
     InitializeComponent();
     _bll = new BLLClass();
     LoadProducts();
 }