예제 #1
0
        public void Update(OrderDetails orderDetails)
        {
            var orderDetailsFromDb = _db.OrderDetails.FirstOrDefault(m => m.Id == orderDetails.Id);

            _db.OrderDetails.Update(orderDetailsFromDb);

            _db.SaveChanges();
        }
예제 #2
0
        public void Update(ProductType productType)
        {
            var productTypeObj = db.ProductType.FirstOrDefault(s => s.Id == productType.Id);

            productTypeObj.Name = productType.Name;

            db.SaveChanges();
        }
예제 #3
0
        public void Update(OrderHeader orderHeader)
        {
            var orderHeaderDb = _db.OrderHeaders.FirstOrDefault(m => m.Id == orderHeader.Id);

            _db.OrderHeaders.Update(orderHeaderDb);

            _db.SaveChanges();
        }
예제 #4
0
        public void Update(Category category)
        {
            var categoryObj = db.Category.FirstOrDefault(s => s.Id == category.Id);

            categoryObj.Name         = category.Name;
            categoryObj.DisplayOrder = category.DisplayOrder;

            db.SaveChanges();
        }
예제 #5
0
        public void Update(Catalog catalog)
        {
            var catalogObj = db.Catalog.FirstOrDefault(m => m.Id == catalog.Id);

            catalogObj.Name           = catalog.Name;
            catalogObj.CategoryId     = catalog.CategoryId;
            catalogObj.Specifications = catalog.Specifications;
            catalogObj.ProductTypeId  = catalog.ProductTypeId;
            catalogObj.Price          = catalog.Price;
            if (catalog.Image != null)
            {
                catalogObj.Image = catalog.Image;
            }
            db.SaveChanges();
        }
예제 #6
0
 public void Save()
 {
     _db.SaveChanges();
 }