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 void setKey(int key) { dataColumnController DCC = new dataColumnController(); DCC.Update(boardId, this.key, "columnOrdinal", key); this.key = key;//must be after writing to data base }
public void changeName(string newName) { if (!validColumnName(newName)) { log.Warn("invalid name"); throw new Exception("invalid name"); } this.name = newName; dataColumnController DCC = new dataColumnController(); DCC.Update(boardId, key, "name", newName); }
} //empty constructor public Column(string name, int columnOrdinal, int boardId) { if (!validColumnName(name)) { log.Warn("invalid name"); throw new Exception("invalid name"); } this.name = name; tasks = new List <Task>(); //New empty list without tasks this.key = columnOrdinal; this.limit = 100; this.name = name; this.boardId = boardId; //inserting to database dataColumnController DCC = new dataColumnController(); DCC.Insert(this.toDalObject()); }