Ejemplo n.º 1
0
        public TransitStatesBlock(IList <MergeField> mergeFields, TransportRoute transportRoute)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new TransitStateViewModel(transportRoute.TransitStates.ToList());

            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
        }
Ejemplo n.º 2
0
        public OperationBlock(IList <MergeField> mergeFields, NotificationApplication notification, TechnologyEmployed technologyEmployed)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new OperationViewModel(notification, technologyEmployed, new OperationInfoFormatter());

            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
        }
Ejemplo n.º 3
0
        public WasteCodesBlock(IList <MergeField> mergeFields, NotificationApplication notification)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new WasteCodesViewModel(notification, new WasteCodeInfoFormatter());

            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
        }
Ejemplo n.º 4
0
        public WasteRecoveryBlock(IList <MergeField> mergeFields, NotificationApplication notification, WasteRecovery wasteRecovery, WasteDisposal wasteDisposal)
        {
            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);

            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new WasteRecoveryViewModel(notification, wasteRecovery, wasteDisposal, new WasteRecoveryFormatter());

            if (notification.NotificationType == NotificationType.Disposal)
            {
                HasAnnex = false;

                MergeMainDocumentBlock();
            }
            else
            {
                HasAnnex = true;

                if (notification.WasteRecoveryInformationProvidedByImporter.GetValueOrDefault())
                {
                    HasAnnex = false;

                    MergeMainDocumentBlock();
                }
            }
        }
Ejemplo n.º 5
0
        public CarrierBlock(IList <MergeField> mergeFields, MeansOfTransport meansOfTransport, CarrierCollection carrierCollection)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);

            data = CarrierViewModel.CreateCarrierViewModelsForNotification(meansOfTransport, carrierCollection, new MeansOfTransportFormatter());

            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
        }
Ejemplo n.º 6
0
        public CustomsOfficeBlock(IList <MergeField> mergeFields, TransportRoute transportRoute, UKCompetentAuthority notificationCompetentAuthority)
        {
            IsNorthenIrelandCompetentAuthority = (notificationCompetentAuthority.Equals(UKCompetentAuthority.NorthernIreland) ? true : false);

            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new CustomsOfficeViewModel(transportRoute);

            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
        }
Ejemplo n.º 7
0
        public WasteCompositionBlock(IList <MergeField> mergeFields, NotificationApplication notification)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
            data = new WasteCompositionViewModel(notification.WasteType, new WasteCompositionFormatter());

            //Set annex merge fields
            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
            ((List <MergeField>)AnnexMergeFields).AddRange(MergeFieldLocator.GetAnnexMergeFields(mergeFields, Parameters));
            ((List <MergeField>)AnnexMergeFields).AddRange(MergeFieldLocator.GetAnnexMergeFields(mergeFields, Constituents));
        }
Ejemplo n.º 8
0
        public FacilityBlock(IList <MergeField> mergeFields, FacilityCollection facilityCollection)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);

            var numberOfFacilities = facilityCollection.Facilities.Count();

            data = facilityCollection.Facilities.Select(p => new FacilityViewModel(p, numberOfFacilities)).ToList();

            //The facility annex contains a set of different merge fields for facility marked as Actual Site of Treatment.
            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
            ((List <MergeField>)AnnexMergeFields).AddRange(MergeFieldLocator.GetAnnexMergeFields(mergeFields, ActualSiteOfTreatment));
        }
Ejemplo n.º 9
0
        public ProducerBlock(IList <MergeField> mergeFields, NotificationApplication notification, ProducerCollection producerCollection)
        {
            CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);

            var numberOfProducers      = producerCollection.Producers.Count();
            var processText            = notification.WasteGenerationProcess;
            var isProcessAnnexAttached = notification.IsWasteGenerationProcessAttached;

            data = producerCollection.Producers.Select(p => new ProducerViewModel(p, numberOfProducers, processText, isProcessAnnexAttached)).ToList();

            // The producers annex contains a set of different merge fields for producer marked as Site of Export.
            AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
            ((List <MergeField>)AnnexMergeFields).AddRange(MergeFieldLocator.GetAnnexMergeFields(mergeFields, SiteOfExport));
            ((List <MergeField>)AnnexMergeFields).AddRange(MergeFieldLocator.GetAnnexMergeFields(mergeFields, PoGtext));
        }
Ejemplo n.º 10
0
 public SpecialHandlingBlock(IList <MergeField> mergeFields, NotificationApplication notification)
 {
     data = new SpecialHandlingViewModel(notification);
     CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
     AnnexMergeFields         = MergeFieldLocator.GetAnnexMergeFields(mergeFields, SpecialHandling);
 }
Ejemplo n.º 11
0
 public MovementCarrierBlock(IList <MergeField> mergeFields, IEnumerable <MovementCarrier> movementCarriers)
 {
     CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
     data             = new MovementCarriersViewModel(movementCarriers.ToList());
     AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
 }