public void ActivateImmediateNotification()
        {
            var query = context.Messages.AsQueryable();

            ImmediateNotificationRegister <Message> notification = new ImmediateNotificationRegister <Message>(
                context,
                query);

            notification.OnChanged += NotificationOnChanged;
        }
Exemple #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ImmediateNotificationRegister <Message> .StartMonitor(connString);

            SetupSQLDependency();
        }
Exemple #3
0
 public void RegisterDependency()
 {
     try
     {
         var queryReceiver = _operationDB.OfficerTask.Where(x => !x.IsNoticed.Value);
         _OfficerTask            = new ImmediateNotificationRegister <OfficerTask>(_operationDB, queryReceiver);
         _OfficerTask.OnChanged += dependency_OnChange;
     }
     catch (Exception ex)
     {
     }
 }
Exemple #4
0
 public void RegisterDependency()
 {
     try
     {
         var queryReceiver = _operationDB.SupervisorNotifications.Where(x => !x.IsNoticed.Value);
         _notification            = new ImmediateNotificationRegister <SupervisorNotification>(_operationDB, queryReceiver);
         _notification.OnChanged += dependency_OnChange;
     }
     catch (Exception ex)
     {
         // Use Elmah To Record Exception Here
     }
 }
Exemple #5
0
        public void RegisterDependency()
        {
            try
            {
                var query = _operationDB.ViolationNotifications.Where(x => !x.IsNoticed);

                _notification            = new ImmediateNotificationRegister <ViolationNotification>(_operationDB, query);
                _notification.OnChanged += dependency_OnChange;
            }
            catch (Exception ex)
            {
                // Use Elmah To Record Exception Here
            }
        }
        public void RegisterDependency()
        {
            try
            {
                var query = _operationDB.CorrelationBusinessRules.Select(x => new { ruleId = x.BusinessRuleId, ruleInterval = x.RuleInterval, name = x.BusinessName, isDeleted = x.IsDeleted });

                _notification            = new ImmediateNotificationRegister <CorrelationBusinessRule>(_operationDB, query);
                _notification.OnChanged += dependency_OnChange;
            }
            catch (Exception ex)
            {
                // Use Elmah To Record Exception Here
            }
        }
Exemple #7
0
        public void RegisterDependency()
        {
            try
            {
                var query = _operationDB.SmartOfficerNews.Where(x => x.IsNoticed.HasValue && x.IsNoticed.Value == false);

                _officerNews            = new ImmediateNotificationRegister <SmartOfficerNew>(_operationDB, query);
                _officerNews.OnChanged += dependency_OnChange;
            }
            catch (Exception ex)
            {
                Utility.WriteLog(ex);
            }
        }
        public void RegisterDependency(string plateNumber)
        {
            try
            {
                _plateNumber = plateNumber;
                var query = _operationDB.VehicleLiveTrackings.Where(x => x.PlateNumber == plateNumber && !x.IsNoticed);

                _notification            = new ImmediateNotificationRegister <VehicleLiveTracking>(_operationDB, query);
                _notification.OnChanged += Dependency_OnChange;
            }
            catch
            {
            }
        }
Exemple #9
0
        public void RegisterDependency()
        {
            try
            {
                var query = _operationDB.Notifications.Where(x => x.IsNoticed.HasValue && x.IsNoticed.Value == false);

                _notification            = new ImmediateNotificationRegister <Notification>(_operationDB, query);
                _notification.OnChanged += dependency_OnChange;
            }
            catch (Exception ex)
            {
                // Use Elmah To Record Exception Here
            }
        }
        public void RegisterDependency()
        {
            try
            {
                var query = _operationDB.PatrolLastLocations.Where(x => !x.IsNoticed);

                _notification            = new ImmediateNotificationRegister <PatrolLastLocation>(_operationDB, query);
                _notification.OnChanged += dependency_OnChange;
            }
            catch (Exception ex)
            {
                string lines = "Query Registeration Error exc";

                // Write the string to a file.
                //  System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
                // file.WriteLine(lines);

                // file.Close();
                // Use Elmah To Record Exception Here
            }
        }
Exemple #11
0
 protected void Application_End()
 {
     ImmediateNotificationRegister <Message> .StopMonitor(connString);
 }