public static bool AddOrderLine(OrderLine orderLine) { using (var dboContext = new MCDBContext()) { dboContext.OrderLine.Add(orderLine); return(dboContext.SaveChanges() > 0); } return(false); }
public static bool AddStock(Stock stock) { using (var dboContext = new MCDBContext()) { dboContext.Stock.Add(stock); return(dboContext.SaveChanges() > 0); } return(false); }
public static bool AddCustomerOrder(CustomerOrder customerOrder) { using (var dboContext = new MCDBContext()) { dboContext.CustomerOrder.Add(customerOrder); return(dboContext.SaveChanges() > 0); } return(false); }
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"); }