示例#1
0
        public int AddProduct(Product product)
        {
            int result = 0;

            if (_context != null)
            {
                _context.Product.Add(product);
                _context.SaveChanges();
                result = product.ProductId;
            }
            return(result);
        }
示例#2
0
        public int AddOrder(Order order)
        {
            int result = 0;

            if (_context != null)
            {
                _context.Order.Add(order);
                _context.SaveChanges();
                result = order.OrderId;
            }
            return(result);
        }