Example #1
0
        public static bool AddOrderLine(OrderLine orderLine)
        {
            using (var dboContext = new MCDBContext())
            {
                dboContext.OrderLine.Add(orderLine);
                return(dboContext.SaveChanges() > 0);
            }

            return(false);
        }
Example #2
0
        public static bool AddStock(Stock stock)
        {
            using (var dboContext = new MCDBContext())
            {
                dboContext.Stock.Add(stock);
                return(dboContext.SaveChanges() > 0);
            }

            return(false);
        }
Example #3
0
        public static bool AddCustomerOrder(CustomerOrder customerOrder)
        {
            using (var dboContext = new MCDBContext())
            {
                dboContext.CustomerOrder.Add(customerOrder);
                return(dboContext.SaveChanges() > 0);
            }

            return(false);
        }
Example #4
0
        public void AddProduct(Product product)
        {
            Console.WriteLine("Try to add a new entry in database SQLite");

            using (var dboContext = new MCDBContext())
            {
                dboContext.Product.Add(product);
                dboContext.SaveChanges();
            }

            Console.WriteLine("End");
        }