public void DeleteData() { //Database tables deletion--------------------------------------------------------------------------------- dataUserController DUC = new dataUserController(); dataBoardController DBC = new dataBoardController(); dataColumnController DCC = new dataColumnController(); dataTaskController DTC = new dataTaskController(); DUC.DeleteAll(); //Deleting all Users from database log.Info("deleted all users"); DBC.DeleteAll(); //Deleting all Boards from database log.Info("deleted all boards"); DCC.DeleteAll(); //Deleting all Columns from database log.Info("deleted all columns"); DTC.DeleteAll(); //Deleting all Tasks from database log.Info("deleted all tasks"); //Variables data deletion---------------------------------------------------------------------------------- foreach (var item in users) //Calling each board to deleteData (which deletes all columns and tasks) { item.Value.getBoard().DeleteData(); } this.users = new Dictionary <string, User>(); //Deleting all existing users by creating new empty dictionary bc.DeleteData(); }
public virtual void setColumnId(int colomnId) { //Updating database dataTaskController DTC = new dataTaskController(); DTC.Update(boardId, this.key, "column", colomnId); //Updating field this.columnId = colomnId; }
public void setEmailAssignee(string emailAssignee, string email) { if (isAssignedUser(email)) { this.emailAssignee = emailAssignee; //Updating database dataTaskController DTC = new dataTaskController(); DTC.Update(boardId, key, "emailAssignee", emailAssignee); } }
public void setDescription(string description, string email) { if (isValidDescription(description)) { if (isAssignedUser(email)) { this.description = description; //Updating database dataTaskController DTC = new dataTaskController(); DTC.Update(boardId, key, "description", description); } } }
public void setDueDate(DateTime dueDate, string email) { if (isValidDueDate(dueDate, DateTime.Now)) { if (isAssignedUser(email)) { this.dueDate = dueDate; //Updating database dataTaskController DTC = new dataTaskController(); DTC.Update(boardId, key, "dueDate", dueDate); } } }
public void setTitle(string title, string email) { if (isValidTitle(title)) { if (isAssignedUser(email)) { this.title = title; //Updating database dataTaskController DTC = new dataTaskController(); DTC.Update(boardId, key, "title", title); } } }
public void DeleteTask(int taskId, string email) { Task toDelete = findTask(taskId); if (!toDelete.getEmailAssignee().Equals(email)) { log.Warn("only assignee user can delete his tasks"); throw new Exception("only assignee user can delete his tasks"); } if (toDelete == null) { log.Warn("task does not exist"); throw new Exception("task does not exist"); } tasks.Remove(toDelete); // update in DB dataTaskController DTC = new dataTaskController(); DTC.Delete(boardId, taskId); }