Пример #1
0
 public static void update(Product product)
 {
     using (DSModel model = new DSModel())
     {
         var updateProduct = model.Products.Find(product.ProductID);
         model.Entry(updateProduct).CurrentValues.SetValues(product);
         model.SaveChanges();
     }
 }
Пример #2
0
 public static void update(Brand brand)
 {
     using (DSModel model = new DSModel())
     {
         var updateBrand = model.Brands.Find(brand.BrandID);
         model.Entry(updateBrand).CurrentValues.SetValues(brand);
         model.SaveChanges();
     }
 }
Пример #3
0
 public static void update(Category category)
 {
     using (DSModel model = new DSModel())
     {
         var updateCategory = model.Categories.Find(category.CategoryID);
         model.Entry(updateCategory).CurrentValues.SetValues(category);
         model.SaveChanges();
     }
 }
Пример #4
0
 public static void update(Supplier supplier)
 {
     using (DSModel model = new DSModel())
     {
         var updateSupplier = model.Suppliers.Find(supplier.SupplierID);
         model.Entry(updateSupplier).CurrentValues.SetValues(supplier);
         model.SaveChanges();
     }
 }
Пример #5
0
 public static void update(Import import)
 {
     using (DSModel model = new DSModel())
     {
         var updateImport = model.Imports.Find(import.ImportID);
         model.Entry(updateImport).CurrentValues.SetValues(import);
         model.SaveChanges();
     }
 }