Beispiel #1
0
 public Product Add(Product e)
 {
     UpdateCategory(e);
     DB.Products.AddObject(e);
     Save();
     return e;
 }
Beispiel #2
0
        public Product Update(Product e)
        {
            DB.Products.Attach(e);
            UpdateCategory(e);
            DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified);
            Save();

            return e;
        }
Beispiel #3
0
 public void UpdateCategory(Product e)
 {
     CategoryRepository catRepository = new CategoryRepository();
     catRepository.Set3LevelByFullname(e.NewCategoryFullName, e.UpdateCategory);
 }
Beispiel #4
0
 public void Delete(Product e)
 {
     DB.Products.DeleteObject(e);
     Save();
 }
Beispiel #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProducts(Product product)
 {
     base.AddObject("Products", product);
 }
Beispiel #6
0
 /// <summary>
 /// Create a new Product object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static Product CreateProduct(global::System.Int32 id)
 {
     Product product = new Product();
     product.ID = id;
     return product;
 }