public int Update <T>(T entity) { if (typeof(T) == typeof(Bought)) { return(_boughtController.Update(entity as Bought)); } if (typeof(T) == typeof(CompanyEndings)) { return(_companyEndingsController.Update(entity as CompanyEndings)); } if (typeof(T) == typeof(CompanyNames)) { return(_companyNamesController.Update(entity as CompanyNames)); } if (typeof(T) == typeof(DummyCompany)) { return(_dummyCompanyController.Update(entity as DummyCompany)); } if (typeof(T) == typeof(Merchant)) { return(_merchantController.Update(entity as Merchant)); } if (typeof(T) == typeof(Names)) { return(_namesController.Update(entity as Names)); } if (typeof(T) == typeof(Sold)) { return(_soldController.Update(entity as Sold)); } if (typeof(T) == typeof(Stock)) { return(_stockController.Update(entity as Stock)); } if (typeof(T) == typeof(StockHistory)) { return(_stockHistoryController.Update(entity as StockHistory)); } if (typeof(T) == typeof(StockMarket)) { return(_stockMarketController.Update(entity as StockMarket)); } if (typeof(T) == typeof(Surnames)) { return(_surnamesController.Update(entity as Surnames)); } if (typeof(T) == typeof(Taxes)) { return(_taxesController.Update(entity as Taxes)); } return(-1); }
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")); } } }