Exemplo n.º 1
0
        private void saveFeature(ProductFeatureModel productFeatureModel)
        {
            productFeatureModel.SelfCheck();

            Product product = Find(productFeatureModel.ParentId);

            product.IsNullThrowException("product");

            MenuFeature menuFeature = MenuFeatureBiz.Find(productFeatureModel.MenuFeatureId);

            menuFeature.IsNullThrowException("Menu feature not found.");

            //create a new product Feature and add it
            ProductFeature productFeature = ProductFeatureBiz.Factory() as ProductFeature;

            productFeature.ProductId     = product.Id;
            productFeature.MenuFeatureId = menuFeature.Id;
            productFeature.Comment       = productFeatureModel.Description;
            productFeature.Name          = menuFeature.FullName();

            product.ProductFeatures.Add(productFeature);
            SaveChanges();
        }
Exemplo n.º 2
0
 public void AddFeature(ProductFeatureModel productFeatureModel)
 {
     //first get the parent
     productFeatureModel.SelfCheck();
     saveFeature(productFeatureModel);
 }