Exemple #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            _context = new SOSMEntities();

            // Call the Load method to get the data for the given DbSet
            // from the database.
            // The data is materialized as entities. The entities are managed by
            // the DbContext instance.
            _context.Users.Load();

            // Bind the categoryBindingSource.DataSource to
            // all the Unchanged, Modified and Added Category objects that
            // are currently tracked by the DbContext.
            // Note that we need to call ToBindingList() on the
            // ObservableCollection<TEntity> returned by
            // the DbSet.Local property to get the BindingList<T>
            // in order to facilitate two-way binding in WinForms.
            this.usersBindingSource.DataSource =
                _context.Users.Local.ToBindingList();
        }
 public InterfaceToDataBaseCategoryMethods()
 {
     context = new SOSMEntities();
 }
 public InterfaceToDataBaseOrderMethods()
 {
     context = new SOSMEntities();
 }
 public InterfaceToDataBaseProductMethods()
 {
     context = new SOSMEntities();
 }