Esempio n. 1
0
        public FormCheckLoans(string UserID)
        {
            InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen;
            DatabaseInfo.Visible = false;
            AdminID    = UserID;
            waitingReg = con.waitingRegistration();
            if (waitingReg > 0)
            {
                registrationReguestToolStripMenuItem.Text = "Registration Request (" + waitingReg + ")";
            }
            else if (waitingReg == 0)
            {
                registrationReguestToolStripMenuItem.Text = "Registration Request";
            }
            else if (waitingReg == -1)
            {
                registrationReguestToolStripMenuItem.Text = "Registration Request";
                DatabaseInfo.Text    = "Cannot connect to database!";
                DatabaseInfo.Visible = true;
            }
            books    = con.checkLentBookNames();
            readers  = con.checkOwnersOfLentBooks();
            lendings = con.checkDatesLendings();
            returns  = con.checkReturnsDates();

            for (int i = 0; i < books.Count; i++)
            {
                ListViewItem item = new ListViewItem(books[i]);
                item.SubItems.Add(readers[i]);
                item.SubItems.Add(lendings[i]);
                item.SubItems.Add(returns[i]);

                listView1.Items.Add(item);
            }
        }