Example #1
0
        /* constructor and initialization */
        public ModifierProduitViewModel(Window window, int IdGestionnaire, string Token, Produit produit)
        {
            _window = window;

            _restApiQueries = new RestApiQueries(Token);

            _router = new Router();

            this.IdGestionnaire = IdGestionnaire;

            this.Token = Token;


            /* Initilisation des valeurs de base du produit */
            IdProduit          = produit.ArticleId;
            NomProduit         = produit.Nom;
            DescriptionProduit = produit.Description;
            PrixProduit        = produit.Prix;
            ImageProduit       = produit.Image;
            TypeProduit        = produit.Type;
            ManuelProduit      = produit.Manuel;
            FabricantProduit   = produit.Fabricant;
            QuantiteProduit    = produit.Quantite;
            CapaciteProduit    = produit.Capacite;


            /* 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)
                );

            /* Boutons */
            ModifierProduitCommand = new RelayCommand(
                o => isValid_produit(),
                o => ModifierProduit()
                );
        }
Example #2
0
        /* constructor and initialization */
        public AjoutAbonnementViewModel(Window window, int IdGestionnaire, string Token)
        {
            _window = window;

            _restApiQueries = new RestApiQueries(Token);

            _router = new Router();

            this.IdGestionnaire = IdGestionnaire;


            this.Token = Token;

            // Liste des abonnements
            string path = "Abonnement";

            Abonnements = new ObservableCollection <Abonnement>(_restApiQueries.GetAbonnements(path));



            /* 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)
                );

            /* Boutons */
            AjouterAbonnementCommand = new RelayCommand(
                o => isValid_abonnement(),
                o => AjoutAbonnement()
                );
        }