private void HomeScreenForm_Load(object sender, EventArgs e) { // Update existing pallets in stock and add to RackColumn Pallet.ListPallet = DBUtility.GetPalletInfoFromDB <List <Pallet> >("PalletInfoTable"); RackColumn.InitializePallet(RackColumn.ListColumn, Pallet.ListPallet); Pallet.SimListPallet = DBUtility.GetPalletInfoFromDB <List <Pallet> >("SimPalletInfoTable"); RackColumn.InitializePallet(RackColumn.SimListColumn, Pallet.SimListPallet); }
private void WarehouseDataForm_Load(object sender, EventArgs e) { // View data on DataGridView dgvNodeInfo.DataSource = DBUtility.GetNodeInfoFromDB <DataTable>("NodeInfoTable"); if (Display.Mode == "Real Time") { dgvPalletInfo.DataSource = DBUtility.GetPalletInfoFromDB <DataTable>("PalletInfoTable"); } else if (Display.Mode == "Simulation") { dgvPalletInfo.DataSource = DBUtility.GetPalletInfoFromDB <DataTable>("SimPalletInfoTable"); } }
private void WarehouseDataForm_FormClosed(object sender, FormClosedEventArgs e) { // Clear all list pallet and column for update Pallet.ListPallet.Clear(); Pallet.SimListPallet.Clear(); RackColumn.ListColumn.ForEach(c => Array.Clear(c.PalletCodes, 0, 3)); RackColumn.SimListColumn.ForEach(c => Array.Clear(c.PalletCodes, 0, 3)); // Update existing pallets in stock and add to RackColumn Pallet.ListPallet = DBUtility.GetPalletInfoFromDB <List <Pallet> >("PalletInfoTable"); RackColumn.InitializePallet(RackColumn.ListColumn, Pallet.ListPallet); Pallet.SimListPallet = DBUtility.GetPalletInfoFromDB <List <Pallet> >("SimPalletInfoTable"); RackColumn.InitializePallet(RackColumn.SimListColumn, Pallet.SimListPallet); }
private void btnUpdate_Click(object sender, EventArgs e) { // Update data on DataGridView if (Display.Mode == "Real Time") { dgvPalletInfo.DataSource = DBUtility.GetPalletInfoFromDB <DataTable>("PalletInfoTable"); } else if (Display.Mode == "Simulation") { dgvPalletInfo.DataSource = DBUtility.GetPalletInfoFromDB <DataTable>("SimPalletInfoTable"); } // set color of pallet which is out of stock foreach (DataGridViewRow row in dgvPalletInfo.Rows) { if (Convert.ToBoolean(row.Cells[1].Value) == false) // cell[1] - InStock { row.DefaultCellStyle.BackColor = Color.LightGray; } } }