protected override APISeriesItem.DocumentSeries TransformDTO(DSW.DocumentSeries entity) { if (entity == null) { throw new ArgumentException("Impossibile trasformare DocumentSeries se l'entità non è inizializzata"); } APISeriesItem.DocumentSeries apiDocumentSeries = new APISeriesItem.DocumentSeries(); apiDocumentSeries.EntityId = entity.Id; apiDocumentSeries.PublicationEnabled = entity.PublicationEnabled.Value; apiDocumentSeries.SubsectionEnabled = entity.SubsectionEnabled; apiDocumentSeries.IdDocumentSeriesFamily = entity.Family.Id; apiDocumentSeries.RoleEnabled = entity.RoleEnabled; apiDocumentSeries.SortOrder = entity.SortOrder; apiDocumentSeries.AllowAddDocument = entity.AllowAddDocument; apiDocumentSeries.AllowNoDocument = entity.AllowNoDocument; apiDocumentSeries.RegistrationDate = entity.RegistrationDate; apiDocumentSeries.RegistrationUser = entity.RegistrationUser; apiDocumentSeries.LastChangedDate = entity.LastChangedDate; apiDocumentSeries.LastChangedUser = entity.LastChangedUser; apiDocumentSeries.Container = _mapperContainerEntity.MappingDTO(entity.Container); apiDocumentSeries.RegistrationUser = entity.RegistrationUser; apiDocumentSeries.RegistrationDate = entity.RegistrationDate; apiDocumentSeries.Name = entity.Name; return(apiDocumentSeries); }
protected override APIProtocol.Protocol TransformDTO(DSW.Protocol entity) { if (entity == null) { throw new ArgumentException("Impossibile trasformare Protocol se l'entità non è inizializzata"); } APIProtocol.Protocol apiProtocol = new APIProtocol.Protocol(); apiProtocol.UniqueId = entity.Id; apiProtocol.Year = entity.Year; apiProtocol.Number = entity.Number; apiProtocol.Object = entity.ProtocolObject; apiProtocol.RegistrationDate = entity.RegistrationDate; apiProtocol.RegistrationUser = entity.RegistrationUser; apiProtocol.LastChangedDate = entity.LastChangedDate; apiProtocol.LastChangedUser = entity.LastChangedUser; apiProtocol.ObjectChangeReason = entity.ObjectChangeReason; apiProtocol.DocumentDate = entity.DocumentDate; apiProtocol.DocumentProtocol = entity.DocumentProtocol; apiProtocol.IdDocument = entity.IdDocument; apiProtocol.IdAttachments = entity.IdAttachments; apiProtocol.DocumentCode = entity.DocumentCode; apiProtocol.IdStatus = Convert.ToInt16(entity.IdStatus); apiProtocol.LastChangedReason = entity.LastChangedReason; apiProtocol.AlternativeRecipient = entity.AlternativeRecipient; apiProtocol.JournalDate = entity.JournalDate; apiProtocol.LastConservationDate = entity.LastConservationDate; apiProtocol.HasConservatedDocs = entity.HasConservatedDocs; apiProtocol.IdAnnexed = entity.IdAnnexed != Guid.Empty ? entity.IdAnnexed : (Guid?)null; apiProtocol.HandlerDate = entity.HandlerDate; apiProtocol.TDError = entity.TDError; apiProtocol.IdProtocolKind = entity.IdProtocolKind; apiProtocol.DematerialisationChainId = entity.DematerialisationChainId; apiProtocol.Category = _mapperCategory.MappingDTO(entity.Category); apiProtocol.Container = _mapperContainer.MappingDTO(entity.Container); apiProtocol.ProtocolRoles = entity.Roles.Select(s => _mapperProtocolRoleEntity.MappingDTO(s)).ToList(); apiProtocol.ProtocolUsers = entity.Users.Select(u => _mapperProtocolUserEntity.MappingDTO(u)).ToList(); return(apiProtocol); }