public async Task <ActionResult <FoodMenuSubScreenForReturnDto> > Create(FoodMenuSubScreenForCreationDto creationDto)
        {
            var subscreen = await foodMenuSubScreenService.Create(creationDto);

            var onlineScreensByScreenId = await onlineScreenService.GetOnlineScreenConnectionIdByScreenId(subscreen.ScreenId);

            if (onlineScreensByScreenId != null && onlineScreensByScreenId.Length != 0)
            {
                await kiosksHub.Clients.Clients(onlineScreensByScreenId).SendAsync("ReloadScreen", true);
            }
            return(subscreen);
        }
        public async Task <ActionResult <SubScreenForReturnDto> > Create(SubScreenForCreationDto createDto)
        {
            var subscreen = await subScreenService.Create(createDto);

            var onlineScreens = await onlineScreenService.GetOnlineScreenConnectionIdByScreenId(subscreen.ScreenId);

            if (onlineScreens != null && onlineScreens.Length != 0)
            {
                await kiosksHub.Clients.Clients(onlineScreens).SendAsync("ReceiveSubScreen", subscreen);
            }
            return(subscreen);
        }
Esempio n. 3
0
        public async Task <ActionResult <ScreenHeaderForReturnDto> > Create(ScreenHeaderForCreationDto createDto)
        {
            var header = await screenHeaderService.Create(createDto);

            var screenConnectionId = await onlineScreenService.GetOnlineScreenConnectionIdByScreenId(header.ScreenId);

            if (screenConnectionId != null && screenConnectionId.Length != 0)
            {
                await kiosksHub.Clients.Clients(screenConnectionId).SendAsync("ReceiveScreenHeader", header);
            }

            return(header);
        }
        public async Task <ScreenHeaderPhotoForReturnDto> SetMain(ScreenHeaderPhotoForCreationDto creationDto)
        {
            var photo = await screenHeaderPhotoService.SetMain(creationDto);

            var onlineScreens = await onlineScreenService.GetOnlineScreenConnectionIdByScreenId(photo.ScreenId);

            if (onlineScreens != null && onlineScreens.Length != 0)
            {
                await kiosksHub.Clients.Clients(onlineScreens).SendAsync("ReceiveScreenHeaderPhoto", photo);
            }
            return(photo);
        }
Esempio n. 5
0
        public async Task <ActionResult <ScreenForReturnDto> > Update(ScreenForCreationDto updateDto)
        {
            var screen = await screenService.Update(updateDto);

            var onlineScreens = await onlineScreenService.GetOnlineScreenConnectionIdByScreenId(screen.Id);

            if (onlineScreens != null && onlineScreens.Length != 0)
            {
                var screenForKiosks = await kiosksService.GetScreenByIdAsync(screen.Id);

                if (screenForKiosks != null)
                {
                    await kiosksHub.Clients.Clients(onlineScreens).SendAsync("ReceiveScreen", screenForKiosks);
                }
            }
            return(screen);
        }