Example #1
0
        public bool DeleteCategory(console.Models.tblProductCategory entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                context.tblProductCategories.Remove(entity);
                result = context.SaveChanges() > 1;
            }
            return(result);
        }
Example #2
0
        public bool UpdateCategory(console.Models.tblProductCategory entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                tblProductCategory cat = (from c in context.tblProductCategories where c.category_id == entity.category_id select c).First();

                cat.product_category = entity.product_category;

                result = context.SaveChanges() > 1;
            }
            return(result);
        }