public List <DocumentVO> FindByCategoryId(List <CategoryVO> categories) { DocumentCategoryDAO dao = new DocumentCategoryDAO(); NoRepeatList <DocumentVO> result = new NoRepeatList <DocumentVO>(); foreach (CategoryVO cat in categories) { result.AddDistinct(GetItemsInRange(dao.GetAssociationsOfSecondTable(cat))); } dao.CloseConnection(); FullLoadList(result); return(result); }
public void FullLoad(DocumentVO doc) { DocumentCategoryDAO dao = new DocumentCategoryDAO(); List <int> categoriesIds = dao.GetAssociationsOfFirstTable(doc); dao.CloseConnection(); CategoryDAO catDao = new CategoryDAO(); List <CategoryVO> result = new List <CategoryVO>(); foreach (int item in categoriesIds) { result.Add(catDao.GetItem(item)); } catDao.CloseConnection(); doc.Categories = result; FileDAO fileDao = new FileDAO(); doc.Files = fileDao.GetFilesOfDocument(doc); fileDao.CloseConnection(); }