コード例 #1
0
 private void SetUpNewOrder()
 {
     _currentOrder          = new Order();
     _currentOrder.Customer = _currentCustomer;
     _currentOrder.Paid     = false;
     _context.orders.Add(_currentOrder);
     _context.SaveChanges();
     LoadCurrentOrderDetails();
 }
コード例 #2
0
        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();
        }