/* constructor and initialization */ public InterfaceCommercialViewModel(Window window, int IdGestionnaire, string Token) { _window = window; _restApiQueries = new RestApiQueries(Token); _router = new Router(); this.IdGestionnaire = IdGestionnaire; string path; path = "Gestionnaire/" + IdGestionnaire; Debug.WriteLine("Path Login : "******"Gestionnaire/" + IdGestionnaire); Debug.WriteLine("GestionnaireLogin : "******"Client/GestionnaireAssocie/" + IdGestionnaire; ClientsLiés = new ObservableCollection <Client>(_restApiQueries.GetClients(path)); // Liste des produits associés au gestionnaire path = "Produit/GestionnaireAssocie/" + IdGestionnaire; ProduitsLiés = new ObservableCollection <Produit>(_restApiQueries.GetProduit(path)); path = "Service"; Services = new ObservableCollection <Service>(_restApiQueries.GetService(path)); this.Token = Token; /* Commandes de routing */ GoToInterfaceCommercial = new RelayCommand( o => true, o => _router.GoToInterfaceCommercial(_window, IdGestionnaire, Token) ); GoToAssociationClient = new RelayCommand( o => true, o => _router.GoToAssociationClient(_window, IdGestionnaire, Token) ); GoToAjoutProduit = new RelayCommand( o => true, o => _router.GoToAjoutProduit(_window, IdGestionnaire, Token) ); GoToAjoutService = new RelayCommand( o => true, o => _router.GoToAjoutService(_window, IdGestionnaire, Token) ); GoToAjoutAbonnement = new RelayCommand( o => true, o => _router.GoToAjoutAbonnement(_window, IdGestionnaire, Token) ); GoToListeTickets = new RelayCommand( o => true, o => _router.GoToListeTicketsGestionnaire(_window, IdGestionnaire, Token) ); GoToConnexion = new RelayCommand( o => true, o => _router.GoToConnexion(_window) ); /* Commandes d'action */ RetirerClient = new RelayCommand( o => (SelectedClient != null), o => DesassociationClient() ); ModifierProduit = new RelayCommand( o => (SelectedProduit != null), o => _router.GoToModificationProduit(_window, IdGestionnaire, Token, SelectedProduit) ); SupprimerProduit = new RelayCommand( o => (SelectedProduit != null), o => RetirerUnProduit() ); ModifierService = new RelayCommand( o => (SelectedService != null), o => _router.GoToModificationService(_window, IdGestionnaire, Token, SelectedService) ); SupprimerService = new RelayCommand( o => (SelectedService != null), o => RemoveService() ); }