Ejemplo n.º 1
0
 public List <T> Get <T>()
 {
     if (typeof(T) == typeof(Bought))
     {
         return(_boughtController.Get() as List <T>);
     }
     if (typeof(T) == typeof(CompanyEndings))
     {
         return(_companyEndingsController.Get() as List <T>);
     }
     if (typeof(T) == typeof(CompanyNames))
     {
         return(_companyNamesController.Get() as List <T>);
     }
     if (typeof(T) == typeof(DummyCompany))
     {
         return(_dummyCompanyController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Merchant))
     {
         return(_merchantController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Names))
     {
         return(_namesController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Sold))
     {
         return(_soldController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Stock))
     {
         return(_stockController.Get() as List <T>);
     }
     if (typeof(T) == typeof(StockHistory))
     {
         return(_stockHistoryController.Get() as List <T>);
     }
     if (typeof(T) == typeof(StockMarket))
     {
         return(_stockMarketController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Surnames))
     {
         return(_surnamesController.Get() as List <T>);
     }
     if (typeof(T) == typeof(Taxes))
     {
         return(_taxesController.Get() as List <T>);
     }
     return(null);
 }
Ejemplo n.º 2
0
 private void GetLocaties()
 {
     Locaties = new ObservableCollection <LocatieDisplayInfo>(locatieController
                                                              .Get()
                                                              .Select(x => new LocatieDisplayInfo
     {
         ID   = x.Id,
         Naam = x.Naam,
         NumberOfRegistrations = registratieController.Get().Where(y => y.LocatieID == x.Id).Count(),
         IsCurrentlyActive     = registratieController.Get().Any(y => y.LocatieID == x.Id && y.EindTijd == null)
     })
                                                              .ToList());
 }
Ejemplo n.º 3
0
        internal void StopRegistratie()
        {
            var activeRegistration = registratieController.Get().Where(x => x.LocatieID == ID).FirstOrDefault(x => x.EindTijd == null);

            if (activeRegistration == null)
            {
                // valt niet te stoppen
            }
            else
            {
                activeRegistration.EindTijd = DateTime.Now;
                registratieController.Update(activeRegistration);

                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Registraties"));
                    PropertyChanged(this, new PropertyChangedEventArgs("IsStartEnabled"));
                    PropertyChanged(this, new PropertyChangedEventArgs("IsStopEnabled"));
                }
            }
        }