Пример #1
0
        public async Task UpdateFilters(string applicationUserId)
        {
            if (applicationUserId == null)
            {
                throw new ArgumentNullException(nameof(applicationUserId));
            }
            var applicationUser = await unitOfWork.UserManager.FindByIdAsync(applicationUserId);

            var newLotDtosModels = new List <NewLotDtosModel>();

            foreach (var filter in applicationUser.Filters)
            {
                var newLotDtosModel = await lotService.UpdateLots(filter.Id);

                if (newLotDtosModel.FreshLots.Any())
                {
                    newLotDtosModels.Add(newLotDtosModel);
                }
            }
            if (newLotDtosModels.Any())
            {
                emailProvider.SendMessage(new NotificationMessage(applicationUser.Email, SendNotificationLinkHelper.Title, SendNotificationLinkHelper.Subject),
                                          new NotificationMessageContext(newLotDtosModels));
            }
        }
Пример #2
0
        public async Task <ActionResult> UpdateLots(int filterId)
        {
            await lotService.UpdateLots(filterId);

            return(RedirectToAction("MonitoringPage", new { filterId }));
        }