private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (objEESDba == null) { objEESDba = new EESDba(); } if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } SetEESName(); try { AsynchReadSettingsForEES(); //pallet.Dispatcher.BeginInvoke(DispatcherPriority.Background, // new InvokeDelegate(SetPalletPresentStatus), GetPalletPresentStatusFromOpc()); } catch (Exception errMsg) { } this.timerToUpdateStatus = new System.Timers.Timer(); this.timerToUpdateStatus.Enabled = true; this.timerToUpdateStatus.Interval = 3000; this.timerToUpdateStatus.Start(); this.timerToUpdateStatus.Elapsed += new System.Timers.ElapsedEventHandler(timerToUpdateStatus_Elapsed); }
private void UserControl_MouseRightButtonUp(object sender, MouseButtonEventArgs e) { ReallocatePop objReallocatePop = null; objReallocatePop = new ReallocatePop(); if (objEESDba == null) { objEESDba = new EESDba(); } if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } bool isBlocked = false; int requestType = -1; isBlocked = objEESDba.GetEESBlockedStatus(this.MachineCode); this.QueueId = objEESDba.GetEESQueueId(this.MachineCode); requestType = this.QueueId != 0 ? objGeneralDba.GetRequestType(this.QueueId) : -1; if (isBlocked && QueueId != 0 && (requestType == 1 || requestType == 0 || requestType == 5 || requestType == 6)) //entry or exit { objReallocatePop.MachineCode = this.MachineCode; objReallocatePop.MachineChannel = this.MachineChannel; objReallocatePop.QueueId = this.QueueId; objReallocatePop.Show(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objEESDba == null) { objEESDba = new EESDba(); } lblMachineName.Content = this.MachineCode; this.triggerGrid.Visibility = Visibility.Hidden; // SetTriggerStatus(objGeneralDba.GetMachineTriggerStatus(this.MachineCode)); SetEnableStatus(objEESDba.GetEESEnabledStatus(this.MachineCode)); }
private void chkStatus_Checked(object sender, RoutedEventArgs e) { RadioButton radio = sender as RadioButton; if (objEESDba == null) { objEESDba = new EESDba(); } if (radio.Name.Equals(chkEnable.Name)) { objEESDba.SetEESEnabledStatus(this.MachineCode, true); } else if (radio.Name.Equals(chkDisable.Name)) { objEESDba.SetEESEnabledStatus(this.MachineCode, false); } }
public void DoOnLoad() { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objEESDba == null) { objEESDba = new EESDba(); } try { SetFloorStatusInLoad(); AssignDBValuesToControls(); AssignToEESCombos(); AssignNormalModeEES(); SetStatusOfL2AutoScheduleToGui(); SelectTab(); initializeTimeSlider(); } catch (Exception ex) { } }
void InsertingRequest(QueueData objQueueData) { if (objEESDba == null) { objEESDba = new EESDba(); } if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } QueueData objQueueData1 = new QueueData(); string eesChannel = null; string eesCode = null; objEESDba.getEESParameters(gateNumber, out eesChannel, out eesCode); objQueueData1.eesNumber = gateNumber; objQueueData1.requestType = 1; objQueueData1.customerId = objQueueData.customerId; objQueueData1.patronName = objQueueData.patronName; objQueueData1.plateNumber = objQueueData.plateNumber; objQueueData1.needSimulation = objQueueData.needSimulation; objQueueData1.needWash = objQueueData.needWash; objQueueData1.isRotate = objQueueData.isRotate; objQueueData1.carType = objQueueData.carType; //if (IsHighCar(eesChannel, eesCode)) //{ // objQueueData1.carType = kioskSimulation.QueueData.CAR_TYPE.high; //} //else //{ // objQueueData1.carType = objQueueData.carType; //} objGeneralDba.InsertQueueForSimulation(objQueueData1); }
void ChangeProcessingRecordBackColor() { if (objNewConnection == null) { objNewConnection = new Connection(); } if (objEESDba == null) { objEESDba = new EESDba(); } if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } int queueId = 0; try { if (wgrid.dataGridView1.DataSource != null) { //for (int i = 0; i <= wgrid.dataGridView1.Rows.Count - 1; i++) //{ // if (Convert.ToString(wgrid.dataGridView1.Rows[i].Cells["PROCESS"].Value) == "REHNDLING") // { // wgrid.dataGridView1.Rows[i].Cells["PROCESS"].Style.ForeColor = System.Drawing.Color.White; // wgrid.dataGridView1.Rows[i].Cells["PROCESS"].Style.BackColor = System.Drawing.Color.DarkRed; // } //} int pathLockId = objGeneralDba.GetPathlockId(); for (int i = 0; i <= wgrid.dataGridView1.Rows.Count - 1; i++) { var grid = wgrid.dataGridView1; var processCell = grid.Rows[i].Cells["PROCESS"]; if (!Convert.ToString(grid.Rows[i].Cells["PROCESS"].Value).Equals("PROCESSING")) { processCell.Style.ForeColor = System.Drawing.Color.White; processCell.Style.SelectionForeColor = System.Drawing.Color.White; processCell.Style.BackColor = System.Drawing.Color.DarkCyan; processCell.Style.SelectionBackColor = System.Drawing.Color.DarkCyan; } var modeCell = grid.Rows[i].Cells["MODE"]; if (Convert.ToString(modeCell.Value) == "ENTRY") { modeCell.Style.ForeColor = System.Drawing.Color.DarkGreen; } else if (Convert.ToString(modeCell.Value) == "EXIT") { modeCell.Style.ForeColor = System.Drawing.Color.DarkRed; } var qCell = grid.Rows[i].Cells["TRANS ID"]; var snoCell = grid.Rows[i].Cells["S_NO"]; queueId = int.Parse(Convert.ToString(qCell.Value)); if (objNewConnection.IsTriggerEnabledUsingQueueId(queueId)) { snoCell.Style.BackColor = System.Drawing.Color.Red; snoCell.Style.SelectionBackColor = System.Drawing.Color.Red; } if (Convert.ToString(grid.Rows[i].Cells["HOLD_FLAG"].Value).Equals("1")) { snoCell.Style.BackColor = System.Drawing.Color.Yellow; snoCell.Style.SelectionBackColor = System.Drawing.Color.Yellow; } var washCell = grid.Rows[i].Cells["CAR WASH"]; if (Convert.ToString(washCell.Value) == "YES") { washCell.Style.BackColor = System.Drawing.Color.BlueViolet; } var timerCell = grid.Rows[i].Cells["TIMER"]; Int32 tempVal = 0; Int32.TryParse(timerCell.Value.ToString().Split(':')[0], out tempVal); if (tempVal >= 9) { timerCell.Style.ForeColor = System.Drawing.Color.Red; timerCell.Style.SelectionForeColor = System.Drawing.Color.Red; } var cmdCell = grid.Rows[i].Cells["L2 CMD"]; if (Convert.ToString(cmdCell.Value).Equals("Payment")) { gateForGrid = Convert.ToString(grid.Rows[i].Cells["GATE"].Value); char c = gateForGrid[gateForGrid.Length - 1]; wgrid.BeginInvoke(new InvokeDelegate(new Action(() => { objEESDba.getEESParameters(c - '0', out eesChannelForGrid, out eesCodeForGrid); if (GetInnerDoorBlockedStatus(eesChannelForGrid, eesCodeForGrid)) { cmdCell.Style.BackColor = System.Drawing.Color.Red; cmdCell.Style.SelectionBackColor = System.Drawing.Color.Red; } //else //{ // cmdCell.Style.BackColor = System.Drawing.Color.Green; // cmdCell.Style.SelectionBackColor = System.Drawing.Color.Green; //} }))); } var transIdCell = grid.Rows[i].Cells["TRANS ID"]; if (pathLockId != 0 && Convert.ToString(transIdCell.Value).Equals(pathLockId.ToString())) { transIdCell.Style.BackColor = System.Drawing.Color.LightCyan; transIdCell.Style.SelectionBackColor = System.Drawing.Color.LightCyan; } } } } catch (Exception errMsg) { Console.WriteLine(); } finally { } }