private void SetUpNewOrder() { _currentOrder = new Order(); _currentOrder.Customer = _currentCustomer; _currentOrder.Paid = false; _context.orders.Add(_currentOrder); _context.SaveChanges(); LoadCurrentOrderDetails(); }
private void SaveButton_Click(object sender, EventArgs e) { try { context.products.AddRange( ((IEnumerable <EntityF.Product>) this.productsOfCategoryBindingSource.DataSource) .Except(context.products.Local)); context.SaveChanges(); }catch (Exception exception) { Console.WriteLine(exception.ToString()); } CategoriesGridView1.Refresh(); ProductGridView.Refresh(); }