示例#1
0
        public CategoryBase GetCategory(SqlCategory sqlc)
        {
            CategoryBase cat = null;

            cat = CategoryFactory.GetCategory(sqlc);
            return(cat);
        }
示例#2
0
        public void RemoveCategory(CategoryBase category)
        {
            Categories.Remove(category);

            //remove from DataBase
            //Procedures.RemoveCategory(category.SqlItem.Id);
        }
示例#3
0
        public ListBasic(SqlList list)
        {
            SqlItem = list;
            SqlSingleText st = Procedures.SingleTexts[list.SqlSingleText];
            SqlIconable   i  = Procedures.Iconables[list.SqlIconable];

            //SqlSingleText
            SqlSingleTextObject = st;
            Text = st.Text;

            //IIconable
            SqlIconableObject = i;
            ImageSource       = i.ImageSource;

            //ICategryStorage
            Categories = new List <CategoryBase>();
            foreach (SqlCategoryStorage s in Procedures.CategoryStorages.Values)
            {
                if (s.ListId != SqlItem.Id)
                {
                    continue;
                }
                SqlCategory  sqlc = Procedures.Categories[s.CategoryId];
                CategoryBase cat  = GetCategory(sqlc);
                Categories.Add(cat);
            }
        }
示例#4
0
        public void AddCategory(CategoryBase category)
        {
            Categories.Add(category);

            //save to DataBase
            SqlCategoryStorage scs = new SqlCategoryStorage()
            {
                ListId     = SqlItem.Id,
                CategoryId = category.SqlItem.Id
            };

            Procedures.Insert(scs);
        }