public CategoryBase GetCategory(SqlCategory sqlc) { CategoryBase cat = null; cat = CategoryFactory.GetCategory(sqlc); return(cat); }
public void RemoveCategory(CategoryBase category) { Categories.Remove(category); //remove from DataBase //Procedures.RemoveCategory(category.SqlItem.Id); }
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); } }
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); }