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()); }
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()); }
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()); }
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()); }