void displayLibrarianData()
 {
     DatabaseAdapter databaseadapter = new DatabaseAdapter();
     DataTable librariantable = new DataTable();
     librariantable = databaseadapter.getLibrarian();
     dataGridViewLibrarian.DataSource = librariantable;
 }
 void displayBookData()
 {
     DatabaseAdapter databaseadapter = new DatabaseAdapter();
     DataTable booktable = new DataTable();
     booktable = databaseadapter.getBooks();
     dataGridViewBooks.DataSource = booktable;
 }
Example #3
0
        void displayBookData()
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            DataTable       booktable       = new DataTable();

            booktable = databaseadapter.getBooks();
            dataGridViewBooks.DataSource = booktable;
        }
 void displayMemberData()
 {
     DatabaseAdapter databaseadapter = new DatabaseAdapter();
     DataTable membertable = new DataTable();
     membertable = databaseadapter.getMember();
     dataGridViewMember.DataSource = membertable;
     databaseadapter = null;
 }
Example #5
0
        void displayLibrarianData()
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            DataTable       librariantable  = new DataTable();

            librariantable = databaseadapter.getLibrarian();
            dataGridViewLibrarian.DataSource = librariantable;
        }
Example #6
0
        void displayMemberData()
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            DataTable       membertable     = new DataTable();

            membertable = databaseadapter.getMember();
            dataGridViewMember.DataSource = membertable;
            databaseadapter = null;
        }
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter ();
            int row = dataGridViewMember.CurrentCell.RowIndex;

            if (row == -1) {
                MessageBox.Show("Select an entry to delete.");
            } else {
                int id = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[0].Value.ToString());
                databaseadapter.deleteMember(id);
                displayMemberData();
                MessageBox.Show("Deleted Successfully!");
            }
        }
Example #8
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            int             row             = dataGridViewMember.CurrentCell.RowIndex;

            if (row == -1)
            {
                MessageBox.Show("Select an entry to delete.");
            }
            else
            {
                int id = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[0].Value.ToString());
                databaseadapter.deleteMember(id);
                displayMemberData();
                MessageBox.Show("Deleted Successfully!");
            }
        }
        private void buttonLoginSubmit_Click(object sender, EventArgs e)
        {
            string email = textLibrarianEmail.Text;
            string password = textPassword.Text;
            DatabaseAdapter databaseadapter = new DatabaseAdapter();

            string message = databaseadapter.isLibrarian(email, password);

            if (message == "Success") {
                MessageBox.Show("Login Successful! Welcome!");
                AdminPanel adminpanel = new AdminPanel(this, email);
            } else if (message == "Incorrect Password") {
                MessageBox.Show("Incorrect Password. Try Again!");
            } else {
                MessageBox.Show("No such account");
            }
        }
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            int row = dataGridViewMember.CurrentCell.RowIndex;

            if (row == -1) {
                MessageBox.Show("Select an entry to delete.");
            } else {
                int id = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[0].Value.ToString());
                string name = dataGridViewMember.Rows[row].Cells[1].Value.ToString();
                int age = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[2].Value.ToString());
                string contact = dataGridViewMember.Rows[row].Cells[3].Value.ToString();
                string email = dataGridViewMember.Rows[row].Cells[4].Value.ToString();

                databaseadapter.updateMember(id, name, age, contact, email);
                displayMemberData();
                MessageBox.Show("Updated Successfully!");
            }
        }
Example #11
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            int             row             = dataGridViewMember.CurrentCell.RowIndex;

            if (row == -1)
            {
                MessageBox.Show("Select an entry to delete.");
            }
            else
            {
                int    id      = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[0].Value.ToString());
                string name    = dataGridViewMember.Rows[row].Cells[1].Value.ToString();
                int    age     = Convert.ToInt32(dataGridViewMember.Rows[row].Cells[2].Value.ToString());
                string contact = dataGridViewMember.Rows[row].Cells[3].Value.ToString();
                string email   = dataGridViewMember.Rows[row].Cells[4].Value.ToString();

                databaseadapter.updateMember(id, name, age, contact, email);
                displayMemberData();
                MessageBox.Show("Updated Successfully!");
            }
        }
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            int row = dataGridViewBooks.CurrentCell.RowIndex;

            if (row == -1) {
                MessageBox.Show("Select an entry to update.");
            }
            else {
                int id = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[0].Value.ToString());
                string name = dataGridViewBooks.Rows[row].Cells[1].Value.ToString();
                string author = dataGridViewBooks.Rows[row].Cells[2].Value.ToString();
                string publisher = dataGridViewBooks.Rows[row].Cells[3].Value.ToString();
                int price = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[2].Value.ToString());
                int quantity = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[2].Value.ToString());
                string readerclass = dataGridViewBooks.Rows[row].Cells[4].Value.ToString();

                databaseadapter.updateBook(id, name, author, publisher, price, quantity, readerclass);
                displayBookData();
                MessageBox.Show("Updated Successfully!");
            }
        }
Example #13
0
        private void buttonLoginSubmit_Click(object sender, EventArgs e)
        {
            string          email           = textLibrarianEmail.Text;
            string          password        = textPassword.Text;
            DatabaseAdapter databaseadapter = new DatabaseAdapter();

            string message = databaseadapter.isLibrarian(email, password);

            if (message == "Success")
            {
                MessageBox.Show("Login Successful! Welcome!");
                AdminPanel adminpanel = new AdminPanel(this, email);
            }
            else if (message == "Incorrect Password")
            {
                MessageBox.Show("Incorrect Password. Try Again!");
            }
            else
            {
                MessageBox.Show("No such account");
            }
        }
Example #14
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            DatabaseAdapter databaseadapter = new DatabaseAdapter();
            int             row             = dataGridViewBooks.CurrentCell.RowIndex;

            if (row == -1)
            {
                MessageBox.Show("Select an entry to update.");
            }
            else
            {
                int    id          = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[0].Value.ToString());
                string name        = dataGridViewBooks.Rows[row].Cells[1].Value.ToString();
                string author      = dataGridViewBooks.Rows[row].Cells[2].Value.ToString();
                string publisher   = dataGridViewBooks.Rows[row].Cells[3].Value.ToString();
                int    price       = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[2].Value.ToString());
                int    quantity    = Convert.ToInt32(dataGridViewBooks.Rows[row].Cells[2].Value.ToString());
                string readerclass = dataGridViewBooks.Rows[row].Cells[4].Value.ToString();

                databaseadapter.updateBook(id, name, author, publisher, price, quantity, readerclass);
                displayBookData();
                MessageBox.Show("Updated Successfully!");
            }
        }