示例#1
0
        public ProductGroupModel([NotNull] IProductGroup productGroup)
        {
            if (productGroup == null)
            {
                throw new ArgumentNullException("productGroup");
            }

            ProductGroup = productGroup;
        }
示例#2
0
    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);
    }
示例#3
0
        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");
示例#6
0
 public ProductGroupController(IProductGroup productGroupService)
 {
     _productGroupService = productGroupService;
 }