partial void DeletePriceList(PriceList instance);
partial void UpdatePriceList(PriceList instance);
public void UpdatePriceList(PriceListModel model) { try { PriceList table = new PriceList(); using (VenturadaDataContext vdc = new VenturadaDataContext()) { table = vdc.PriceLists.Single(a => a.PriceListId == model.PriceListId); table.ProductDescription = model.ProductDescription; table.ProductName = model.ProductName; table.Price = model.Price; vdc.SubmitChanges(); } } catch (Exception ex) { throw ex; } }
partial void InsertPriceList(PriceList instance);
public void InsertPriceList(PriceListModel model) { try { using (VenturadaDataContext vdc = new VenturadaDataContext()) { PriceList table = new PriceList(); table.ProductCategoryId = model.ProductCategoryId; table.ProductName = model.ProductName; table.ProductDescription = model.ProductDescription; table.Price = model.Price; vdc.PriceLists.InsertOnSubmit(table); vdc.SubmitChanges(); } } catch (Exception ex) { throw ex; } }