private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (objGeneralDba == null)
                objGeneralDba = new GeneralDba();

            RequestType=objGeneralDba.GetRequestType(QueueId);
            if (RequestType != 3 && RequestType != 1 && RequestType != 0)
                transfer_but.Visibility = Visibility.Hidden;
            if (RequestType == 3)
            {
                refresh_but.Visibility = Visibility.Hidden;
                restart_but.Visibility = Visibility.Hidden;
            }
            if (RequestType == 0)
            {
                retrive_but.Visibility = Visibility.Hidden;
            }
            lblMachineName.Content = this.MachineCode;


            CardId=objGeneralDba.GetCardIdFromQueue(QueueId);
            cardIdLabel.Content = CardId;
        }
        void timerToUpdateStatus_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            // cmLock.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegate(SetLockedStatus), objCMDba.GetCMBlockedStatus(MachineCode));
            if (objCMDba == null)
            {
                objCMDba = new CMDba();
            }
            if (objGeneralDba == null)
            {
                objGeneralDba = new GeneralDba();
            }

            this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegate(SetLockedStatus), objCMDba.GetCMBlockedStatus(MachineCode));
            triggerStatus.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegate(SetTriggerStatus), objGeneralDba.GetMachineTriggerStatus(MachineCode));
            disableGrid.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegate(SetDisableStatus), !objCMDba.GetCMEnabledStatus(MachineCode));
            this.QueueId = objCMDba.GetCMQueueId(this.MachineCode);
            cardIdLabel.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegateForString(SetCardId), objGeneralDba.GetCardIdFromQueue(this.QueueId));
        }
        void timerToUpdateStatus_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetLockedStatus), objVLCDba.GetVLCBlockedStatus(MachineCode));
            triggerStatus.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetTriggerStatus), objGeneralDba.GetMachineTriggerStatus(MachineCode));
            disableGrid.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetDisableStatus), !objVLCDba.GetVLCEnabledStatus(MachineCode));

            this.QueueId = objVLCDba.GetVLCQueueId(this.MachineCode);
            cardIdLabel.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new InvokeDelegateForString(SetCardId), objGeneralDba.GetCardIdFromQueue(this.QueueId));
        }