public DocumentTypes GetDocumentTypes() { var documentTypes = new DocumentTypes(); using (var app = OBConnection(ServiceUrl, DataSource, UserName, Password)) { 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.DocumentTypes == null) dtg.DocumentTypes = new DocumentTypes(); dtg.DocumentTypes.Add(new DocumentType(udt.ID, udt.Name)); } } } } 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; }
private void DisplayDocumentType(DocumentType documentType) { txtResult.Clear(); txtResult.Text += String.Format("Id: {0}, Name: {1}{2}", documentType.Id, documentType.Name, Environment.NewLine); }