public InterfaceLayerBoard GetBoard(string boardId, string name) { try { List <InterfaceLayerColumn> columns = new List <InterfaceLayerColumn>(); List <Board> boards = Board.getListBoardById(name); InterfaceLayerUser author = new InterfaceLayerUser(name); foreach (Board board in boards) { foreach (Column c in board.getColumns) { if (c.getBoardId() == boardId) { List <InterfaceLayerTask> tasks = new List <InterfaceLayerTask>(); foreach (Task t in c.getTasks) { tasks.Add(new InterfaceLayerTask(author, t.getTitle(), t.getColumnId(), t.getDueDate(), t.getDescription(), t.getTaskId(), t.getCreationTime())); } columns.Add(new InterfaceLayerColumn(c.getColumnId(), c.getMaxTasks(), tasks)); } } } return(new InterfaceLayerBoard(name, columns)); } catch (Exception) { return(null); } }
public TaskContext(string user) { UserService service = new UserService(); this.user = service.GetUser(user); this.username = user; }
public BoardWindowDataContext(string user) { UserService service = new UserService(); this.user = service.GetUser(user); this.username = user; ShowTheard(this.user); }
public void SortByDueDate(string userName) { UserService serv = new UserService(); InterfaceLayerUser user = serv.GetUser(userName); ColumnService colserv = new ColumnService(); colserv.SortByDueDate(userName); ShowTheard(user); }
public KanbanWindow(string user) { InitializeComponent(); VM = new BoardWindowDataContext(user); this.DataContext = VM; UserService service = new UserService(); this.user = service.GetUser(user); this.email = user; }
public NewTask(string user) { InitializeComponent(); UserService service = new UserService(); this.user = service.GetUser(user); this.VM = new TaskContext(user); //format the VM this.DataContext = this.VM; this.email = user; }
public TaskWindow(InterfaceLayerTask task, string user) { InitializeComponent(); this.task = task; UserService service = new UserService(); this.user = service.GetUser(user); this.VM = new TaskContext(task, user); //format the VM this.email = user; this.DataContext = this.VM; }
public TaskContext(InterfaceLayerTask task, string user) { this.Title = task.Title; this.Column = task.CurrCol; this.DueDate = task.DueDate; this.CreationTime = task.CreationTime; this.Description = task.Description; UserService service = new UserService(); this.user = service.GetUser(user); this.username = user; }
public void RemoveColumn(string x) { UserService ser = new UserService(); bool b = ser.RemoveColumn(username, x); if (b) { this.user = ser.GetUser(username); ShowTheard(user); } else { MessageBox.Show("something went wrong"); } }
public InterfaceLayerUser Login() { UserService auth = new UserService(); bool b = auth.login(email, pwd); if (b) { InterfaceLayerUser user = auth.GetUser(email); return(user); } else { return(null); } }
public void ShowTheard(InterfaceLayerUser user) { BindableCollection <BoardWindowTask> tasks = new BindableCollection <BoardWindowTask>(); InterfaceLayerBoard board = user.Board; foreach (InterfaceLayerColumn col in user.Board.boardColumns.Values) { foreach (InterfaceLayerTask t in col.tasks) { if (t != null) { tasks.Add(new BoardWindowTask(t)); } } } Tasks = tasks; }
public bool CreateColumn() { Validation val = new Validation(); UserService service = new UserService(); if (val.validateColumnInfo(Column, service.GetBoard(username))) { if (service.CreateColumn(username, Column, PrevColumn)) { this.user = service.GetUser(username); ShowTheard(user); return(true); } else { return(false); } } else { return(false); } }