public InterfaceLayerUser GetUser(string userName) { if (userName != null) { User user = Authantication.userRegisterd[userName]; Dictionary <string, InterfaceLayerColumn> boardColumns = new Dictionary <string, InterfaceLayerColumn>(); foreach (KeyValuePair <string, Column> col in user.KanBanBoard.boardColumns) { List <InterfaceLayerTask> tasks = new List <InterfaceLayerTask>(); Column c = col.Value; foreach (Task t in c.getTasks()) { InterfaceLayerTask taskToAdd = new InterfaceLayerTask(t.title, t.description, t.dueDate, t.creationTime, t.currCol); tasks.Add(taskToAdd); } string colName = col.Key; InterfaceLayerColumn tempCol = new InterfaceLayerColumn(colName, tasks, c.maxNumOfTaskInColumn); boardColumns.Add(colName, tempCol); } InterfaceLayerBoard board = new InterfaceLayerBoard(boardColumns); InterfaceLayerUser user1 = new InterfaceLayerUser(user.GetEmail(), board); return(user1); } else { FileLogger.WriteNullObjectExceptionToLogger <string>("GetUser[Service] function"); } return(null); }
public int IsTaskHere(InterfaceLayerTask t, string currCol, string userName)//checking if a task is in this column { User user = Authantication.userRegisterd[userName]; BL.Task task = new BL.Task(t.Title, t.Description, t.DueDate, t.CurrCol); return(user.KanBanBoard.boardColumns[currCol].IsTaskHere(task)); }
public bool RemoveTask(InterfaceLayerTask t, string userName, string currCol) { User user = Authantication.userRegisterd[userName]; BL.Task task = new BL.Task(t.Title, t.Description, t.DueDate, t.CurrCol); return(user.KanBanBoard.boardColumns[currCol].RemoveTask(task)); }
public bool EditTask(InterfaceLayerTask old, InterfaceLayerTask newTask, string userName, string currCol) { User user = Authantication.userRegisterd[userName]; BL.Task old1 = new BL.Task(old.Title, old.Description, old.DueDate, old.CurrCol, old.CreationTime); BL.Task newTask1 = new BL.Task(newTask.Title, newTask.Description, newTask.DueDate, newTask.CurrCol, old.CreationTime); return(user.EditTask(old1, newTask1, currCol)); }
public bool PromoteTaskToNextPhase(string userName, InterfaceLayerTask task) { User user = Authantication.userRegisterd[userName]; string currCol = task.CurrCol; string targetCol = user.KanBanBoard.columnsOrder.Find(currCol).Next.Value; if (targetCol == null) { FileLogger.WriteErrorToLog("the task is in the last column - can't promote the task!"); return(false); } BL.Task t = new BL.Task(task.Title, task.Description, task.DueDate, task.CurrCol, task.CreationTime); return(user.PromoteTaskToNextPhase(t, currCol, targetCol)); }