Beispiel #1
0
        public void CreateBinaryCodeScheme()
        {
            if (FindBinaryCodeScheme != null)
            {
                return;
            }

            CodeScheme codeScheme = new CodeScheme();

            codeScheme.Title = Resources.SelectUnselect;

            CategoryScheme categoryScheme = new CategoryScheme();

            categoryScheme.Title = codeScheme.Title;

            Category selectedCategory = new Category();

            selectedCategory.Title            = Resources.Select;
            selectedCategory.CategorySchemeId = categoryScheme.Id;

            Category unselectedCategory = new Category();

            unselectedCategory.Title            = Resources.Unselect;
            unselectedCategory.CategorySchemeId = categoryScheme.Id;

            categoryScheme.Categories.Add(selectedCategory);
            categoryScheme.Categories.Add(unselectedCategory);

            Code selectedCode = new Code();

            selectedCode.Value        = EDOConstants.SELECTED_CODE_VALUE;
            selectedCode.CategoryId   = selectedCategory.Id;
            selectedCode.CodeSchemeId = codeScheme.Id;
            codeScheme.Codes.Add(selectedCode);

            Code unselectedCode = new Code();

            unselectedCode.Value        = EDOConstants.UNSELECTED_CODE_VALUE;
            unselectedCode.CategoryId   = unselectedCategory.Id;
            unselectedCode.CodeSchemeId = codeScheme.Id;
            codeScheme.Codes.Add(unselectedCode);


            CategorySchemes.Insert(0, categoryScheme);
            CodeSchemes.Insert(0, codeScheme);

            BinaryCodeSchemeId     = codeScheme.Id;
            BinaryCategorySchemeId = categoryScheme.Id;
        }
Beispiel #2
0
 public bool Contains(CodeSchemeVM codeScheme)
 {
     return(CodeSchemes.Contains(codeScheme));
 }