public DocumentTypeList GetDocumentTypes() { var documentTypes = new DocumentTypeList(); try { foreach (var udtg in App.Core.DocumentTypeGroups) { var dtg = new DocumentType(udtg.ID, udtg.Name); documentTypes.Add(dtg); if (udtg.DocumentTypes != null) { foreach (var udt in udtg.DocumentTypes) { if (dtg.DocumentTypeList == null) { dtg.DocumentTypeList = new DocumentTypeList(); } dtg.DocumentTypeList.Add(new DocumentType(udt.ID, udt.Name)); } } } } catch (SessionNotFoundException) { Cache.Clear(_userName); throw; } return(documentTypes); }
public DocumentTypeList GetDocumentTypes() { var documentTypes = new DocumentTypeList(); try { foreach (var udtg in App.Core.DocumentTypeGroups) { var dtg = new DocumentType(udtg.ID, udtg.Name); documentTypes.Add(dtg); if (udtg.DocumentTypes != null) { foreach (var udt in udtg.DocumentTypes) { if (dtg.DocumentTypeList == null) dtg.DocumentTypeList = new DocumentTypeList(); dtg.DocumentTypeList.Add(new DocumentType(udt.ID, udt.Name)); } } } } catch (SessionNotFoundException) { Cache.Clear(_userName); throw; } return documentTypes; }