public ActionResult Status(int id)
        {
            TaskRepo repo = new TaskRepo();
            Task     task = repo.GetById(id);

            if (task.assignetId == AuthenticationManager.LoggedUser.Id || task.creatorId == AuthenticationManager.LoggedUser.Id)
            {
                if (task.finnished == true)
                {
                    task.finnished = false;
                }
                else
                {
                    task.finnished = true;
                }

                repo.Edit(task);

                return(RedirectToAction("Index", "TaskManagement"));
            }
            else
            {
                return(RedirectToAction("Index", "TaskManagement"));
            }
        }
        public ActionResult SetHours(SetHoursVM set)
        {
            TaskRepo repo = new TaskRepo();
            Task     task = repo.GetById(set.Id);

            task.editedBY = AuthenticationManager.LoggedUser.Id;
            task.editedON = DateTime.Now;
            task.estimate = task.estimate + set.SetHours;

            repo.Edit(task);

            LogWorkRepo repoWork = new LogWorkRepo();
            LogWork     work     = new LogWork();

            work.TaskId   = task.Id;
            work.Username = AuthenticationManager.LoggedUser.Username;
            work.Email    = AuthenticationManager.LoggedUser.Email;
            work.Time     = set.SetHours;
            work.Date     = DateTime.Now;

            repoWork.Create(work);

            return(RedirectToAction("CreateComment", "CommentManagement", new { id = task.Id }));
        }