/// <summary> /// Loads the containers. /// </summary> /// <param name="recordId">The record identifier.</param> /// <returns>ArchiveRecordMetadataContainers.</returns> private ArchiveRecordMetadataContainers LoadContainers(long recordId) { var retVal = new ArchiveRecordMetadataContainers(); try { var dsContainers = dataProvider.LoadContainers(recordId); retVal.NumberOfContainers = dsContainers.StorageContainer.Count; foreach (var row in dsContainers.StorageContainer) { retVal.Container.Add(new ArchiveRecordMetadataContainersContainer { ContainerLocation = row.BHLTN_DEF_STAND_ORT_CD, ContainerType = row.BHLTN_TYP_NM, IdName = row.GSFT_OBJ_KURZ_NM, ContainerCode = row.BHLTN_CD, ContainerCarrierMaterial = row.BHLTN_INFO_TRGR_NM }); } } catch (Exception ex) { Log.Error(ex, "Failed to load the containers for record {RecordId}", recordId); throw; } return(retVal); }
private List <BehaeltnisType> GetBehaltnisse(OrderDetailData verzEinheit) { List <BehaeltnisType> retVal = null; Log.Debug("Fetching containers for archive record with id {archiveRecordId}", verzEinheit.Id); var containers = dataProvider.LoadContainers(Convert.ToInt64(verzEinheit.Id)); if (containers.StorageContainer.Rows.Count > 0) { retVal = new List <BehaeltnisType>(); foreach (var container in containers.StorageContainer) { retVal.Add(new BehaeltnisType { BehaeltnisCode = container.BHLTN_CD, BehaeltnisTyp = container.BHLTN_TYP_NM, InformationsTraeger = container.BHLTN_INFO_TRGR_NM, Standort = container.BHLTN_DEF_STAND_ORT_CD, EnthalteneVerzEinheiten = verzEinheit.Level == DossierLevelIdentifier ? GetArchiveRecordsToContainer(container.BHLTN_ID) : null }); } } return(retVal); }