partial void DeleteStoreProductInventory(StoreProductInventory instance);
partial void InsertStoreProductInventory(StoreProductInventory instance);
partial void UpdateStoreProductInventory(StoreProductInventory instance);
/// <summary> /// Add or Edit StoreProductInventory /// </summary> /// <param name="product"></param> public void SaveProductInventory(StoreProductInventory proInv) { using (CostarDataContext dc = _conn.GetContext()) { if (proInv.InventoryID > 0) dc.StoreProductInventories.Attach(proInv, true); if (proInv.InventoryID == 0) { dc.StoreProductInventories.InsertOnSubmit(proInv); } dc.SubmitChanges(); } //using (CostarDataContext linq = new CostarDataContext()) //{ // if (proInv.InventoryID > 0) // { // StoreProductInventory inv = linq.StoreProductInventories.Where(c => c.InventoryID == proInv.InventoryID).SingleOrDefault(); // Common.CommonClass.CopyObjectProperty(proInv, inv); // } // else // { // linq.StoreProductInventories.InsertOnSubmit(proInv); // } // linq.SubmitChanges(); //} }