void ConsoleOut(DbSql dataBase, int RegisterId, int TableId, int index = 0) { int[] PostRegisterIds = dataBase.GetPostRegisterId(RegisterId, TableId); int[] PostPostTalbeIds = dataBase.GetPostTalbeId(RegisterId, TableId); for (int i = 0; i < PostRegisterIds.Length; i++) { listBox1.Items.Add(new string(' ', index) + dataBase.GetName(PostRegisterIds[i], PostPostTalbeIds[i])); if (!(dataBase.GetPostRegisterId(PostRegisterIds[i], PostPostTalbeIds[i]) is null)) { if (dataBase.GetPostRegisterId(PostRegisterIds[i], PostPostTalbeIds[i]).Length > 0) { ConsoleOut(dataBase, PostRegisterIds[i], PostPostTalbeIds[i], index + 1); } } } }