Exemplo n.º 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;
 }
Exemplo n.º 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";*/
        }
Exemplo n.º 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;
        }
Exemplo n.º 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";
        }
Exemplo n.º 5
0
        public frmMain(Database programDatabase, User currentuser)
        {
            InitializeComponent();
            this.mDatabase = programDatabase;
            this.muser = currentuser;

            pullData();

            //Prepare the tabs
            initialiseMemberData();
            initialiseProductData();
            initialiseStaffData();
            initialiseBranchData();
            initialiseSupplierData();
        }
Exemplo n.º 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";
        }
Exemplo n.º 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;
        }
Exemplo n.º 8
0
 public frmAddMember(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }
Exemplo n.º 9
0
 public frmAddBranch(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }
Exemplo n.º 10
0
 public frmAddSupplier(Database database)
 {
     InitializeComponent();
     mDatabase = database;
 }