private void SetAllPropertiesToEmptyString()
        {
            FirstReg = string.Empty;
            FirstName = string.Empty;
            firstAddress = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty);
            FirstTel = string.Empty;
            FirstFax = string.Empty;
            FirstEmail = string.Empty;

            SecondReg = string.Empty;
            SecondName = string.Empty;
            secondAddress = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty);
            SecondTel = string.Empty;
            SecondFax = string.Empty;
            SecondEmail = string.Empty;

            LastReg = string.Empty;
            LastName = string.Empty;
            lastAddress = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty);
            LastTel = string.Empty;
            LastFax = string.Empty;
            LastEmail = string.Empty;

            AnnexMessage = string.Empty;
        }
 public ImporterViewModel(Importer importer)
 {
     Name = importer.Business.Name;
     address = new AddressViewModel(importer.Address);
     ContactPerson = importer.Contact.FullName;
     Telephone = importer.Contact.Telephone.ToFormattedContact();
     Fax = importer.Contact.Fax.ToFormattedContact();
     Email = importer.Contact.Email;
     RegistrationNumber = importer.Business.RegistrationNumber;
 }
 public FacilityViewModel(Facility facility, int countOfFacilities)
 {
     Name = facility.Business.Name;
     address = new AddressViewModel(facility.Address);
     ContactPerson = facility.Contact.FullName;
     Telephone = facility.Contact.Telephone.ToFormattedContact();
     Fax = facility.Contact.Fax.ToFormattedContact();
     Email = facility.Contact.Email;
     RegistrationNumber = facility.Business.RegistrationNumber;
     IsActualSite = facility.IsActualSiteOfTreatment;
     AnnexMessage = string.Empty;
     SetActualSiteOfTreatment(countOfFacilities);
 }
Exemplo n.º 4
0
        private ProducerViewModel GetProducerViewModelShowingAnnexMessagesForProducerCountGreaterThanTwo(ProducerViewModel pvm, int annexNumber)
        {
            var seeAnnexNotice = "See Annex " + annexNumber;

            pvm.AnnexMessage       = seeAnnexNotice;
            pvm.ContactPerson      = string.Empty;
            pvm.Name               = string.Empty;
            pvm.Email              = string.Empty;
            pvm.Telephone          = string.Empty;
            pvm.RegistrationNumber = string.Empty;
            pvm.address            = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty);
            pvm.Fax = string.Empty;
            pvm.SiteOfGeneration = GetSiteAndProcessText(annexNumber);

            return(pvm);
        }
        public CarrierViewModel(Carrier carrier, string meansOfTransport)
        {
            if (carrier == null)
            {
                address = new AddressViewModel(null);
                return;
            }

            if (!string.IsNullOrWhiteSpace(meansOfTransport))
            {
                MeansOfTransport = meansOfTransport;
            }

            SetBusinessFields(carrier.Business);
            SetContactFields(carrier.Contact);
            address = new AddressViewModel(carrier.Address);
        }
Exemplo n.º 6
0
        public static FacilityViewModel GetSeeAnnexInstructionForFacility(int annexNumber)
        {
            var seeAnnexNotice = "See Annex " + annexNumber;

            return(new FacilityViewModel
            {
                AnnexMessage = seeAnnexNotice,
                ContactPerson = string.Empty,
                Name = string.Empty,
                Email = string.Empty,
                Telephone = string.Empty,
                RegistrationNumber = string.Empty,
                address = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty),
                Fax = string.Empty,
                ActualSite = seeAnnexNotice
            });
        }
 public ProducerViewModel(Producer producer, int countOfProducers, string processText, bool? isIsProcessAnnexAttachedAttached)
 {
     Name = producer.Business.Name;
     address = new AddressViewModel(producer.Address);
     ContactPerson = producer.Contact.FullName;
     Telephone = producer.Contact.Telephone.ToFormattedContact();
     Fax = producer.Contact.Fax.ToFormattedContact();
     Email = producer.Contact.Email;
     RegistrationNumber = producer.Business.RegistrationNumber;
     IsSiteOfGeneration = producer.IsSiteOfExport;
     AnnexMessage = string.Empty;
     SetSiteOfGeneration(countOfProducers);
     CountOfProducers = countOfProducers;
     ProcessOfGeneration = processText ?? string.Empty;
     IsProcessAnnexAttached = isIsProcessAnnexAttachedAttached;
     DescriptionTitle = "Process of generation";
 }
Exemplo n.º 8
0
 public ProducerViewModel(Producer producer, int countOfProducers, string processText, bool?isIsProcessAnnexAttachedAttached)
 {
     Name               = producer.Business.Name;
     address            = new AddressViewModel(producer.Address);
     ContactPerson      = producer.Contact.FullName;
     Telephone          = producer.Contact.Telephone.ToFormattedContact();
     Fax                = producer.Contact.Fax.ToFormattedContact();
     Email              = producer.Contact.Email;
     RegistrationNumber = producer.Business.RegistrationNumber;
     IsSiteOfGeneration = producer.IsSiteOfExport;
     AnnexMessage       = string.Empty;
     SetSiteOfGeneration(countOfProducers);
     CountOfProducers       = countOfProducers;
     ProcessOfGeneration    = processText ?? string.Empty;
     IsProcessAnnexAttached = isIsProcessAnnexAttachedAttached;
     DescriptionTitle       = "Process of generation";
 }
Exemplo n.º 9
0
        public CarrierViewModel(Carrier carrier, string meansOfTransport)
        {
            if (carrier == null)
            {
                address = new AddressViewModel(null);
                return;
            }

            if (!string.IsNullOrWhiteSpace(meansOfTransport))
            {
                MeansOfTransport = meansOfTransport;
            }

            SetBusinessFields(carrier.Business);
            SetContactFields(carrier.Contact);
            address = new AddressViewModel(carrier.Address);
        }
Exemplo n.º 10
0
        public static CarrierViewModel GetCarrierViewModelShowingSeeAnnexInstruction(int annexNumber, string meansOfTransport)
        {
            var seeAnnexNotice = "See Annex " + annexNumber;

            return(new CarrierViewModel
            {
                AnnexMessage = seeAnnexNotice,
                ContactPerson = string.Empty,
                Name = string.Empty,
                Email = string.Empty,
                Telephone = string.Empty,
                RegistrationNumber = string.Empty,
                address = AddressViewModel.GetAddressViewModelShowingSeeAnnexInstruction(string.Empty),
                Fax = string.Empty,
                MeansOfTransport = meansOfTransport
            });
        }
 private void AddCarrierToLastFields(Carrier carrier)
 {
     LastReg = carrier.Business.RegistrationNumber;
     LastName = carrier.Business.Name;
     lastAddress = new AddressViewModel(carrier.Address);
     LastTel = carrier.Contact.Telephone.ToFormattedContact();
     LastFax = carrier.Contact.Fax.ToFormattedContact();
     LastEmail = carrier.Contact.Email;
 }
 private void AddCarrierToSecondFields(Carrier carrier)
 {
     SecondReg = carrier.Business.RegistrationNumber;
     SecondName = carrier.Business.Name;
     secondAddress = new AddressViewModel(carrier.Address);
     SecondTel = carrier.Contact.Telephone.ToFormattedContact();
     SecondFax = carrier.Contact.Fax.ToFormattedContact();
     SecondEmail = carrier.Contact.Email;
 }