partial void DeleteProductCategory(ProductCategory instance);
partial void UpdateProductCategory(ProductCategory instance);
public void UpdateProductCategory(ProductCategoryModel pcm) { try { ProductCategory table = new ProductCategory(); using (VenturadaDataContext vdc = new VenturadaDataContext()) { table = vdc.ProductCategories.Single(a => a.ProductCategoryId == pcm.ProductCategoryId); table.ProductCategoryId = pcm.ProductCategoryId; table.ProductCategory1 = pcm.ProductCategory; vdc.SubmitChanges(); } } catch (Exception ex) { throw ex; } }
partial void InsertProductCategory(ProductCategory instance);
public void InsertProductCategory(ProductCategoryModel pcm) { try { using (VenturadaDataContext vdc = new VenturadaDataContext()) { ProductCategory receivedPM = new ProductCategory(); receivedPM.ProductCategory1 = pcm.ProductCategory; vdc.ProductCategories.InsertOnSubmit(receivedPM); vdc.SubmitChanges(); } } catch (Exception ex) { throw ex; } }