public PublicBillingApiProxy(AtomiaBillingPublicService service) { this.service = service; }
/// <summary> /// Filters the packages. /// </summary> /// <param name="controller">The controller.</param> /// <param name="atomiaBillingPublicService">The atomia billing public service.</param> /// <param name="accountId">The account id.</param> /// <param name="resellerId">The reseller id.</param> /// <param name="currencyCode">The currency code.</param> /// <param name="countryCode">The country code.</param> /// <param name="filterValue">The filter value.</param> /// <returns>Filtered list of packages.</returns> public static List<RadioRow> FilterPackages(Controller controller, AtomiaBillingPublicService atomiaBillingPublicService, Guid accountId, Guid resellerId, string currencyCode, string countryCode, string filterValue) { string languageCode = null; if (controller.HttpContext.Session != null && controller.HttpContext.Session["SessionAccountLanguages"] != null) { AtomiaCultureInfo atomiaCultureInfo = (AtomiaCultureInfo)controller.HttpContext.Session["SessionAccountLanguages"]; languageCode = atomiaCultureInfo.Language; } List<RadioRow> packages = OrderModel.FetchPackagesData(controller, resellerId, null, accountId, currencyCode, countryCode, languageCode).ToList(); if (!string.IsNullOrEmpty(filterValue)) { // get all packages from the config IList<Product> packageProducts = GetProductProvider().GetShopProducts(resellerId, null, accountId, countryCode); packages = packages.Where(rr => { Product item = packageProducts.FirstOrDefault(p => p.ArticleNumber == rr.productId); if (item == null) { return false; } string value; if (item.Properties.TryGetValue("groups", out value)) { return value .ToString() .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) .ToList() .Exists(v => v == filterValue); } return false; }).ToList(); } return packages; }
public CustomerLoginValidator(AtomiaBillingPublicService service) { this.service = service; }