Ejemplo n.º 1
0
        private void cancelOrderButton_Click(object sender, EventArgs e)
        {
            prodContext.Dispose();
            prodContext = new ProdContext();

            prodContext.Categories.Load();
            prodContext.Products.Load();
            prodContext.Orders.Load();
            prodContext.Orders.Local.Clear();

            this.orderBindingSource.DataSource    = prodContext.Orders.Local.Where(ord => ord.CompanyName == companyName).ToList();
            this.categoryBindingSource.DataSource = prodContext.Categories.Local.ToBindingList();
            this.productBindingSource.DataSource  = (from prod in prodContext.Products
                                                     where prod.CategoryID == currentCategoryID
                                                     select prod).ToList();

            this.totalPrice           = 0;
            this.totalPriceLabel.Text = Convert.ToString(this.totalPrice);
        }
Ejemplo n.º 2
0
 private void ChooseCustomer_FormClosed(object sender, FormClosedEventArgs e)
 {
     prodContext.Dispose();
 }