public CollectionService() { try { this._ServiceName = "CRCServ"; this._ICodeMasterBL = sysFac.MasterBLLFactory.GetBLL<sysBL.ICodeMasterBL>(sysFac.MasterBLLFactory.CodeMaster_cmt); this._IConsumeMachineBL = MasterBLLFactory.GetBLL<IConsumeMachineBL>(MasterBLLFactory.ConsumeMachine); this._ISourceConsumeRecordBL = MasterBLLFactory.GetBLL<ISourceConsumeRecordBL>(MasterBLLFactory.SourceConsumeRecord); this._IConsumeRecordBL = MasterBLLFactory.GetBLL<IConsumeRecordBL>(MasterBLLFactory.ConsumeRecord); } catch (Exception ex) { Console.WriteLine(getCWStyle(ex.Message, SystemLog.SystemLog.LogType.Error)); throw; } }
protected override void OnStart(string[] args) { try { this._ICodeMasterBL = sysFac.MasterBLLFactory.GetBLL<sysBL.ICodeMasterBL>(sysFac.MasterBLLFactory.CodeMaster_cmt); this._IConsumeMachineBL = MasterBLLFactory.GetBLL<IConsumeMachineBL>(MasterBLLFactory.ConsumeMachine); this._ISourceConsumeRecordBL = MasterBLLFactory.GetBLL<ISourceConsumeRecordBL>(MasterBLLFactory.SourceConsumeRecord); this._IConsumeRecordBL = MasterBLLFactory.GetBLL<IConsumeRecordBL>(MasterBLLFactory.ConsumeRecord); this._CurrentMealType = string.Empty; this._iErrRetryTimes = int.Parse(ConfigurationSettings.AppSettings["ErrRetryTimes"]); this._iErrRetryInterval = int.Parse(ConfigurationSettings.AppSettings["ErrWaitInterval"]); this._LocalLogger.WriteLog("服务启动准备完毕。", string.Empty, SystemLog.SystemLog.LogType.Trace); } catch (Exception ex) { this._LocalLogger.WriteLog(ex.Message, string.Empty, SystemLog.SystemLog.LogType.Error); this._DBLogger.WriteLog(ex.Message, string.Empty, SystemLog.SystemLog.LogType.Error); } finally { if (this._tmrSycnTime != null) { Thread.Sleep(10000); this._tmrSycnTime.Start(); this._LocalLogger.WriteLog("服务启动成功。", string.Empty, SystemLog.SystemLog.LogType.Trace); } } }