public MapBLL(WindownApplication _app)
 {
     app             = _app;
     objCacheManager = app.ObjCacheManager;
     adrDAO          = app.AddressDao;
     sectionDAO      = app.SectionDao;
     segmentDAO      = app.SegmentDao;
     portDAO         = app.PortDao;
     groupRailDAO    = app.GroupRailDao;
     railDAO         = app.RailDao;
     pointDAO        = app.PointDao;
     portIconDAO     = app.PortIconDao;
 }
 public void start(SCApplication app)
 {
     scApp               = app;
     railDAO             = scApp.RailDao;
     adrDAO              = scApp.AddressDao;
     portDAO             = scApp.PortDao;
     portIconDAO         = scApp.PortIconDao;
     pointDAO            = scApp.PointDao;
     groupRailDAO        = scApp.GroupRailDao;
     sectionDAO          = scApp.SectionDao;
     segmentDAO          = scApp.SegmentDao;
     vehicleDAO          = scApp.VehicleDao;
     blockZoneMasterDao  = scApp.BlockZoneMasterDao;
     blockZoneDetaiDao   = scApp.BolckZoneDetaiDao;
     blockZoneQueueDao   = scApp.BlockZoneQueueDao;
     commObjCacheManager = scApp.getCommObjCacheManager();
 }
        public WindownApplication()
        {
            ViewerID         = getString("Viewer_ID", "");
            webClientManager = WebClientManager.getInstance();

            ObjCacheManager = new ObjCacheManager(this);

            elasticSearchManager = new ElasticSearchManager();

            RailDao             = new RAILDao();
            AddressDao          = new ADDRESSDao();
            PortIconDao         = new PortIconDao();
            PointDao            = new POINTDao();
            GroupRailDao        = new GROUPRAILSDao();
            SegmentDao          = new SegmentDao();
            SectionDao          = new SectionDao();
            PortDao             = new PortDao();
            VehicleDao          = new VehicleDao();
            UserDao             = new UserDao();
            UserGroupDao        = new UserGroupDao();
            UserFuncDao         = new UserFuncDao();
            FunctionCodeDao     = new FunctionCodeDao();
            CMD_OHTCDao         = new CMD_OHTCDao();
            CMD_MCSDao          = new CMD_MCSDao();
            VCMD_MCSDao         = new VCMD_MCSDao();
            PortStationDao      = new PortStationDao();
            AlarmDao            = new AlarmDao();
            MapBLL              = new MapBLL(this);
            UserBLL             = new UserBLL(this);
            OperationHistoryBLL = new OperationHistoryBLL(this);
            CmdBLL              = new CmdBLL(this);
            AlarmBLL            = new AlarmBLL(this);
            PortStationBLL      = new PortStationBLL(this);
            SegmentBLL          = new SegmentBLL(this);
            ObjCacheManager.start();
            ID = ObjCacheManager.MapId;

            LineBLL             = new LineBLL(this);
            VehicleBLL          = new VehicleBLL(this);
            SysExcuteQualityBLL = new SysExcuteQualityBLL(this);

            dBTableWatcher = new EventAction.DBTableWatcher(this);
            dBTableWatcher.initStart();
            // setEFConnectionString(ObjCacheManager.EFConnectionString);



            SysExcuteQualityQueryService = new SysExcuteQualityQueryService(this);
            //initBackgroundWork();
            //  SysExcuteQualityQueryService = new SysExcuteQualityQueryService();
            switch (WindownApplication.OHxCFormMode)
            {
            case OHxCFormMode.CurrentPlayer:
                natsManager       = new NatsManager(ID, "nats-cluster", ViewerID);
                redisCacheManager = new RedisCacheManager(ID);
                SubscriberNatsEvent();
                SubscriberDBTableWatcherEvent();
                //SysExcuteQualityQueryService.start();
                break;

            case OHxCFormMode.HistoricalPlayer:
                HistoricalReplyService = new HistoricalReplyService(this);
                //HistoricalReplyService.loadVhHistoricalInfo();
                break;
            }
            //VehicleBLL.ReguestViewerUpdate();
        }