Exemple #1
0
        public Task EditTask(TaskAbs editedTask)
        {
            var task = this.FindTaskById(editedTask.Id);

            task.Content           = editedTask.Content;
            task.LevelOfImportance = editedTask.LevelOfImportance;
            task.Type = editedTask.Type;

            this.Context.SaveChanges();
            return(task);
        }
Exemple #2
0
        public IActionResult EditTask(TaskAbs task, int taskId)
        {
            task.Id = taskId;

            this.taskService.EditTask(task);

            if (task.Type == Constants.IndividualTaskType)
            {
                return(RedirectToAction("IndividualTasks", "Task", new { area = "Teamleader" }));
            }


            return(RedirectToAction("GroupTasks", "Task", new { area = "Teamleader" }));
        }
Exemple #3
0
        public IActionResult Edit(int taskId)
        {
            var task = this.taskService.FindTaskById(taskId);

            var taskView = new TaskAbs()
            {
                Id                = taskId,
                Content           = task.Content,
                LevelOfImportance = task.LevelOfImportance,
                Type              = task.Type
            };

            return(View(taskView));
        }
Exemple #4
0
        public Task CreateTask(TaskAbs task)
        {
            var newTask = new Task()
            {
                Content           = task.Content,
                LevelOfImportance = task.LevelOfImportance,
                Type        = task.Type,
                isCompleted = false
            };

            this.Context.Tasks.Add(newTask);
            this.Context.SaveChanges();

            return(newTask);
        }
Exemple #5
0
        public IActionResult Create(TaskAbs task)
        {
            this.taskService.CreateTask(task);

            return(RedirectToAction("CreateTask", "Task", new { area = "Teamleader" }));
        }