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

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

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

            return(false);
        }
Beispiel #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");
        }