Beispiel #1
0
        private void LoadReaderListGridView()
        {
            BookReaderManager aBookReaderManager = new BookReaderManager();
            List <BookReader> bookReaderList     = new List <BookReader>();

            bookReaderList = aBookReaderManager.LoadBookreaderGridview();
            int serialNumber = 1;

            readerListGridView.Rows.Clear();
            foreach (var reader in bookReaderList)
            {
                readerListGridView.Rows.Add(serialNumber, reader.ReaderID, reader.ReaderName, reader.Email, reader.Booktaken, reader.DateOfTakeBook.ToShortDateString(), reader.DateOfReturnBook.ToShortDateString());
                serialNumber++;
            }
        }
Beispiel #2
0
        private void updateBookReaderButton_Click(object sender, EventArgs e)
        {
            BookReader        updtReader         = new BookReader();
            BookReaderManager aBookReaderManager = new BookReaderManager();

            updtReader.ReaderID   = updateBookReaderIDtextBox.Text;
            updtReader.ReaderName = updateBookReaderNameTextBox.Text;
            updtReader.Email      = UpdateEmailTextBox.Text;

            MessageBox.Show(aBookReaderManager.UpdateThisBookReader(updtReader));
            updateBookReaderIDtextBox.Clear();
            UpdateEmailTextBox.Clear();
            updateBookReaderNameTextBox.Clear();
            LoadReaderListGridView();
        }
Beispiel #3
0
        private void saveReaderButton_Click(object sender, EventArgs e)
        {
            BookReaderManager aReaderManager = new BookReaderManager();

            if (readerIDTextBox.Text != "" && readerNameTextBox.Text != "" && readerEmailTextBox.Text != "")
            {
                BookReader aBookReader = new BookReader();
                aBookReader.ReaderID   = readerIDTextBox.Text;
                aBookReader.ReaderName = readerNameTextBox.Text;
                aBookReader.Email      = readerEmailTextBox.Text;
                MessageBox.Show(aReaderManager.SaveThisBookReader(aBookReader));
                LoadReaderListGridView();
                readerIDTextBox.Clear();
                readerNameTextBox.Clear();
                readerEmailTextBox.Clear();
            }
            else
            {
                MessageBox.Show("Please fill up the fields");
            }
        }
Beispiel #4
0
        private void readerLoginButton_Click(object sender, EventArgs e)
        {
            if (readerIDTextBox.Text != "")
            {
                BookReader aBookReader = new BookReader();
                aBookReader.ReaderID = readerIDTextBox.Text;

                BookReaderManager aBookReaderManager = new BookReaderManager();
                if (aBookReaderManager.BookReaderLogin(aBookReader))
                {
                    BookReader bookReader = new BookReader();
                    bookReader = aBookReaderManager.GetReaderInfo(aBookReader);

                    Hide();
                    ReaderUI aReaderUi = new ReaderUI(bookReader);
                    aReaderUi.Show();
                }
                else
                {
                    MessageBox.Show("Not Found");
                }
            }
        }