Пример #1
0
        public void Dispose()
        {
            Pause();

            SboEngine.OnExceptionEvent -= OnExceptionEvent;
            PiEngine.OnExceptionEvent  -= OnExceptionEvent;
            if (objUpdateCreditTimer != null)
            {
                objUpdateCreditTimer.Dispose();
            }
            PiEngine.LogOff();
            SboEngine.LogOff();
            Status         = eServiceStatus.Stopped;
            StartFailCount = 0;
        }
Пример #2
0
        public bool ReConnectPina()
        {
            try
            {
                if (PiEngine.TryLogin())
                {
                    Logger.Info("Ket noi Pina thanh cong>>>>>>>>>>>>>>>>>>>>>");

                    for (int i = 0; i < 4; i++)
                    {
                        Logger.Info(ProcessorName + " START Service LOOP: " + i);

                        if (this.Status == eServiceStatus.Started)
                        {
                            IsReConnect = false;
                            return(true);
                        }

                        if (Start(ScanType) == eServiceStatus.Started)
                        {
                            IsReConnect = false;
                            Logger.Info(ProcessorName + " >>>>>>>>>>>>>>>>>>>>>>>>>>START THANH CONG!!! ");
                            return(true);
                        }
                        Thread.Sleep(15000);
                    }

                    if (PiEngine.AccountStatus == eAccountStatus.Online)
                    {
                        PiEngine.LogOff();
                    }

                    Thread.Sleep(30000);
                }

                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("ReConnectPina: " + ex.Message);
                return(false);
            }
        }
Пример #3
0
        public eServiceStatus ReStart()
        {
            try
            {
                Logger.Info("KHOI DONG LAI HE THONG!!!!!!!!!!!!!!!!!!!!!!");
                this.Pause();
                IsnEngine.LogOff();
                PiEngine.LogOff();
                //   IsnEngine.ReLogin();
                var status = Start(ScanType);
                Logger.Info("KHOI DONG LAI HE THONG THANH CONG!!!!!!!!!!!!!!!!!!!!!!");
                return(status);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);;
            }

            return(eServiceStatus.Unknown);
        }
Пример #4
0
        private void ReStartFromPina()
        {
            try
            {
                if (!IsReConnect)
                {
                    IsReConnect = true;
                    this.Pause();
                    FireProcessStateChange(eServiceStatus.Paused, "reconnecting...");
                    Logger.Info("TAM DUNG HE THONG, KET NOI LAI Pina!!!!!!!!!");
                    PiEngine.LogOff();

                    ReConnectPina();
                    IsReConnect = false;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("ReStartFromPina: " + ex.Message);
            }
        }
Пример #5
0
        public void Dispose()
        {
            try
            {
                Pause();

                IsnEngine.OnExceptionEvent -= OnExceptionEvent;
                PiEngine.OnExceptionEvent  -= OnExceptionEvent;
                if (objUpdateCreditTimer != null)
                {
                    objUpdateCreditTimer.Dispose();
                }
                PiEngine.LogOff();
                IsnEngine.LogOff();
                Status         = eServiceStatus.Stopped;
                StartFailCount = 0;
            }
            catch (Exception ex)
            {
                Logger.Error("Dispose: " + ex.Message);
            }
        }