Ejemplo n.º 1
0
        public void UpdateCategory(Category category)
        {
            eCommerceContext context = new eCommerceContext();

            context.Entry(category).State = System.Data.Entity.EntityState.Modified;

            context.SaveChanges();
        }
Ejemplo n.º 2
0
        public void UpdateSupplier(Supplier supplier)
        {
            eCommerceContext context = new eCommerceContext();

            context.Entry(supplier).State = System.Data.Entity.EntityState.Modified;

            context.SaveChanges();
        }
Ejemplo n.º 3
0
        public void UpdateConfiguration(Configuration configuration)
        {
            eCommerceContext context = new eCommerceContext();

            context.Entry(configuration).State = System.Data.Entity.EntityState.Modified;

            context.SaveChanges();
        }
Ejemplo n.º 4
0
        public void UpdatePromo(Promo Promo)
        {
            eCommerceContext context = new eCommerceContext();

            var exitingPromo = context.Promos.Find(Promo.ID);

            context.Entry(exitingPromo).CurrentValues.SetValues(Promo);

            context.SaveChanges();
        }
Ejemplo n.º 5
0
        public bool DeleteComment(int ID)
        {
            eCommerceContext context = new eCommerceContext();

            var comment = context.Comments.Find(ID);

            if (comment != null)
            {
                context.Entry(comment).State = System.Data.Entity.EntityState.Deleted;
            }
            return(context.SaveChanges() > 0);
        }
Ejemplo n.º 6
0
        public void UpdateConfigurationValue(string key, string value)
        {
            eCommerceContext context = new eCommerceContext();

            var configuration = context.Configurations.Find(key);

            configuration.Value = value;

            context.Entry(configuration).State = System.Data.Entity.EntityState.Modified;

            context.SaveChanges();
        }
Ejemplo n.º 7
0
        public void UpdateProduct(Product Product)
        {
            eCommerceContext context = new eCommerceContext();

            var exitingProduct = context.Products.Find(Product.ID);

            context.ProductPictures.RemoveRange(exitingProduct.ProductPictures);
            context.ProductSpecifications.RemoveRange(exitingProduct.ProductSpecifications);
            context.ProductCosts.RemoveRange(exitingProduct.ProductCosts);

            context.Entry(exitingProduct).CurrentValues.SetValues(Product);

            context.ProductPictures.AddRange(Product.ProductPictures);
            context.ProductSpecifications.AddRange(Product.ProductSpecifications);
            context.ProductCosts.AddRange(Product.ProductCosts);

            context.SaveChanges();
        }
Ejemplo n.º 8
0
 public void EditProduct(Product product)
 {
     _context.Entry(product).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
 }
Ejemplo n.º 9
0
 public void EditUpload(Upload upload)
 {
     _context.Entry(upload).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
 }
Ejemplo n.º 10
0
 public virtual void Update(TEntity Entity)
 {
     _context.Entry(Entity).State = EntityState.Modified;
 }
Ejemplo n.º 11
0
 public void EditProductOnCart(OrderDetails orderDetails)
 {
     _context.Entry(orderDetails).State = EntityState.Modified;
 }