private void OnCreatedErogato(object source, FileSystemEventArgs e)
        {
            Debug.Log("CashmaticApp", "OnCreatedErogato");
            FileInfo file = new FileInfo(e.FullPath);

            while (Helper.isFileLocked(file))
            {
                Thread.Sleep(50);
            }
            try
            {
                int erogato = CashmaticCommands.ReadErogato();
                int resto   = Global.pagato - Global.subtotale;
                if ((resto - erogato) > 0)
                {
                    file.Delete();
                    StopListeners();
                    Application.Current.Dispatcher.BeginInvoke(
                        DispatcherPriority.Background, new Action(() => Application.Current.MainWindow.Content = new RefundingProces(_ob, true)));
                }
            }
            catch (Exception ex)
            {
                Debug.Log("CashmaticApp", ex.ToString());
            }
        }
Пример #2
0
        private void OnCreatedErogato(object source, FileSystemEventArgs e)
        {
            Debug.Log("CashmaticApp", "OnCreatedErogato");
            FileInfo file = new FileInfo(e.FullPath);

            while (Helper.isFileLocked(file))
            {
                Thread.Sleep(50);
            }
            try
            {
                int erogato = CashmaticCommands.ReadErogato();
                if (erogato == Global.pagato)
                {
                    file.Delete();
                    _fileWatcher.EnableRaisingEvents = false;
                    Application.Current.Dispatcher.BeginInvoke(
                        DispatcherPriority.Background, new Action(() => Application.Current.MainWindow.Content = new PaymentSummaryPage(_ob)));
                }
            }
            catch (Exception ex)
            {
                Debug.Log("CashmaticApp", ex.ToString());
            }
        }