public Type( Category category, string name, string description) { this.Id = 1; this.Category = category; this.Name = name; this.Description = description; }
public Category Add(Category category) { if (!CategoryExists(category)) { Category c = function_adapter.Add(category); return c; } return category; }
public Category Add(Category category) { Category c = null; c = Transaction<Category, Category>(add, category); if (c != null) allCategories.Add(c); return c; }
public Category Add(Category category) { return AddCategory().Add(category); }
private Category add(Connection connection, Category category) { category.Id = connection.InsertCategory(category); return category; }
public List<Category> SelectAllFromCategory() { List<Category> categories = new List<Category>(); List<Dictionary<string, string>> list = null; list = SelectFrom("Category"); foreach (var row in list) { Category category = new Category(); category.Id = row["Id"].ToInt(); category.Name = row["Name"]; category.Description = row["Description"]; categories.Add(category); } return categories; }
public int InsertCategory(Category category) { string values = category.Id + @"', '" + category.Name + @"', '" + category.Description; return Insert("Category", "Id, Name, Description", values); }
public Category SelectCategory(int Id) { Category category = null; List<Dictionary<string, string>> list = null; list = SelectFrom("Category", @"Id = '" + Id + @"'"); foreach (var row in list) { category = new Category(); category.Id = row["Id"].ToInt(); category.Name = row["Name"]; category.Description = row["Description"]; break; } return category; }
public bool CategoryExists(Category category) { List<Category> categories = function_adapter.GetAllCategories(); foreach (Category item in categories) { if (item.Name.Equals(category.Name)) { return true; } } return false; }
public Category Add(Category category) { return informationAdapter.Add(category); }