// this function collet all the tasks from data and forward to the specific column they belong to. public int open(string author) { int numberOfTasksAdded = 0; TaskD taskD = DataLayerTask.Open(numberOfTasksAdded, author); while (taskD != null) { Column column = (Column)columnsHashTable[taskD.getStatus()]; column.addTask(taskD.getTitle(), taskD.getDescription(), taskD.getDueDate(), taskD.getAuthor(), taskD.getTaskUID()); Log.Info("Task #" + numberOfTasksAdded + " loaded successfully from the database."); numberOfTasksAdded++; taskD = DataLayerTask.Open(numberOfTasksAdded, author); } return(numberOfTasksAdded); }
// this function collet all the tasks from data and forward to the specific column they belong to. public int open(string author, string existingColumns) { int numberOfColumns = 1; columnsHashTable = new Hashtable(); this.currColumnCount = 0; string columnID; string[] splited = existingColumns.Split('+'); for (int i = 0; i < splited.Length; i = i + 1) { if (!splited[i].Equals("")) { columnID = splited[i]; ColumnD columnD = DataLayerColumn.Open(columnID, author); Column column = new Column(columnD.getName()); column.setMAX_TASKS(author, columnD.getMaxCapacity()); columnsHashTable.Add(numberOfColumns, column); this.currColumnCount = this.currColumnCount + 1; numberOfColumns = numberOfColumns + 1; Log.Info("Column " + column.getName() + " loaded successfully from the database."); } } int numberOfTasksAdded = 0; TaskD taskD = DataLayerTask.Open(numberOfTasksAdded, author); while (taskD != null) { Column column = (Column)columnsHashTable[taskD.getStatus()]; column.addTask(taskD.getTitle(), taskD.getDescription(), taskD.getStatus(), taskD.getDueDate(), taskD.getCreationTime(), taskD.getAuthor(), taskD.getTaskUID()); Log.Info("Task #" + numberOfTasksAdded + " loaded successfully from the database."); numberOfTasksAdded++; taskD = DataLayerTask.Open(numberOfTasksAdded, author); } return(numberOfTasksAdded); }
// this function forwards the task details to data layer to be saved. public void save() { DataLayerTask.save(this.TITLE, this.DESCRIPTION, this.STATUS, this.DUEDATE.ToShortDateString(), this.AUTHOR, this.taskUID); Log.Info("Task #" + taskUID + " saved to the database successfully."); }