// second screen public void addTask(string email, string title, string description, DateTime dueDate, ColumnModel column, ColumnModel backupColumn) { Response <Task> response = Service.AddTask(email, title, description, dueDate); if (response.ErrorOccured)//if addtask failed { throw new Exception(response.ErrorMessage); } else //task was added { Task temp = response.Value; TaskModel toAdd = new TaskModel(this, temp); toAdd.BackGroundColor = new System.Windows.Media.SolidColorBrush(Colors.Blue); column.Tasks.Add(toAdd); if (backupColumn != null) //if tasks are currently filtered and there is a need to add the task in the backup board { TaskModel toAddBackUp = new TaskModel(this, temp); toAdd.BackGroundColor = new System.Windows.Media.SolidColorBrush(Colors.Blue); backupColumn.Tasks.Add(toAddBackUp); } } }
private TaskModel TaskToModel(IntroSE.Kanban.Backend.ServiceLayer.Task t, string email, int n) { return(new TaskModel(this, t.Id, t.emailAssignee, t.Title, t.Description, t.DueDate, t.CreationTime, n, email)); }