Esempio n. 1
0
 public AdminMenuControl(string username, string password)
 {
     InitializeComponent();
     data         = new RememberUserForMenu();
     this.AdminID = con.FindUser(username, password);
     data.setUserID(AdminID);
     waitingReg = con.waitingRegistration();
     setRegistrationRequestText(waitingReg);
 }
Esempio n. 2
0
        public FormAdminRegistrationRequest(string UserID)
        {
            InitializeComponent();
            DatabaseInfo.Visible = false;
            AdminID    = UserID;
            waitingReg = con.waitingRegistration();
            if (waitingReg == -1)
            {
                DatabaseInfo.Text    = "Cannot connect to database!";
                DatabaseInfo.Visible = true;
            }

            showItems();
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 public Admin()
 {
     InitializeComponent();
     DatabaseInfo.Visible = false;
     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;
     }
 }
Esempio n. 5
0
        public FormWaitingRegistrations(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;
            }

            showItems();
        }
Esempio n. 6
0
 public FormAdminInterface(string username, string password)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.CenterScreen;
     connection         = new Connect2DB();
     AdminID            = connection.FindUser(username, password);
     waitingReg         = connection.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;
     }
 }
Esempio n. 7
0
 public FormUpdateUser(string adminID)
 {
     InitializeComponent();
     DatabaseInfo.Visible = false;
     this.StartPosition   = FormStartPosition.CenterScreen;
     this.AdminID         = adminID;
     Search_btn_Click(null, null);
     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;
     }
 }