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

            ProductGroup = productGroup;
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: minaanis/eco-api-ex
    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
ファイル: EditorTester.cs プロジェクト: vcpp/front.api.sdk
        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);
        }
コード例 #4
0
 public static global::Umbraco.Core.Models.PublishedContent.IPublishedContent GetImage(IProductGroup that) => that.Value <global::Umbraco.Core.Models.PublishedContent.IPublishedContent>("image");
コード例 #5
0
 public static string GetDescription(IProductGroup that) => that.Value <string>("description");
コード例 #6
0
 public ProductGroupController(IProductGroup productGroupService)
 {
     _productGroupService = productGroupService;
 }