Beispiel #1
0
        public void CreateNewFeature(CreateNewFeatureModel model)
        {
            model.SelfCheck();
            MenuFeature menuFeature = MenuFeatureBiz.FindByName(model.FeatureName);

            if (menuFeature.IsNull())
            {
                menuFeature = MenuFeatureBiz.Factory() as MenuFeature;
                menuFeature.IsNullThrowException("menuFeature");

                menuFeature.Name = model.FeatureName;
                MenuFeatureBiz.CreateAndSave(menuFeature);
                return;
            }
            //if you are here then the feature already exists
            ErrorsGlobal.Add(string.Format("'{0}' already exists!", model.FeatureName), MethodBase.GetCurrentMethod());
            throw new Exception(ErrorsGlobal.ToString());
        }
Beispiel #2
0
        public void CreateNewFeature(CreateNewFeatureModel model)
        {
            model.SelfCheck();
            MenuFeature menuFeature = MenuFeatureBiz.FindByName(model.FeatureName);

            if (menuFeature.IsNull())
            {
                menuFeature = MenuFeatureBiz.Factory() as MenuFeature;
                menuFeature.IsNullThrowException("menuFeature");

                menuFeature.Name = model.FeatureName;
                MenuFeatureBiz.CreateAndSave(menuFeature);
            }
            //create the new feature.

            MenuPath3 menupath3 = Find(model.ParentId);

            menupath3.IsNullThrowException("menupath3");

            //taking a short cut.
            MenuFeatureModel menuFeatureModel = new MenuFeatureModel(model.ParentId, "", menuFeature.Id, model.ReturnUrl);

            AddFeature(menuFeatureModel);
        }
Beispiel #3
0
        public void CreateNewFeature(CreateNewFeatureModel model)
        {
            model.SelfCheck();
            ProductFeature productFeature = ProductFeatureBiz.FindByName(model.FeatureName);

            if (productFeature.IsNull())
            {
                productFeature = ProductFeatureBiz.Factory() as ProductFeature;
                productFeature.IsNullThrowException("productFeature");

                productFeature.Name = model.FeatureName;
                ProductFeatureBiz.CreateAndSave(productFeature);
            }

            //create the new feature.
            Product product = Find(model.ParentId);

            product.IsNullThrowException("product");

            //taking a short cut.
            ProductFeatureModel productFeatureModel = new ProductFeatureModel(model.ParentId, "", productFeature.Id, model.ReturnUrl, model.Description);

            AddFeature(productFeatureModel);
        }