Пример #1
0
        public FormBookDetail(string info)
        {
            InitializeComponent();
            Connect2DB    connect    = new Connect2DB();
            List <string> bookDetail = new List <string>();

            bookDetail = connect.bookDetails(info);
            string bookID, bookName, author, lent, categoryID, languageID, description, publisher, category, language;

            if (bookDetail.Capacity > 0)
            {
                bookID      = bookDetail.ElementAt(0);
                bookName    = "Book name: " + bookDetail.ElementAt(1);
                author      = "Author: " + bookDetail.ElementAt(2);
                lent        = "Lent status: " + bookDetail.ElementAt(3);
                categoryID  = bookDetail.ElementAt(4);
                languageID  = bookDetail.ElementAt(5);
                description = "Description: " + bookDetail.ElementAt(6);
                publisher   = "Publisher :" + bookDetail.ElementAt(7);

                language = "Language: " + connect.bookLanguage(languageID);
                category = "Category: " + connect.bookCategory(categoryID);

                BookName.Text    = bookName;
                Author.Text      = author;
                Publisher.Text   = publisher;
                Category.Text    = category;
                Language.Text    = language;
                Lent.Text        = lent;
                Description.Text = description;
            }
        }
Пример #2
0
        public FormBookDetails(string info, string userID)
        {
            InitializeComponent();
            this.userID        = userID;
            this.StartPosition = FormStartPosition.CenterScreen;
            List <string> bookDetail = new List <string>();

            bookDetail = connect.bookDetails(info);
            string bookName, author, lent, categoryID, languageID, desc, publisher, category, language;

            string[] descrpition;
            if (bookDetail.Capacity > 0)
            {
                bookID     = bookDetail.ElementAt(0);
                bookName   = "Book name: " + bookDetail.ElementAt(1);
                author     = "Author: " + bookDetail.ElementAt(2);
                lent       = "Lent status: " + bookDetail.ElementAt(3);
                categoryID = bookDetail.ElementAt(4);
                languageID = bookDetail.ElementAt(5);
                desc       = bookDetail.ElementAt(6);
                publisher  = "Publisher :" + bookDetail.ElementAt(7);

                language = "Language: " + connect.bookLanguage(languageID);
                category = "Category: " + connect.bookCategory(categoryID);

                descrpition = desc.Split('.');
                desc        = "";

                BookName.Text  = bookName;
                Author.Text    = author;
                Publisher.Text = publisher;
                Category.Text  = category;
                Language.Text  = language;
                Lent.Text      = lent;
                for (int i = 0; i < descrpition.Length; i++)
                {
                    desc = desc + descrpition[i] + ".\n";
                }
                Description.Text = "Description: " + desc;

                PictureBox.Image = Image.FromStream(new System.IO.MemoryStream(connect.getImageByBookId(bookID)));
                PictureBox.Refresh();
            }
        }
Пример #3
0
        public FormEditBookDetails(string info)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            List <string> bookDetail = new List <string>();

            bookDetail = db.bookDetails(info);

            if (bookDetail.Capacity > 0)
            {
                bookID     = bookDetail.ElementAt(0);
                bookName   = bookDetail.ElementAt(1);
                author     = bookDetail.ElementAt(2);
                lent       = bookDetail.ElementAt(3);
                categoryID = bookDetail.ElementAt(4);
                languageID = bookDetail.ElementAt(5);
                desc       = bookDetail.ElementAt(6);
                ISBN       = bookDetail.ElementAt(7);
                publisher  = bookDetail.ElementAt(8);

                language = db.bookLanguage(languageID);
                category = db.bookCategory(categoryID);

                descrpition = desc.Split('.');
                desc        = "";

                txtIDBook.Text        = bookID;
                txtBookName.Text      = bookName;
                txtBookAuthor.Text    = author;
                txtBookPublisher.Text = publisher;
                txtBookCategory.Text  = category;
                txtBookLanguage.Text  = language;
                txtBookISBN.Text      = ISBN;
                for (int i = 0; i < descrpition.Length; i++)
                {
                    desc = desc + descrpition[i] + ".\n";
                }
                txtBookDescription.Text = desc;

                pictureBox1.Image = Image.FromStream(new System.IO.MemoryStream(db.getImageByBookId(bookID)));
                pictureBox1.Refresh();
            }
        }