Exemplo n.º 1
0
 /// <summary>
 /// Delete a customer
 /// </summary>
 public void DeleteProductGroup(ProductGroup group)
 {
     db.ProductGroup.Remove(group);
     db.SaveChanges();
     ProductGroups.Remove(group);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Check if a product group is connected to any products
        /// </summary>
        /// <param name="productGroup"></param>
        /// <returns></returns>
        public bool IsProductGroupEmpty(ProductGroup productGroup)
        {
            var query = db.Product.Where(p => p.ProductGroupID.Equals(productGroup.ProductGroupID));

            return(!query.Any());
        }
Exemplo n.º 3
0
 public void ResetProductGroup(ProductGroup productGroup)
 {
     db.Entry(productGroup).State = EntityState.Unchanged;
 }