Exemplo n.º 1
0
        public IActionResult MarkTaskUndone(int id)
        {
            UserTask    t = UserTask.GetTasks(_context).Find(x => x.TaskId == id);
            UserProfile u = UserProfile.GetUsers(_context).Find(x => x.Mail.ToLower() == User.Identity.Name.ToLower());

            if (Done.GetTodayDone(_context).Where(x => x.TaskId == id && x.UserId == u.UserId) != null)
            {
                Done task = Done.GetTodayDone(_context).Where(x => x.TaskId == id && x.UserId == u.UserId).Last();
                if (task != null)
                {
                    Done.DeleteDone(task, _context);
                }
            }
            return(TaskCalendar());
        }
Exemplo n.º 2
0
        public IActionResult MarkTaskWeekUndone(int id)
        {
            UserTask    t = UserTask.GetTasks(_context).Find(x => x.TaskId == id);
            UserProfile u = UserProfile.GetUsers(_context).Find(x => x.Mail.ToLower() == User.Identity.Name.ToLower());

            if (Done.GetTodayDone(_context).Where(x => x.TaskId == id && x.UserId == u.UserId) != null)
            {
                Done task = Done.GetTodayDone(_context).Where(x => x.TaskId == id && x.UserId == u.UserId).Last();
                if (task != null)
                {
                    Done.DeleteDone(task, _context);
                }
            }
            var date = Helper.ConvertDateStartToString(DateTime.Now.ToString());

            return(TaskCalendarWeek(date));
        }