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(); } }
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(); } }
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(); } }
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(); } }
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(); } }