Пример #1
0
        public virtual ActionResult UpdateCategoryAttributeOption(int categoryAttributeId, CategoryAttributeOption updatedOption)
        {
            var categoryAttribute = Repository.Category.GetCategoryAttribute(categoryAttributeId);

            var option = categoryAttribute.Options.Single(o => o.Id == updatedOption.Id);
            option.Value = updatedOption.Value;
            option.PriceModifier = updatedOption.PriceModifier;
            Repository.Category.UpdateCategoryAttribute(categoryAttribute);

            var model = Mapper.Map<CategoryAttributeForm>(categoryAttribute);
            return PartialView(MVC.Administration.Views._CategoryAttributeOptionsList, model);
        }
Пример #2
0
        public virtual ActionResult AddCategoryAttributeOption(int categoryAttributeId, CategoryAttributeOption option)
        {
            var categoryAttribute = Repository.Category.GetCategoryAttribute(categoryAttributeId);
            categoryAttribute.Options.Add(option);
            Repository.Category.UpdateCategoryAttribute(categoryAttribute);

            var model = Mapper.Map<CategoryAttributeForm>(categoryAttribute);
            return PartialView(MVC.Administration.Views._CategoryAttributeOptionsList, model);
        }
Пример #3
0
        private static void AddScienceAtrributesSet(System.Collections.Generic.ICollection<CategoryAttribute> attributes)
        {
            var foreignLanguage = new CategoryAttributeOption { Value = "Język obcy" };

            var childForeignLanguage = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Język obcy",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Angielski"},
                        new CategoryAttributeOption {Value = "Niemiecki"},
                        new CategoryAttributeOption {Value = "Rosyjski"},
                        new CategoryAttributeOption {Value = "Francuski"},
                        new CategoryAttributeOption {Value = "Hiszpański"},
                        new CategoryAttributeOption {Value = "Włoski"},
                        new CategoryAttributeOption {Value = "Chiński"},
                        new CategoryAttributeOption {Value = "Japoński"},
                        new CategoryAttributeOption {Value = "Portugalski"},
                    },
                ParentOptions = { foreignLanguage }
            };

            var childLevel = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Poziom",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Początkujący"},
                        new CategoryAttributeOption {Value = "Średniozaawansowany"},
                        new CategoryAttributeOption {Value = "Zaawansowany"},
                        new CategoryAttributeOption {Value = "Profesjonalny"},
                    },
                ParentOptions = { foreignLanguage }
            };

            var typeChoices = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Importance = Importance.High,
                Name = "Dziedzina",
                Options =
                    {
                        new CategoryAttributeOption {Value = "Matematyka"},
                        new CategoryAttributeOption {Value = "Chemia"},
                        new CategoryAttributeOption {Value = "Informatyka"},
                        new CategoryAttributeOption {Value = "Język polski"},
                        foreignLanguage,
                        new CategoryAttributeOption {Value = "Biologia"},
                        new CategoryAttributeOption {Value = "Wychowanie fizyczne"},
                        new CategoryAttributeOption {Value = "Anatomia"},
                        new CategoryAttributeOption {Value = "Astronomia"},
                        new CategoryAttributeOption {Value = "Ekologia"},
                        new CategoryAttributeOption {Value = "Fizyka"},
                        new CategoryAttributeOption {Value = "Geografia"},
                        new CategoryAttributeOption {Value = "Geologia"},
                        new CategoryAttributeOption {Value = "Medycyna"},
                        new CategoryAttributeOption {Value = "Mechanika"},
                        new CategoryAttributeOption {Value = "Meteorologia"},
                        new CategoryAttributeOption {Value = "Przyroda"},
                        new CategoryAttributeOption {Value = "Technika"},
                        new CategoryAttributeOption {Value = "WOS"},
                        new CategoryAttributeOption {Value = "Filozofia"},
                        new CategoryAttributeOption {Value = "Historia"},
                    }
            };

            typeChoices.ChildAttributes.Add(childForeignLanguage);
            typeChoices.ChildAttributes.Add(childLevel);
            attributes.Add(typeChoices);

        }
