public virtual async Task <RecurringOrderTemplatesViewModel> CreateRecurringOrderTemplatesViewModel(CreateRecurringOrderTemplatesViewModelParam param) { if (param == null) { throw new ArgumentNullException(nameof(param)); } if (param.CultureInfo == null) { throw new ArgumentException(GetMessageOfNull(nameof(param.CultureInfo)), nameof(param)); } if (param.ProductImageInfo == null) { throw new ArgumentException(GetMessageOfNull(nameof(param.ProductImageInfo)), nameof(param)); } if (param.ProductImageInfo.ImageUrls == null) { throw new ArgumentException(GetMessageOfNull(nameof(param.ProductImageInfo.ImageUrls)), nameof(param)); } if (param.ScopeId == null) { throw new ArgumentException(GetMessageOfNull(nameof(param.ScopeId)), nameof(param)); } var vm = new RecurringOrderTemplatesViewModel { RecurringOrderTemplateViewModelList = await CreateTemplateGroupedShippingAddress(new CreateTemplateGroupedShippingAddressParam { ListOfRecurringOrderLineItems = param.ListOfRecurringOrderLineItems, CultureInfo = param.CultureInfo, ProductImageInfo = param.ProductImageInfo, BaseUrl = param.BaseUrl, CustomerId = param.CustomerId, ScopeId = param.ScopeId }).ConfigureAwait(false) }; foreach (var template in vm.RecurringOrderTemplateViewModelList) { await MapRecurringOrderLineitemFrequencyName(template, param.CultureInfo); } return(vm); }
protected virtual async Task <RecurringOrderTemplatesViewModel> CreateTemplatesViewModelAsync(CreateRecurringOrderTemplatesViewModelParam param) { if (param == null) { throw new ArgumentNullException(nameof(param)); } if (param.ListOfRecurringOrderLineItems == null) { throw new ArgumentException(ArgumentNullMessageFormatter.FormatErrorMessage(nameof(param.ListOfRecurringOrderLineItems)), nameof(param)); } param.ProductImageInfo = new ProductImageInfo { ImageUrls = await ImageService.GetImageUrlsAsync(param.ListOfRecurringOrderLineItems).ConfigureAwait(false), }; var methodDisplayNames = await LookupService.GetLookupDisplayNamesAsync(new GetLookupDisplayNamesParam { CultureInfo = param.CultureInfo, LookupType = LookupType.Order, LookupName = "PaymentMethodType", }); param.PaymentMethodDisplayNames = methodDisplayNames; var vm = await RecurringOrderTemplateViewModelFactory.CreateRecurringOrderTemplatesViewModel(param); return(vm); }