bool sub = true;
bool isSub(int object_id,int current_id)
{
string sql = "";
DBConnection db = new DBConnection();
db.Open();
sql += " select object_id2 ";
sql += " from DOCUMENT_TREE ";
sql += " where object_id1 = {0}";
sql = string.Format(sql, object_id);
OracleDataReader reader = db.ExecuteReader(sql);
for (int i = 0; reader.Read(); i++)
{
if (isFolder(getClassID(Convert.ToInt32(reader["object_id2"]))))
{
isSub(Convert.ToInt32(reader["object_id2"]),current_id);
if(current_id == Convert.ToInt32(reader["object_id2"])){
sub = false;
break;
}
}
db.Close();
return !sub;
}
db테이블로 구현한 트리구조에서 하위폴더인지 아닌지 검사하는건데
간단한 코드 짜는데도 30분씩 머리 굴려야함
그리고 나중에 보면 내가 짰는데도 뭔 개소린지 이해하기 힘듬
댓글 0