Example #1
0
        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);
        }
Example #2
0
        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;
        }