Example #1
0
        public void UpdateMonitoringTaskGeneralInfo(UpdateMonitoringGeneralInfoDto dto)
        {
            var userId = _userService.GetUser()?.Id;

            if (!string.IsNullOrEmpty(userId))
            {
                var task = _context.MonitoringTasks.Single(p => p.Id == dto.Id && p.RecurringJobId == dto.RecurringJobId && p.UserId == userId);
                task.UpdateGeneralInfo(dto.Name, dto.Url, dto.IntervalSeconds);

                AddOrUpdateBackgroundjob(task);

                _unitOfWork.SaveChanges();
            }
        }
Example #2
0
        public ActionResult GetGeneralInfo(int id)
        {
            UpdateMonitoringGeneralInfoDto monitoringGeneralInfoDto = _service.GetMonitoringTaskGeneralInfo(id);

            return(PartialView("_UpdateMonitoringGeneralInfo", monitoringGeneralInfoDto));
        }
Example #3
0
        public ActionResult UpdateMonitorTaskGeneralInfo(UpdateMonitoringGeneralInfoDto dto)
        {
            _service.UpdateMonitoringTaskGeneralInfo(dto);

            return(RedirectToAction(nameof(Index)));
        }