Ejemplo n.º 1
0
        public override VmWebPageChannelStep1 TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var definition = CreateEntityViewModelDefinition(entity)
                             .AddSimple(i => i.Id, o => o.Id)
                             .AddSimple(i => i.UnificRootId, o => o.UnificRootId)
                             // .AddSimpleList(i=>i.Languages.Select(x => x.LanguageId), o => o.Languages)
                             .AddSimple(input => input.PublishingStatusId, output => output.PublishingStatusId)
                             .AddLocalizable(i => i.WebpageChannels?.FirstOrDefault()?.LocalizedUrls, o => o.WebPage)
                             .AddSimple(i => i.ConnectionTypeId, o => o.ConnectionTypeId)
                             .AddCollection <ILanguageAvailability, VmLanguageAvailabilityInfo>(input => input.LanguageAvailabilities, o => o.LanguagesAvailabilities);

            definitionHelper.AddEmailsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddPhonesDefinition(definition, RequestLanguageCode);
            definitionHelper.AddLanguagesDefinition(definition);
            return(definitionHelper.AddChannelDescriptionsDefinition(definition).GetFinal());
        }
        public override VmPrintableFormChannelStep1 TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var definition = CreateEntityViewModelDefinition(entity)
                             .AddSimple(i => i.Id, o => o.Id)
                             .AddSimple(input => input.UnificRootId, outupt => outupt.UnificRootId)
                             .AddSimple(input => input.AreaInformationTypeId, outupt => outupt.AreaInformationTypeId)
                             .AddSimple(input => input.PublishingStatusId, output => output.PublishingStatusId)
                             .AddPartial(i => i.PrintableFormChannels?.FirstOrDefault())
                             .AddSimple(i => i.ConnectionTypeId, o => o.ConnectionTypeId)
                             .AddCollection <ILanguageAvailability, VmLanguageAvailabilityInfo>(input => input.LanguageAvailabilities, o => o.LanguagesAvailabilities);

            definitionHelper.AddPhonesDefinition(definition, RequestLanguageCode);
            definitionHelper.AddEmailsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAttachmentsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAllAreasDefinition(definition);

            return(definitionHelper.AddChannelDescriptionsDefinition(definition).GetFinal());
        }
Ejemplo n.º 3
0
        public override VmPhoneChannelStep1 TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var definition = CreateEntityViewModelDefinition(entity)
                             .DisableAutoTranslation()
                             .AddSimple(input => input.Id, output => output.Id)
                             .AddSimple(input => input.UnificRootId, outupt => outupt.UnificRootId)
                             .AddSimple(input => input.AreaInformationTypeId, outupt => outupt.AreaInformationTypeId)
                             .AddSimple(input => input.PublishingStatusId, output => output.PublishingStatusId)
                             .AddLocalizable(i => i.WebPages.Select(x => x.WebPage), o => o.WebPage)
                             .AddSimple(input => input.ConnectionTypeId, output => output.ConnectionTypeId)
                             .AddCollection <ILanguageAvailability, VmLanguageAvailabilityInfo>(input => input.LanguageAvailabilities, o => o.LanguagesAvailabilities);

            definitionHelper.AddLanguagesDefinition(definition);
            definitionHelper.AddEmailsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddPhonesDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAllAreasDefinition(definition);

            return(definitionHelper.AddChannelDescriptionsDefinition(definition).GetFinal());
        }
Ejemplo n.º 4
0
        public override VmElectronicChannelStep1 TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var definition = CreateEntityViewModelDefinition(entity)
                             .AddSimple(input => input.PublishingStatusId, output => output.PublishingStatusId)
                             .AddSimple(input => input.Id, outupt => outupt.Id)
                             .AddSimple(input => input.UnificRootId, outupt => outupt.UnificRootId)
                             .AddSimple(input => input.AreaInformationTypeId, outupt => outupt.AreaInformationTypeId)
                             .AddSimple(input => input.ConnectionTypeId, output => output.ConnectionTypeId)
                             .AddLocalizable(input => input.ElectronicChannels?.FirstOrDefault()?.LocalizedUrls, output => output.WebPage)
                             .AddSimple(input => input.ElectronicChannels?.FirstOrDefault()?.RequiresSignature ?? false, output => output.IsOnLineSign)
                             .AddSimple(input => input.ElectronicChannels?.FirstOrDefault()?.RequiresAuthentication ?? false, output => output.IsOnLineAuthentication)
                             .AddSimple(input => input.ElectronicChannels?.FirstOrDefault()?.SignatureQuantity ?? 0, output => output.NumberOfSigns)
                             .AddCollection <ILanguageAvailability, VmLanguageAvailabilityInfo>(input => input.LanguageAvailabilities, o => o.LanguagesAvailabilities);

            definitionHelper.AddEmailsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddPhonesDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAttachmentsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAllAreasDefinition(definition);

            return(definitionHelper.AddChannelDescriptionsDefinition(definition).GetFinal());
        }
Ejemplo n.º 5
0
        public override VmLocationChannelStep1 TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var phoneTypeId = _typesCache.Get <PhoneNumberType>(PhoneNumberTypeEnum.Phone.ToString());
            var faxTypeId   = _typesCache.Get <PhoneNumberType>(PhoneNumberTypeEnum.Fax.ToString());

            var definition = CreateEntityViewModelDefinition <VmLocationChannelStep1>(entity)
                             .AddSimple(i => i.Id, o => o.Id)
                             .AddSimple(input => input.UnificRootId, outupt => outupt.UnificRootId)
                             .AddSimple(input => input.AreaInformationTypeId, outupt => outupt.AreaInformationTypeId)
                             .AddSimple(input => input.PublishingStatusId, output => output.PublishingStatusId)
                             .AddSimple(input => input.ConnectionTypeId, output => output.ConnectionTypeId)
                             .AddPartial(input => input.ServiceLocationChannels?.FirstOrDefault())
                             .AddCollection <ILanguageAvailability, VmLanguageAvailabilityInfo>(input => input.LanguageAvailabilities, o => o.LanguagesAvailabilities);

            definitionHelper.AddEmailsDefinition(definition, RequestLanguageCode);
            definitionHelper.AddPhonesPhoneTypeDefinition(definition, RequestLanguageCode);
            definitionHelper.AddPhonesFaxTypeDefinition(definition, RequestLanguageCode);
            definitionHelper.AddLanguagesDefinition(definition);
            definitionHelper.AddWebPagesDefinition(definition, RequestLanguageCode);
            definitionHelper.AddAllAreasDefinition(definition);

            return(definitionHelper.AddChannelDescriptionsDefinition(definition).GetFinal());
        }