コード例 #1
0
        public bool DeleteCart(console.Models.tbl_Cart entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                context.tbl_Cart.Remove(entity);
                result = context.SaveChanges() > 1;
            }
            return(result);
        }
コード例 #2
0
        public bool UpdateCart(console.Models.tbl_Cart entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                tbl_Cart cart = (from c in context.tbl_Cart where c.cart_ref == entity.cart_ref select c).First();

                cart.cart_ref   = entity.cart_ref;
                cart.cart_total = entity.cart_total;

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