Esempio n. 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ctx = new ZooDataLibrary.ZooShopEntities();

            ctx.Products.Load();
            this.productsBindingSource.DataSource = ctx.Products.Local.ToBindingList();

            ctx.AnimalKinds.Load();
            this.animalKindsBindingSource.DataSource = ctx.AnimalKinds.Local.ToBindingList();

            ctx.ProductKinds.Load();
            this.productKindsBindingSource.DataSource = ctx.ProductKinds.Local.ToBindingList();

            ctx.Providers.Load();
            this.providersBindingSource.DataSource = ctx.Providers.Local.ToBindingList();

            ctx.Citys.Load();
            this.citysBindingSource.DataSource = ctx.Citys.Local.ToBindingList();

            ctx.Orders.Load();
            this.ordersBindingSource.DataSource = ctx.Orders.Local.ToBindingList();

            ctx.Clients.Load();
            this.clientsBindingSource.DataSource = ctx.Clients.Local.ToBindingList();

            ctx.Status.Load();
            this.statusBindingSource.DataSource = ctx.Status.Local.ToBindingList();
        }
Esempio n. 2
0
        private void AddProvProd_Load(object sender, EventArgs e)
        {
            ctx = new ZooShopEntities();

            ctx.Providers.Load();
            this.providersBindingSource.DataSource = ctx.Providers.Local.ToBindingList();

            ctx.Products.Load();
            this.productsBindingSource.DataSource = ctx.Products.Local.ToBindingList();
        }
Esempio n. 3
0
        private void ProviderCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            ctx = new ZooShopEntities();
            int       prov_id  = (int)this.ProviderCB.SelectedValue;
            Providers provider = (from q in ctx.Providers where q.Id == prov_id select q).FirstOrDefault();
            var       query    = (from q in ctx.Products select q).Where(q => q.Providers.Select(w => w.Id).ToList().Contains(prov_id));

            query.Load();
            this.productsBindingSource.DataSource = ctx.Products.Local.ToBindingList();
        }