Example #1
0
 public frmAddStaff(Database database, DataTable staffTable, DataTable branchTable)
 {
     InitializeComponent();
     mDatabase = database;
     dtbStaff = staffTable;
     dtbBranch = branchTable;
     cboStaffBranch.DataSource=dtbBranch;
     cboStaffBranch.DisplayMember = "branchID";
     cboStaffBranch.BindingContext = this.BindingContext;
 }
Example #2
0
        public frmLogin(Database programDatabase)
        {
            InitializeComponent();
            this.programDatabase = programDatabase;

            FormClosed += frmLogin_Closed;

            //Set for debug purposes, quicker login:
            /*txtUsername.Text = "admin01";
            txtPassword.Text = "password";*/
        }
Example #3
0
        //Opens connection to database, pulls initial data.
        static bool init(ref Database db, out string message)
        {
            message = "Unknown Error";

            //Attempt to establish a connection to the database
            if (!db.initalise(ref message))
            {
                return false;
            }

            return true;
        }
Example #4
0
        public frmAddProduct(Database database, ref DataTable categoryTable, ref DataTable supplierTable)
        {
            InitializeComponent();
            mDatabase = database;
            dtbCategory = categoryTable;
            dtbSupplier = supplierTable;

            cboCategory.DataSource = dtbCategory;
            cboCategory.DisplayMember = "name";
            cboCategory.ValueMember = "categoryID";

            cboSupplier.DataSource = dtbSupplier;
            cboSupplier.DisplayMember = "name";
            cboSupplier.ValueMember = "supplierID";
        }
Example #5
0
        public frmMain(Database programDatabase, User currentuser)
        {
            InitializeComponent();
            this.mDatabase = programDatabase;
            this.muser = currentuser;

            pullData();

            //Prepare the tabs
            initialiseMemberData();
            initialiseProductData();
            initialiseStaffData();
            initialiseBranchData();
            initialiseSupplierData();
        }
Example #6
0
        public frmAddRental(Database database, DataTable product, DataTable stock, DataTable branch, int memberID)
        {
            InitializeComponent();
            mDatabase = database;
            dtbProduct = product;
            dtbBranch = branch;
            dtbStock = stock;
            this.memberID = memberID;

            items = new List<RentalItem>();
            dtpReturnDate.Value = DateTime.Today.AddDays(1);

            txtTotal.Text = "£0.00";

            cboBranch.DataSource = dtbBranch;
            cboBranch.DisplayMember = "branchID";
            cboBranch.ValueMember = "branchID";
        }
Example #7
0
        public frmAddRentalItem(Database database, DataTable stock, DataTable product, int branchID)
        {
            InitializeComponent();

            mDatabase = database;

            dtbStock = stock;
            dtbProduct = product;

            numAmount.Enabled = false;
            btnSubmit.Enabled = false;

            cboProduct.DataSource = mDatabase.selectData("SELECT * FROM Product WHERE productID IN (SELECT productID FROM Stock Where branchID = " + branchID + ")");
            cboProduct.ValueMember = "productID";
            cboProduct.DisplayMember = "name";

            this.branchID = branchID;

            cboProduct.SelectedIndexChanged += cboProduct_SelectedIndexChanged;
            cboProduct.SelectedIndex = -1;
        }
Example #8
0
 public frmAddMember(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }
Example #9
0
 public frmAddBranch(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }
Example #10
0
 public frmAddSupplier(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }