public override void Show()
        {
            if (_iucpBL == null)
            {
                _iucpBL = MasterBLLFactory.GetBLL<IUserCardPairBL>(MasterBLLFactory.UserCardPair);
            }
            if (_icuadBL == null)
            {
                _icuadBL = MasterBLLFactory.GetBLL<ICardUserAccountDetailBL>(MasterBLLFactory.CardUserAccountDetail);
            }
            if (_icuaBL == null)
            {
                _icuaBL = MasterBLLFactory.GetBLL<ICardUserAccountBL>(MasterBLLFactory.CardUserAccount);
            }
            if (_ipcrBL == null)
            {
                _ipcrBL = MasterBLLFactory.GetBLL<IPreConsumeRecordBL>(MasterBLLFactory.PreConsumeRecord);
            }
            if (_IConsumeRecordBL == null)
            {
                _IConsumeRecordBL = MasterBLLFactory.GetBLL<IConsumeRecordBL>(MasterBLLFactory.ConsumeRecord);
            }

            ReadCard();
        }
Esempio n. 2
0
 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;
     }
 }
 public UserAccountFundSyncService()
 {
     try
     {
         this._ServiceName = "AFSServ";
         this._IPreConsumeRecordBL = MasterBLLFactory.GetBLL<IPreConsumeRecordBL>(MasterBLLFactory.PreConsumeRecord);
         this._IConsumeRecordBL = MasterBLLFactory.GetBLL<IConsumeRecordBL>(MasterBLLFactory.ConsumeRecord);
         this._ICodeMasterBL = BLL.Factory.SysMaster.MasterBLLFactory.GetBLL<ICodeMasterBL>(BLL.Factory.SysMaster.MasterBLLFactory.CodeMaster_cmt);
         this._IConsumeMachineBL = MasterBLLFactory.GetBLL<IConsumeMachineBL>(MasterBLLFactory.ConsumeMachine);
         this._ICardUserAccountBL = MasterBLLFactory.GetBLL<ICardUserAccountBL>(MasterBLLFactory.CardUserAccount);
     }
     catch (Exception ex)
     {
         Console.WriteLine(getCWStyle(ex.Message, SystemLog.SystemLog.LogType.Error));
         throw ex;
     }
 }
        public UserAccountFundSyncService()
        {
            InitializeComponent();

            try
            {
                this._LocalLogger = new Common.General(Common.General.BindLocalLogInfo());
                this._DBLogger = new Common.General(Common.General.BindDbLogInfo());

                this._ServiceName = ConfigurationSettings.AppSettings["ServiceName"];
                if (string.IsNullOrEmpty(this._ServiceName))
                {
                    this._ServiceName = "ServAccountSync";
                }
                this._ServiceName.PadRight(20, ' ').Substring(0, 20).Trim();

                this._IPreConsumeRecordBL = MasterBLLFactory.GetBLL<IPreConsumeRecordBL>(MasterBLLFactory.PreConsumeRecord);
                this._IConsumeRecordBL = MasterBLLFactory.GetBLL<IConsumeRecordBL>(MasterBLLFactory.ConsumeRecord);
                this._ICodeMasterBL = BLL.Factory.SysMaster.MasterBLLFactory.GetBLL<ICodeMasterBL>(BLL.Factory.SysMaster.MasterBLLFactory.CodeMaster_cmt);
                this._IConsumeMachineBL = MasterBLLFactory.GetBLL<IConsumeMachineBL>(MasterBLLFactory.ConsumeMachine);
                this._ICardUserAccountBL = MasterBLLFactory.GetBLL<ICardUserAccountBL>(MasterBLLFactory.CardUserAccount);

                this._tmrMain = new System.Timers.Timer();
                this._tmrMain.Interval = 60000;
                this._tmrMain.Elapsed += new System.Timers.ElapsedEventHandler(_tmrMain_Elapsed);

                this._LocalLogger.WriteLog("服务初始化完毕。 " + DateTime.Now.ToString(), string.Empty, SystemLog.SystemLog.LogType.Trace);
            }
            catch (Exception ex)
            {
                this._LocalLogger.WriteLog("服务初始化失败。" + ex.Message + " " + DateTime.Now.ToString(), string.Empty, SystemLog.SystemLog.LogType.Error);
            }
        }
Esempio n. 5
0
        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);
                }
            }
        }