Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Data.OleDb;
- using System.IO;
- namespace Descartes
- {
- public partial class frmAdmin : Form
- {
- public frmAdmin()
- {
- InitializeComponent();
- }
- int Admin = 0;
- OleDbConnection banking;
- OleDbCommand accountCommand;
- OleDbDataAdapter accountAdapter;
- DataTable accountTable;
- OleDbCommand itemsCommand;
- OleDbDataAdapter itemsAdapter;
- DataTable itemsTable;
- OleDbCommand purchasesCommand;
- OleDbDataAdapter purchasesAdapter;
- DataTable purchasesTable;
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void mainMenuToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- // Goes to the Main Menu Page
- frmMainMenu frm = new frmMainMenu();
- frm.Show();
- this.Hide();
- }
- private void catalogueToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- // Goes to the Catalogue Page
- frmCatalogue frm = new frmCatalogue();
- frm.Show();
- this.Hide();
- }
- private void accountInformationToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- // Goes to the Account Info Page
- frmAccount frm = new frmAccount();
- frm.Show();
- this.Hide();
- }
- private void topupBalanceToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- // Goes to the Main Menu Page
- frmTop frm = new frmTop();
- frm.Show();
- this.Hide();
- }
- private void tmrFadeIn_Tick(object sender, EventArgs e)
- {
- //Fades the page in
- this.Opacity += 0.02;
- }
- private void tmrWait_Tick(object sender, EventArgs e)
- {
- //Stops the fade in function
- tmrFadeIn.Enabled = false;
- }
- private void btnMainMenu_Click(object sender, EventArgs e)
- {
- // Goes to the Main Menu Page
- frmMainMenu frm = new frmMainMenu();
- frm.Show();
- this.Hide();
- }
- private void logoutToolStripMenuItem3_Click(object sender, EventArgs e)
- {
- // Goes to the Login Page
- frmLogin frm = new frmLogin();
- frm.Show();
- this.Hide();
- }
- private void frmAdmin_Load(object sender, EventArgs e)
- {
- banking = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " + Application.StartupPath + "\\..\\..\\banking.mdb");
- banking.Open();
- accountCommand = new OleDbCommand("SELECT * FROM account ORDER BY UserID", banking);
- accountAdapter = new OleDbDataAdapter();
- accountAdapter.SelectCommand = accountCommand;
- accountTable = new DataTable();
- accountAdapter.Fill(accountTable);
- itemsCommand = new OleDbCommand("SELECT * FROM items ORDER BY ItemID", banking);
- itemsAdapter = new OleDbDataAdapter();
- itemsAdapter.SelectCommand = itemsCommand;
- itemsTable = new DataTable();
- itemsAdapter.Fill(itemsTable);
- purchasesCommand = new OleDbCommand("SELECT * FROM purchases ORDER BY PurchaseID", banking);
- purchasesAdapter = new OleDbDataAdapter();
- purchasesAdapter.SelectCommand = purchasesCommand;
- purchasesTable = new DataTable();
- purchasesAdapter.Fill(purchasesTable);
- }
- private void helpToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MessageBox.Show("The admin control page acts as a portal for the administrator to check their statistics in relation to Descartes. The box on the left shows how much money has been spent on your goods in total whereas the box on the right shows a compiled list of all the goods that you have sold. Clicking the Back button will take you back to the Main Menu.", "Catalogue Help");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement