public SendNotificationTask(
     INotificationRepository notificationRepository,
     INotificationHub notificationHub)
 {
     this.notificationRepository = notificationRepository;
     this.notificationHub        = notificationHub;
 }
Ejemplo n.º 2
0
 public NotificationService(INotificationHub notificationHub, INotificationRepository notificationRepository, ICountdownRepository countdownRepository, ICommentRepository commentRepository)
 {
     _notificationHub        = notificationHub;
     _notificationRepository = notificationRepository;
     _countdownRepository    = countdownRepository;
     _commentRepository      = commentRepository;
 }
Ejemplo n.º 3
0
        public EventStoreConnection(
            IEventStoreConnectionState connectionState,
            IEventJournal journal,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotifications,
            IEventStreamConsumers consumers,
            IEventStreamConsumingSessionFactory sessionFactory,
            IEventMutationPipelineFactory pipelineFactory,
            IConsumersService consumersService)
        {
            Require.NotNull(connectionState, nameof(connectionState));
            Require.NotNull(journal, nameof(journal));
            Require.NotNull(notificationHub, nameof(notificationHub));
            Require.NotNull(pendingNotifications, nameof(pendingNotifications));
            Require.NotNull(consumers, nameof(consumers));
            Require.NotNull(sessionFactory, nameof(sessionFactory));
            Require.NotNull(pipelineFactory, nameof(pipelineFactory));
            Require.NotNull(consumersService, nameof(consumersService));

            m_connectionState      = connectionState;
            m_journal              = journal;
            m_notificationHub      = notificationHub;
            m_pendingNotifications = pendingNotifications;
            m_consumers            = consumers;
            m_sessionFactory       = sessionFactory;
            m_pipelineFactory      = pipelineFactory;
            ConsumersService       = consumersService;

            m_connectionState.ChangeToCreated(this);
        }
Ejemplo n.º 4
0
        public async Task <JsonResult> _EditPermission([FromServices] SignInManager <GearUser> signInManager,
                                                       [FromServices] INotificationHub hub, EditPermissionViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { success = false, message = "Model is not valid" }));
            }

            var entity = ApplicationDbContext.Permissions.SingleOrDefault(x => x.Id == model.PermissionId);

            if (entity == null)
            {
                return(Json(new { success = false, message = "Permission not found" }));
            }

            entity.Changed        = DateTime.Now;
            entity.Description    = model.Description;
            entity.PermissionName = model.PermissionName;

            try
            {
                await ApplicationDbContext.SaveChangesAsync();

                //var onlineUsers = hub.GetOnlineUsers();
                //await User.RefreshOnlineUsersClaims(ApplicationDbContext, signInManager, onlineUsers);
                return(Json(new { success = true, message = "Save successful " }));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Ejemplo n.º 5
0
        public EventStoreConnection(
            IEventStoreConnectionState connectionState,
            IEventJournal journal,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotifications,
            IEventStreamConsumers consumers,
            IEventStreamConsumingSessionFactory sessionFactory,
            IEventMutationPipelineFactory pipelineFactory)
        {
            Require.NotNull(connectionState, "connectionState");
            Require.NotNull(journal, "journal");
            Require.NotNull(notificationHub, "notificationHub");
            Require.NotNull(pendingNotifications, "pendingNotifications");
            Require.NotNull(consumers, "consumers");
            Require.NotNull(sessionFactory, "sessionFactory");
            Require.NotNull(pipelineFactory, "pipelineFactory");

            m_connectionState      = connectionState;
            m_journal              = journal;
            m_notificationHub      = notificationHub;
            m_pendingNotifications = pendingNotifications;
            m_consumers            = consumers;
            m_sessionFactory       = sessionFactory;
            m_pipelineFactory      = pipelineFactory;

            m_connectionState.ChangeToCreated(this);
        }
Ejemplo n.º 6
0
 public OrderController(IBaseService <Order> orderService, IBaseService <User> userService, IBaseService <Notification> notiService, INotificationHub notificationHub)
 {
     _notiService     = notiService;
     _orderService    = orderService;
     _userService     = userService;
     _notificationHub = notificationHub;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates an instance of the current class
 /// </summary>
 /// <param name="host">The host to connect to</param>
 /// <param name="port">The port to connect to</param>
 /// <param name="notificationHub">An optional hub wich will handle notifications</param>
 /// <param name="keepAliveInterval">The keep alive interval used to send heart beats in a specific interval to the server to not get timed out (disconnected)</param>
 public QueryClient(string host = null, ushort?port = null, INotificationHub notificationHub = null, TimeSpan?keepAliveInterval = null)
 {
     Host              = host ?? "localhost";
     Port              = port ?? 10011;
     NotificationHub   = notificationHub;
     KeepAliveInterval = keepAliveInterval;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dataService"></param>
 /// <param name="context"></param>
 /// <param name="hub"></param>
 /// <param name="logger"></param>
 /// <param name="emailSender"></param>
 /// <param name="userManager"></param>
 public Notify(IDynamicService dataService, TContext context, INotificationHub hub, ILogger <Notify <TContext, TRole, TUser> > logger, IEmailSender emailSender, IUserManager <GearUser> userManager)
 {
     _dataService = dataService;
     _context     = context;
     _hub         = hub;
     _logger      = logger;
     _emailSender = emailSender;
     _userManager = userManager;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userManager"></param>
 /// <param name="httpContextAccessor"></param>
 /// <param name="emailSender"></param>
 /// <param name="urlHelper"></param>
 /// <param name="localizer"></param>
 /// <param name="hub"></param>
 public OrganizationService(ApplicationDbContext context, IUserManager <GearUser> userManager, IHttpContextAccessor httpContextAccessor,
                            IEmailSender emailSender, IUrlHelper urlHelper, IStringLocalizer localizer, INotificationHub hub)
 {
     _context             = context;
     _userManager         = userManager;
     _httpContextAccessor = httpContextAccessor;
     _emailSender         = emailSender;
     _urlHelper           = urlHelper;
     _localizer           = localizer;
     _hub = hub;
 }
Ejemplo n.º 10
0
        public WebNotificationObserver(
            INotificationHandler notificationHandler,
            INotificationHub notificationHub,
            IQueuedNotificationService queuedNotificationService,
            IUserService userService)
        {
            _notificationHandler       = notificationHandler;
            _notificationHub           = notificationHub;
            _queuedNotificationService = queuedNotificationService;
            _userService = userService;

            _notificationHandler.Register(this);
        }
Ejemplo n.º 11
0
        public PendingNotificationsChaser(
            IPendingNotifications pendingNotifications,
            INotificationHub notificationHub,
            IPollingJob pollingJob,
            ICloudBlockBlob chaserExclusiveAccessBlobLock)
        {
            Require.NotNull(pendingNotifications, "pendingNotifications");
            Require.NotNull(notificationHub, "notificationHub");
            Require.NotNull(pollingJob, "pollingJob");
            Require.NotNull(chaserExclusiveAccessBlobLock, "chaserExclusiveAccessBlobLock");

            m_pendingNotifications          = pendingNotifications;
            m_notificationHub               = notificationHub;
            m_pollingJob                    = pollingJob;
            m_chaserExclusiveAccessBlobLock = chaserExclusiveAccessBlobLock;
        }
Ejemplo n.º 12
0
        public EventStreamWriter(
            string streamName,
            IEventStoreConnectionState connectionState,
            EventStreamHeader endOfStream,
            IEventJournal journal,
            IEventMutationPipeline mutationPipeline,
            INotificationHub notificationHub,
            IPendingNotifications pendingNotification) : base(streamName, connectionState)
        {
            Require.NotEmpty(streamName, "streamName");
            Require.NotNull(journal, "journal");
            Require.NotNull(mutationPipeline, "mutationPipeline");
            Require.NotNull(notificationHub, "notificationHub");
            Require.NotNull(pendingNotification, "pendingNotification");

            m_endOfStream         = endOfStream;
            m_journal             = journal;
            m_mutationPipeline    = mutationPipeline;
            m_notificationHub     = notificationHub;
            m_pendingNotification = pendingNotification;
        }
 public CommentsController(AppDbContext context, INotificationHub hub)
 {
     _context = context;
     _hub     = hub;
 }
Ejemplo n.º 14
0
 protected EventToHubProxy(ILogger logger, INotificationHub notificationHub, IAuthenticationTokenHelper <TSingleSignOnToken> authenticationTokenHelper)
 {
     Logger                    = logger;
     NotificationHub           = notificationHub;
     AuthenticationTokenHelper = authenticationTokenHelper;
 }
Ejemplo n.º 15
0
 public NotificationService(INotificationRepo notificationRepo, IUserRepo userRepo, INotificationHub notificationHub)
 {
     this.notificationRepo = notificationRepo;
     this.userRepo         = userRepo;
     this.notificationHub  = notificationHub;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// NotificationHubインスタンスを設定する
 /// </summary>
 /// <param name="instance">NotificationHubインスタンス</param>
 public void SetNotificationHub(INotificationHub instance)
 {
     this.notificationHub = instance;
 }
Ejemplo n.º 17
0
 public SettingsController(IScribeDatabase database, IAuthenticationService authenticationService, INotificationHub notificationHub)
     : base(database, authenticationService)
 {
 }
Ejemplo n.º 18
0
 public static void Initialise(INotificationHub instance)
 {
     _instance = instance;
     _instance.Initialise();
 }
Ejemplo n.º 19
0
 public AnalyticsController(IScribeDatabase database, IAuthenticationService authenticationService, INotificationHub notificationHub)
     : base(database, authenticationService)
 {
     _notificationHub = notificationHub;
     _service         = new AnalyticsService(Database);
 }
Ejemplo n.º 20
0
 public NotificationRegisterController(INotificationHub hub)
 {
     _hub = hub.GetHub();
 }
Ejemplo n.º 21
0
 public NotificationService(INotificationRepository notificationRepository, INotificationHub hub, UserManager <User> userManager)
 {
     _notificationRepository = notificationRepository;
     _hub         = hub;
     _userManager = userManager;
 }
Ejemplo n.º 22
0
 public PageController(IScribeDatabase database, IAuthenticationService authenticationService, INotificationHub notificationHub)
     : base(database, authenticationService)
 {
     _notificationHub = notificationHub;
 }
 public FeedbacksController(IFeedbackRepository context, AppDbContext appDbContext, INotificationHub hub)
 {
     _context      = context;
     _appDbContext = appDbContext;
     _hub          = hub;
 }
Ejemplo n.º 24
0
 public static void Initialise(INotificationHub instance)
 {
     _instance = instance;
     _instance.Initialise();
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Instantiates a new instance of <see cref="GlobalEventToHubProxy{TAuthenticationToken}"/>.
 /// </summary>
 public GlobalEventToHubProxy(ILogger logger, INotificationHub notificationHub, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper)
     : base(logger, notificationHub, authenticationTokenHelper)
 {
 }
 public TickerDataChangeIntegrationEventHandler(INotificationHub notificationHub)
 {
     this.notificationHub = notificationHub;
 }
Ejemplo n.º 27
0
 public OrderbookDataChangeIntegrationEventHandler(INotificationHub notificationHub)
 {
     this.notificationHub = notificationHub;
 }
Ejemplo n.º 28
0
 public EventToHubProxy(ILogger logger, INotificationHub notificationHub, IAuthenticationTokenHelper <string> authenticationTokenHelper)
     : base(logger, notificationHub, authenticationTokenHelper)
 {
 }
Ejemplo n.º 29
0
        public async Task <JsonResult> _EditRole([FromServices] SignInManager <GearUser> signInManager,
                                                 [FromServices] INotificationHub hub, string id, UpdateRoleViewModel model)
        {
            if (id != model.Id)
            {
                return(Json(new { success = false, message = "Not found" }));
            }

            if (!ModelState.IsValid)
            {
                return(Json(new { success = false, message = "Model is not valid" }));
            }

            var applicationRole = await RoleManager.FindByIdAsync(id);

            applicationRole.Name      = model.Name;
            applicationRole.Title     = model.Title;
            applicationRole.IsDeleted = model.IsDeleted;
            var result = await RoleManager.UpdateAsync(applicationRole);

            if (!result.Succeeded)
            {
                return(Json(new { success = false, message = "Cant update role" }));
            }

            var roleProfilesId = ApplicationDbContext.Set <RoleProfile>()
                                 .Where(x => x.ApplicationRoleId == applicationRole.Id);

            ApplicationDbContext.RemoveRange(roleProfilesId);
            await ApplicationDbContext.SaveChangesAsync();

            if (model.SelectedProfileId == null)
            {
                return(Json(new { success = false, message = "Select profile" }));
            }

            var role = await ApplicationDbContext.Roles.SingleOrDefaultAsync(m => m.Name == model.Name);

            if (role != null)
            {
                foreach (var _ in model.SelectedProfileId)
                {
                    var newRoleProfile = new RoleProfile
                    {
                        ApplicationRoleId = role.Id,
                        ProfileId         = Guid.Parse(_)
                    };
                    await ApplicationDbContext.AddAsync(newRoleProfile);

                    await ApplicationDbContext.SaveChangesAsync();
                }

                //Delete previous permissions
                var rolePermissionId = ApplicationDbContext.Set <RolePermission>()
                                       .Where(x => x.RoleId == applicationRole.Id);
                ApplicationDbContext.RemoveRange(rolePermissionId);
                await ApplicationDbContext.SaveChangesAsync();

                if (model.SelectedPermissionId != null)
                {
                    foreach (var _ in model.SelectedPermissionId)
                    {
                        var permission =
                            await ApplicationDbContext.Permissions.SingleOrDefaultAsync(x => x.Id == Guid.Parse(_));

                        if (permission != null)
                        {
                            var newRolePermission = new RolePermission
                            {
                                PermissionCode = permission.PermissionKey,
                                RoleId         = id,
                                PermissionId   = permission.Id
                            };
                            await ApplicationDbContext.AddAsync(newRolePermission);

                            await ApplicationDbContext.SaveChangesAsync();
                        }
                    }
                }

                var onlineUsers = hub.GetOnlineUsers();
                await User.RefreshOnlineUsersClaims(ApplicationDbContext, signInManager, onlineUsers);
            }

            return(Json(new { success = true, message = "Save success!!" }));
        }