public void Dispose() { Pause(); SboEngine.OnExceptionEvent -= OnExceptionEvent; PiEngine.OnExceptionEvent -= OnExceptionEvent; if (objUpdateCreditTimer != null) { objUpdateCreditTimer.Dispose(); } PiEngine.LogOff(); SboEngine.LogOff(); Status = eServiceStatus.Stopped; StartFailCount = 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); } }
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); }
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); } }
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); } }