public ProductsCategoriesAndPhoneOrders() { this.categoryName = null; this.categoryTitle = null; this.categoryViewStyles = new CategoryViewStyle(); this.products = new List<Product>(); this.categories = new List<Category>(); this.phoneOrders = new List<PhoneOrder>(); }
public ActionResult Edit(CategoryViewStyle categoryviewstyle) { if (ModelState.IsValid) { db.CategoriesViewStyles.Attach(categoryviewstyle); db.ObjectStateManager.ChangeObjectState(categoryviewstyle, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CategoryID = new SelectList(db.Categories, "id", "Name", categoryviewstyle.CategoryID); return View(categoryviewstyle); }
public ActionResult Create(CategoryViewStyle categoryviewstyle) { if (ModelState.IsValid) { db.CategoriesViewStyles.AddObject(categoryviewstyle); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CategoryID = new SelectList(db.Categories, "id", "Name", categoryviewstyle.CategoryID); return View(categoryviewstyle); }
/// <summary> /// Create a new CategoriesViewStyle object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="backgroundImagePath">Initial value of the BackgroundImagePath property.</param> /// <param name="headerBackgroundImagePath">Initial value of the HeaderBackgroundImagePath property.</param> public static CategoryViewStyle CreateCategoriesViewStyle(global::System.Int32 id, global::System.String backgroundImagePath, global::System.String headerBackgroundImagePath) { CategoryViewStyle categoriesViewStyle = new CategoryViewStyle(); categoriesViewStyle.id = id; categoriesViewStyle.BackgroundImagePath = backgroundImagePath; categoriesViewStyle.HeaderBackgroundImagePath = headerBackgroundImagePath; return categoriesViewStyle; }
/// <summary> /// Deprecated Method for adding a new object to the CategoriesViewStyles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCategoriesViewStyles(CategoryViewStyle categoriesViewStyle) { base.AddObject("CategoriesViewStyles", categoriesViewStyle); }