Example #1
0
        public void Form1_Load(object sender, EventArgs e)
        {
            ConnectToDB con         = new ConnectToDB();
            DataTable   fridgeTable = con.GetTableFromDB("*", "Fridge", "where DeliveredAt is null and Mass <> 0");

            FridgeGridView.DataSource = fridgeTable;
        }
        private void ReviewOrderedForm_Load(object sender, EventArgs e)
        {
            label.Text = currentClient;
            ConnectToDB connect    = new ConnectToDB();
            DataTable   orderTable = connect.GetTableFromDB("Mass,Volume,ManufacturedOn,DeliverUntil", "Fridge", string.Format("where Customer = '{0}' and DeliveredAt is null", currentClient));

            orderTable.Columns.Add(new DataColumn("ExpectedDelivery", typeof(DateTime)));
            fillExpectedDeliveryColumn(orderTable, AverageOrderToDeliveryTime());
            orderedGrid.DataSource = orderTable;
        }
Example #3
0
        private void ClientForm_Load(object sender, EventArgs e)
        {
            ConnectToDB cdb = new ConnectToDB();

            warehouseTable = cdb.GetTableFromDB("Volume,Mass,ManufacturedOn,FridgeId", "Fridge", "where Customer is null");
            WarehouseGridView.DataSource = warehouseTable;
            WarehouseGridView.Columns[WarehouseGridView.ColumnCount - 1].Visible = false;

            shoppingCartTable.Columns.AddRange(new []
            {
                new DataColumn("Volume", typeof(decimal)),
                new DataColumn("Mass", typeof(int)),
                new DataColumn("ManufacturedOn", typeof(DateTime)),
                new DataColumn("FridgeId", typeof(int)),
            });
            CartGridView.DataSource = shoppingCartTable;
            CartGridView.Columns[CartGridView.ColumnCount - 1].Visible = false;
        }