Пример #1
0
        public async Task <Tuple <bool, string> > Process(StatusScheduleQueueItem item)
        {
            bool   success = true;
            string result  = "";

            if (item != null && item.ScheduledTask != null)
            {
                try
                {
                    if (item.ScheduledTask.TaskType == (int)TaskTypes.DepartmentStatusReset)
                    {
                        await _actionLogsService.SetActionForEntireDepartmentAsync(item.ScheduledTask.DepartmentId, int.Parse(item.ScheduledTask.Data));
                    }
                }
                catch (Exception ex)
                {
                    Logging.LogException(ex);
                    success = false;
                    result  = ex.ToString();
                }

                if (success)
                {
                    await _scheduledTasksService.CreateScheduleTaskLogAsync(item.ScheduledTask);
                }
            }

            return(new Tuple <bool, string>(success, result));
        }
Пример #2
0
        public async Task <IActionResult> ResetAllToStandingBy()
        {
            await _actionLogsService.SetActionForEntireDepartmentAsync((await _departmentsService.GetDepartmentByUserIdAsync(UserId)).DepartmentId, (int)ActionTypes.StandingBy);

            return(RedirectToAction("Dashboard", "Home", new { area = "User" }));
        }