Exemple #1
0
        public IActionResult OnGet(Guid id)
        {
            Task = _context.Find <Task>(id);

            if (Task == null)
            {
                return(RedirectToPage("Create"));
            }

            return(Page());
        }
Exemple #2
0
        private IActionResult ChangeTaskStatus(Guid id, ETaskStatus current, ETaskStatus next)
        {
            var task = _context.Find <Task>(id);

            if (task != null && task.Status == current)
            {
                task.Status = next;

                _context.Update(task);

                _context.SaveChanges();
            }

            Tasks = _context.Tasks.ToList();

            Request.QueryString = default;

            return(RedirectToPage("Index"));
        }