public ProductGroupModel([NotNull] IProductGroup productGroup) { if (productGroup == null) { throw new ArgumentNullException("productGroup"); } ProductGroup = productGroup; }
private IProductData GetProductData() { int prodNumber = new Random().Next(1000000); string productNumber = "Nr_ " + prodNumber.ToString(); string productName = "My New ProductName " + productNumber; //Use Product name, if there is one. if (TextBox5.Text != "") { productName = TextBox5.Text; } IProductGroup productGroup = _session.ProductGroup.GetAll()[0]; if (productGroup == null) { throw new Exception("No productgroup found."); } IProductData product = _session.ProductData.Create(productNumber, productGroup, productName); //set sales price, as we ask for that when testing. product.SalesPrice = prodNumber; return(product); }
private static int GetDefaultModifierAmount(IReadOnlyList <ITemplatedModifierParams> modifierParams, IProductGroup modifierGroup, IProduct modifier, int generalDefaultAmount) { var specificAmount = modifierParams.SingleOrDefault(x => Equals(x.ProductGroup, modifierGroup) && Equals(x.Product, modifier)); return(specificAmount != null ? specificAmount.DefaultAmount : generalDefaultAmount); }
public static global::Umbraco.Core.Models.PublishedContent.IPublishedContent GetImage(IProductGroup that) => that.Value <global::Umbraco.Core.Models.PublishedContent.IPublishedContent>("image");
public static string GetDescription(IProductGroup that) => that.Value <string>("description");
public ProductGroupController(IProductGroup productGroupService) { _productGroupService = productGroupService; }