private CategoryViewModel(Category category) { m_underlyingData = category; Name = m_underlyingData.name; Type = m_underlyingData.type; SeqNo = m_underlyingData.seqNo; }
public CategoryViewModel(ICategoriesManager categoriesManager, Category category) : this(category) { m_categoriesManager = categoriesManager; WatchChildren(); }
public void Update(Category cat) { string query = QueryBuilder.Update("categories", "categoryId", cat.categoryId.ToString(), GetNameColumnPair(cat.name), GetParentIdColumnPair(cat.parentId), GetTypeColumnPair(cat.type)); using (SQLiteCommand update = new SQLiteCommand(query, m_conn)) update.ExecuteNonQuery(); }
public void Delete(Category cat) { string query = QueryBuilder.Delete("categories", "categoryId", cat.categoryId.ToString()); using (SQLiteCommand delete = new SQLiteCommand(query, m_conn)) delete.ExecuteNonQuery(); }
public void Update(Category cat) { m_categories[cat.categoryId] = cat; }
public void Delete(Category cat) { m_categories.Remove(cat.categoryId); }
public long Add(string name, long parentId, CategoryType type) { Category category = new Category(name, GetNewId(), parentId, type, double.NaN); m_categories.Add(category.categoryId, category); return category.categoryId; }
public CategoryViewModel AddChildCategory(CategoryViewModel category, string name, CategoryType type) { long catId = m_database.Add(name, category.CategoryId, type); Category c = new Category(name, catId, category.CategoryId, type, double.NaN); CategoryViewModel newCategory = new CategoryViewModel(m_database, category, c); category.Children.Add(newCategory); Categories.Add(newCategory); return newCategory; }
public void Delete(Category cat) { m_categoriesManager.Delete(cat); }
public void Update(Category cat) { m_categoriesManager.Update(cat); }