Esempio n. 1
0
        private Task DropAndPost()
        {
            MachineHandle.DoStoreForRetailer();
            string screenName = "Screen002";
            var    sm         = new ScreenManager();

            sm.GetStateArray();
            ShowNextWindow(screenName);
            return(null);
        }
        private void OpenGloryOnLoad(object sender, RoutedEventArgs e)
        {
            int o = MachineHandle.OpenGloryOnLoad();

            if (o < 1)
            {
                Environment.Exit(0);
            }
            else
            {
                //MessageBox.Show("Glory Open!");
            }
        }
        private void GotoPrevious(object sender, RoutedEventArgs e)
        {
            //open escrow
            var s = MachineHandle.DoRejectOpenEscrow();

            if (!s.ToLower().Contains("error".ToLower()))
            {
                string screenName = "Screen002";
                var    sm         = new ScreenManager();
                sm.GetStateArray();

                ShowNextWindow(screenName);
            }
        }
Esempio n. 4
0
        public string DoStartCount(BackgroundWorker worker, DoWorkEventArgs e)
        {
            try
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    btnBack.Visibility      = Visibility.Hidden;
                    btnStartCount.IsEnabled = false;
                    gifImg.Visibility       = Visibility.Visible;
                    txtProcessingAnim.Text  = "Processing request... PLEASE WAIT.";
                    txtProcessingAnim.HorizontalAlignment = HorizontalAlignment.Center;
                    txtProcessingAnim.Visibility          = Visibility.Visible;
                }));


                //skip delock
                goto countStart;
deLock:
                var delockStr = MachineHandle.DoGlyAsyncDeLock(MachineHandle.MHandle); //this method should be an await method

                Thread.Sleep(2000);
                //MessageBox.Show(delockStr);
                if (delockStr.Contains("SEQUENCE"))
                {
                    goto deLock;
                }


countStart:
                //Do count start Delay 1 seconds
                Thread.Sleep(3000);
                var rtnCntStart = MachineHandle.DoGlyAsyncDeCntStart(MachineHandle.MHandle).Result; //this method should be an await method
                Thread.Sleep(15000);                                                                //delay 10 seconds before calling the next method
                if (rtnCntStart.ToLower().Contains("SEQUENCE".ToLower()))
                {
                    goto deLock;
                }
                if (rtnCntStart.Contains("SUCCESS"))
                {
                    //get escrow counter status
                    string sUl = MachineHandle.DoGlyAsyncDeUnLock(MachineHandle.MHandle);
                    Thread.Sleep(2000);
                    if (!sUl.Contains("ERROR"))
                    {
                        _rtnCountData = MachineHandle.DoCountData();
                        Thread.Sleep(3000);
                        if (!_rtnCountData.Contains("ERROR") && _rtnCountData != String.Empty)
                        {
                            //remove first part of string from the returned string
                            var countData = _rtnCountData.Split(':');
                            //create array from the second part of returned string
                            _countDataArr = countData[1];
                        }
                        else
                        {
                            return("With error UNABLETOCOUNT : " + _rtnCountData);
                        }
                    }
                    else
                    {
                        return("With error UNABLETOCOUNT : " + _rtnCountData);
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
            return(_countDataArr);
        }