Пример #4
0
        private static void AddAboutMeAtrributesSet(System.Collections.Generic.ICollection<CategoryAttribute> attributes)
        {
            var personalDevelopment = new CategoryAttributeOption {Value = "Rozwój osobisty"};

            var childPersonalDevelopment = new CategoryAttribute
            {
                Type = CategoryAttributeType.MultiSelect,
                Name = "Rozwój osobisty",
                Importance = Importance.Highest,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Nauka języków"},
                        new CategoryAttributeOption {Value = "Coaching"},
                        new CategoryAttributeOption {Value = "Szkolenia"},
                    },
                ParentOptions = { personalDevelopment }
            }; 

            var topicChoices = new CategoryAttribute
            {
                Type = CategoryAttributeType.MultiSelect,
                Name = "Temat",
                Importance = Importance.Highest,
                Options = {
                        personalDevelopment,
                        new CategoryAttributeOption {Value = "Wygląd (Uroda i Styl)"},
                        new CategoryAttributeOption {Value = "Praca i kariera"},
                        new CategoryAttributeOption {Value = "Sny"},
                        new CategoryAttributeOption {Value = "Religia"},
                        new CategoryAttributeOption {Value = "Magia"},
                        new CategoryAttributeOption {Value = "Problemy"},
                        new CategoryAttributeOption {Value = "Wydarzenia paranormalne"},
                    }
            };

            topicChoices.ChildAttributes.Add(childPersonalDevelopment);
            attributes.Add(topicChoices);

            attributes.Add(new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Importance = Importance.High,
                Name = "Wiek",
                Options =
                    {
                        new CategoryAttributeOption {Value = "0-12"},
                        new CategoryAttributeOption {Value = "12-18"},
                        new CategoryAttributeOption {Value = "18-24"},
                        new CategoryAttributeOption {Value = "24-35"},
                        new CategoryAttributeOption {Value = "35-55"},
                        new CategoryAttributeOption {Value = "55-75"},
                        new CategoryAttributeOption {Value = "75 i wzwyż"},
                    }
            });

            attributes.Add(new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Płeć",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Kobieta"},
                        new CategoryAttributeOption {Value = "Mężczyzna"}
                    }
            });
        }
Пример #5
0
        private static void AddAnimalsAndVeterinaryAtrributesSet(System.Collections.Generic.ICollection<CategoryAttribute> attributes)
        {
            var smallMammals = new CategoryAttributeOption {Value = "Małe ssaki"};

            var childSmallMammals = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Małe ssaki",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Chomiki"},
                        new CategoryAttributeOption {Value = "Króliki"},
                        new CategoryAttributeOption {Value = "Świnki morskie"},
                        new CategoryAttributeOption {Value = "Inne"},
                    },
                ParentOptions = {smallMammals}
            };

            var animalChoices = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Gatunek zwierzęcia",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Psy"},
                        new CategoryAttributeOption {Value = "Koty"},
                        new CategoryAttributeOption {Value = "Ryby"},
                        smallMammals,
                        new CategoryAttributeOption {Value = "Gady"},
                        new CategoryAttributeOption {Value = "Płazy"},
                        new CategoryAttributeOption {Value = "Ptaki"},
                        new CategoryAttributeOption {Value = "Konie"},
                        new CategoryAttributeOption {Value = "Inne"},
                    }
            };

            animalChoices.ChildAttributes.Add(childSmallMammals);
            attributes.Add(animalChoices);
        }
Пример #6
0
        private static void AddAutomotiveAtrributesSet(System.Collections.Generic.ICollection<CategoryAttribute> attributes)
        {
            var specialVehicles = new CategoryAttributeOption {Value = "Pojazdy specjalne"};

            var childSpecialVehicles = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Pojazdy specjalne",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Traktory"},
                        new CategoryAttributeOption {Value = "Kombajny"},
                        new CategoryAttributeOption {Value = "Dźwigi"}
                    },
                ParentOptions = {specialVehicles}
            };

            var vehicleChoices = new CategoryAttribute
            {
                Type = CategoryAttributeType.SingleSelect,
                Name = "Rodzaj pojazdu",
                Importance = Importance.High,
                Options =
                    {
                        new CategoryAttributeOption {Value = "Samochody"},
                        new CategoryAttributeOption {Value = "Motocykle"},
                        new CategoryAttributeOption {Value = "Autobusy"},
                        specialVehicles,
                    }
            };

            vehicleChoices.ChildAttributes.Add(childSpecialVehicles);
            attributes.Add(vehicleChoices);
        }