Exemplo n.º 1
0
 partial void DeleteStoreProductInventory(StoreProductInventory instance);
Exemplo n.º 2
0
 partial void InsertStoreProductInventory(StoreProductInventory instance);
Exemplo n.º 3
0
 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();
            //}
        }