コード例 #1
0
ファイル: CategoriesUCVM.cs プロジェクト: eFr1t/BuzyaIssue
        public void AddSubcategory()
        {
            JobSubcategory item = new JobSubcategory();

            item.JobCategory = SelectedCategory;
            JobSubcategoryRepository.Instance.SetItem(item);

            Subcategories.Add(item);
            SelectedSubcategory = item;
        }
コード例 #2
0
        public void FilterSubcategories()
        {
            var categoryId    = SelectedCategory.Id;
            var subcategories = AllSubcategories.Where(a => a.CategoryId == categoryId).ToList();

            Subcategories.Clear();

            foreach (var item in subcategories)
            {
                Subcategories.Add(item);
            }
            ;
        }
コード例 #3
0
        void ITwentyThreeParsable.Load(System.Xml.XmlReader reader)
        {
            if (reader.LocalName != "category")
            {
                UtilityMethods.CheckParsingException(reader);
            }

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                case "name":
                    CategoryName = reader.Value;
                    break;

                case "path":
                    Path = reader.Value;
                    break;

                case "pathids":
                    PathIds = reader.Value;
                    break;

                default:
                    UtilityMethods.CheckParsingException(reader);
                    break;
                }
            }

            reader.Read();

            while (reader.LocalName == "subcat" || reader.LocalName == "group")
            {
                if (reader.LocalName == "subcat")
                {
                    var c = new Subcategory();
                    ((ITwentyThreeParsable)c).Load(reader);
                    Subcategories.Add(c);
                }
                else
                {
                    var s = new Group();
                    ((ITwentyThreeParsable)s).Load(reader);
                    Groups.Add(s);
                }
            }

            // Skip to next element (if any)
            reader.Skip();
        }
コード例 #4
0
        public async Task Init()
        {
            var categories = await _categoryService.Get <IList <CategoryDto> >();

            AllSubcategories = await _subcategoryService.Get <IList <SubcategoryDto> >();

            Categories.Clear();
            Subcategories.Clear();

            foreach (var item in categories)
            {
                Categories.Add(item);
            }
            foreach (var item in AllSubcategories)
            {
                Subcategories.Add(item);
            }
        }
コード例 #5
0
        private void SearchBySubcategoryName(string name)
        {
            Subcategories.Clear();

            if (!string.IsNullOrEmpty(name) || !string.IsNullOrWhiteSpace(name))
            {
                foreach (Category c in allSubcategories)
                {
                    if (c.Name.ToUpper().Contains(name.ToUpper()))
                    {
                        Subcategories.Add(c);
                    }
                }
            }
            else
            {
                foreach (Category c in allSubcategories)
                {
                    Subcategories.Add(c);
                }
            }
        }
コード例 #6
0
 public void SaveNewSubcategory(Subcategory model)
 {
     Subcategories.Add(model);
     SaveChanges();
 }
コード例 #7
0
ファイル: Category.cs プロジェクト: kilonet/elfam
 public virtual void AddSubCategory(Category category)
 {
     Subcategories.Add(category);
     category.Parent = this;
 }
コード例 #8
0
 public void UpdateSubcategory(Subcategory subcategory)
 {
     Subcategories.Remove(Subcategories.First(sub => sub.ID == subcategory.ID));
     Subcategories.Add(subcategory);
 }
コード例 #9
0
 public void AddSubcategory(Subcategory subcategory)
 {
     Subcategories.Add(subcategory);
 }