Exemplo n.º 1
0
        public IManageTask ChangeStatus(DataAccesslayer.Task.Task task, TaskStatus newStatus)
        {
            RecordChange(task, TaskInfo.Option.ChangeStatus);
            RecordCommentInLog(task, $"Состояние задачи изменилось на {task.Status}");

            return(new ChangeTaskStatus(task, newStatus));
        }
Exemplo n.º 2
0
        public IManageTask Create(string Name, Description description)
        {
            var newTask = new DataAccesslayer.Task.Task(Name, description);


            Log.Add(new TaskInfo(newTask, DateTime.Now));

            TaskList.Add(newTask, Convert.ToUInt32(TaskList.Count + 1));

            return(new CreateTask(Name, description));
        }
Exemplo n.º 3
0
        public List <DataAccesslayer.Task.Task> ReturnTasks()
        {
            foreach (var task in TaskList.Where(task => task.Value == Id))
            {
                FindTask = task.Key;
                ReturnTasks();
            }
            var newList = new List <DataAccesslayer.Task.Task> {
                FindTask
            };

            return(newList);
        }
Exemplo n.º 4
0
        public void RecordChange(DataAccesslayer.Task.Task task, TaskInfo.Option someOption)
        {
            switch (someOption)
            {
            case TaskInfo.Option.WorkerDoSomething:
                Log.Add(new TaskInfo(task, DateTime.Now, task.Responsible));
                break;

            case TaskInfo.Option.ChangeStatus:
            {
                if (task.Status == TaskStatus.Resolved)
                {
                    Log.Add(new TaskInfo(task, DateTime.Now, task.Responsible.Chief, TaskInfo.Option.ChangeStatus)); break;
                }

                Log.Add(new TaskInfo(task, DateTime.Now, task.Responsible, TaskInfo.Option.ChangeStatus)); break;
            }

            case TaskInfo.Option.ChangeWorker:
                Log.Add(new TaskInfo(task, DateTime.Now, task.Responsible, TaskInfo.Option.ChangeWorker));
                break;
            }
        }
Exemplo n.º 5
0
 public ChangeTaskWorker(DataAccesslayer.Task.Task task, Worker newWorker)
 {
     SomeTask   = task;
     SomeWorker = newWorker;
     SomeActionInTask();
 }
Exemplo n.º 6
0
 public ChangeTaskStatus(DataAccesslayer.Task.Task ourTask, TaskStatus taskStatus)
 {
     SomeTask  = ourTask;
     NewStatus = taskStatus;
     SomeActionInTask();
 }
Exemplo n.º 7
0
 public AddTaskComment(DataAccesslayer.Task.Task task, string comment)
 {
     SomeTask    = task;
     SomeComment = comment;
     SomeActionInTask();
 }
Exemplo n.º 8
0
        public IManageTask WorkerDoSomething(DataAccesslayer.Task.Task task)
        {
            RecordChange(task, TaskInfo.Option.WorkerDoSomething);

            return(new WorkerDoSomething(task));
        }
Exemplo n.º 9
0
        public IManageTask ChangeWorker(DataAccesslayer.Task.Task task, Worker worker)
        {
            RecordChange(task, TaskInfo.Option.ChangeWorker);

            return(new ChangeTaskWorker(task, worker));
        }
Exemplo n.º 10
0
        public IManageTask AddComment(DataAccesslayer.Task.Task task, string comment)
        {
            RecordCommentInLog(task, comment);

            return(new AddTaskComment(task, comment));
        }
Exemplo n.º 11
0
        public void RecordCommentInLog(DataAccesslayer.Task.Task task, string comment)
        {
            var newLine = new TaskInfo(task, DateTime.Now, comment);

            Log.Add(newLine);
        }
Exemplo n.º 12
0
 public WorkerDoSomething(DataAccesslayer.Task.Task task)
 {
     OurTask = task;
     SomeActionInTask();
 }
Exemplo n.º 13
0
 public CreateTask(string name, Description description)
 {
     NewTask = new DataAccesslayer.Task.Task(name, description);
     SomeActionInTask();
 }