示例#1
0
        public void AddFeature(MenuFeatureModel menuFeatureModel)
        {
            //first get the parent
            menuFeatureModel.SelfCheck();

            MenuPath3 menuPath3 = Find(menuFeatureModel.ParentId);

            menuPath3.IsNullThrowException("menuPath3");

            MenuFeature menuFeature = MenuFeatureBiz.Find(menuFeatureModel.FeatureId);

            menuFeature.IsNullThrowException("menuFeature");

            if (menuFeature.MenuPath3s.IsNull())
            {
                menuFeature.MenuPath3s = new List <MenuPath3>();
            }

            if (menuPath3.MenuFeatures.IsNull())
            {
                menuPath3.MenuFeatures = new List <MenuFeature>();
            }

            menuFeature.MenuPath3s.Add(menuPath3);
            menuPath3.MenuFeatures.Add(menuFeature);
            SaveChanges();
        }
示例#2
0
        private void saveFeature(MenuFeatureModel menuFeatureModel)
        {
            menuFeatureModel.SelfCheck();
            MenuPath1 menuPath1 = Find(menuFeatureModel.ParentId);

            menuPath1.IsNullThrowException("menuPath1");

            MenuFeature menuFeature = MenuFeatureBiz.Find(menuFeatureModel.FeatureId);

            menuFeature.IsNullThrowException("menuFeature");

            if (menuFeature.MenuPath1s.IsNull())
            {
                menuFeature.MenuPath1s = new List <MenuPath1>();
            }

            if (menuPath1.MenuFeatures.IsNull())
            {
                menuPath1.MenuFeatures = new List <MenuFeature>();
            }

            menuFeature.MenuPath1s.Add(menuPath1);
            menuPath1.MenuFeatures.Add(menuFeature);
            SaveChanges();

            addFeatureToEveryProductWithMenuPath1(menuPath1, menuFeature);
        }
示例#3
0
        public void AddFeature(MenuFeatureModel menuFeatureModel)
        {
            //first get the parent
            menuFeatureModel.SelfCheck();

            MenuPath2 menuPath2 = Find(menuFeatureModel.ParentId);

            menuPath2.IsNullThrowException("menuPath2");

            MenuFeature menuFeature = MenuFeatureBiz.Find(menuFeatureModel.FeatureId);

            menuFeature.IsNullThrowException("menuFeature");

            if (menuFeature.MenuPath2s.IsNull())
            {
                menuFeature.MenuPath2s = new List <MenuPath2>();
            }

            if (menuPath2.MenuFeatures.IsNull())
            {
                menuPath2.MenuFeatures = new List <MenuFeature>();
            }

            menuFeature.MenuPath2s.Add(menuPath2);
            menuPath2.MenuFeatures.Add(menuFeature);
            SaveChanges();

            addFeatureToEveryProductWithMenuPath2(menuPath2, menuFeature);
        }
示例#4
0
        //public void  AddFeature(string menuPathId, Feature feature)
        //{
        //    menuPathId.IsNullOrWhiteSpaceThrowArgumentException();
        //    if (feature.IsNull())
        //        return;

        //    //get the menuItem
        //    MenuPath1 mp1 = Find(menuPathId);
        //    mp1.IsNullThrowException();

        //    mp1.Features.Add(feature);
        //    //feature.MenuPath1 = mp1;
        //    ControllerCreateEditParameter param = new ControllerCreateEditParameter();
        //    param.Entity = mp1;
        //    UpdateAndSave(param);


        //}



        public void AddFeature(MenuFeatureModel menuFeatureModel)
        {
            //first get the parent
            menuFeatureModel.SelfCheck();
            saveFeature(menuFeatureModel);
        }