private void Load() { WorkProjects.Load(); WorkTasks.Load(); Bills.Load(); LoadLastBill(); }
//Method to check if everything loads correctly public void LoadComponents() { string productsErrorCode = Products.Load(); if (productsErrorCode != "") { MessageBox.Show(productsErrorCode); } string billsErrorCode = Bills.Load(); if (billsErrorCode != "") { MessageBox.Show(billsErrorCode); } string usersErrorCode = Users.Load(); if (usersErrorCode != "") { MessageBox.Show(usersErrorCode); } }
public DbSet <TEntity> SetOf <TEntity>() where TEntity : Entity { if (Accounts is IEnumerable <TEntity> ) { return(Accounts as DbSet <TEntity>); } else if (Bills is IEnumerable <TEntity> ) { Accounts.Load(); return(Bills as DbSet <TEntity>); } else if (Goods is IEnumerable <TEntity> ) { Importances.Load(); GoodTypes.Load(); return(Goods as DbSet <TEntity>); } else if (Importances is IEnumerable <TEntity> ) { return(Importances as DbSet <TEntity>); } else if (GoodTypes is IEnumerable <TEntity> ) { return(GoodTypes as DbSet <TEntity>); } else if (Users is IEnumerable <TEntity> ) { Bills.Load(); Goods.Load(); return(Users as DbSet <TEntity>); } else { throw new ArgumentException(); } }