Ejemplo n.º 1
0
 /// <summary>
 /// Tentative d'archivage du Client courant
 /// </summary>
 private void BTN_SupprimerClient_Click(object sender, EventArgs e)
 {
     // Vérifie si le client a des factures impayées
     if (!MgtClient.GetFacturesImpayees(ClientCourant.codeClient))
     {
         // Si non, on tente d'archiver le Client ainsi que ses animaux
         try
         {
             MgtClient.DeleteClient(ClientCourant);
             MgtAnimal.DeleteAnimalByClient(ClientCourant);
             Reset();
             if (IndiceCourant == -1)
             {
                 IndiceCourant = 0;
             }
             else if (IndiceCourant >= MgtClient.GetClients().Count)
             {
                 IndiceCourant = MgtClient.GetClients().Count - 1;
             }
             else
             {
                 IndiceCourant = IndiceCourant;
             }
         }
         catch (Exception)
         {
             MessageBox.Show("Erreur lors de la suppression du Client...");
         }
     }
     else
     {
         MessageBox.Show("Suppression impossible : Le Client a des factures impayées !");
     }
 }
Ejemplo n.º 2
0
        private void LoadContent()
        {
            CBox_Client.DataSource    = MgtClient.GetClients();
            CBox_Client.DisplayMember = "nomPrenom";

            CBox_Animal.DataSource    = MgtAnimal.GetAnimalsByClient(((Client)CBox_Client.SelectedItem).codeClient);
            CBox_Animal.DisplayMember = "Nom";

            CBox_Vétérinaire.DataSource    = MgtVeterinaire.GetVeterinaires();
            CBox_Vétérinaire.DisplayMember = "NomVeto";
            CBox_Vétérinaire.SelectedIndex = -1;

            DataGrid_RDV.DataSource = MgtRendezVous.GetAgendaByDate(DTPicker_Date.Value);

            #region Mise en Forme de la Grille

            AffichageUrgences();

            DataGrid_RDV.DefaultCellStyle.Font = new Font("Cambria", 12);
            DataGrid_RDV.ColumnHeadersDefaultCellStyle.Font         = new Font("Cambria", 12);
            DataGrid_RDV.Columns["dateRDV"].DefaultCellStyle.Format = "HH:mm";

            DataGrid_RDV.Columns["Urgence"].Visible = false;

            DataGrid_RDV.Columns["dateRDV"].DisplayIndex   = 0;
            DataGrid_RDV.Columns["nomAnimal"].DisplayIndex = 2;
            DataGrid_RDV.Columns["nomVeto"].DisplayIndex   = 3;

            #endregion
        }
        private void FormSelection_Animal_Load(object sender, EventArgs e)
        {
            CBox_Client.DataSource    = MgtClient.GetClients();
            CBox_Client.DisplayMember = "nomPrenom";

            CBox_Animal.DataSource    = MgtAnimal.GetAnimalsByClient(((Client)CBox_Client.SelectedItem).codeClient);
            CBox_Animal.DisplayMember = "Nom";
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Recherche dans la liste des Clients de la première occurence correspondante à la recherche saisie
        /// </summary>
        private void BTN_Rechercher_Click(object sender, EventArgs e)
        {
            bool isTrouve = false;

            foreach (Client unClient in MgtClient.GetClients())
            {
                if ((unClient.nomClient.ToLower().Contains(TBox_Recherche.Text.Trim().ToLower()) || unClient.prenomClient.ToLower().Contains(TBox_Recherche.Text.Trim().ToLower())) && isTrouve == false)
                {
                    isTrouve       = true;
                    _clientCourant = unClient;
                    AfficherClientCourant();
                }
            }
            if (!isTrouve)
            {
                MessageBox.Show("Aucun Client ne corespond à vos critères de recherche !");
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Évenement de navigation de la NavBarre
        /// </summary>
        private void NavBarre_Navigation(object sender, ControlsLibrary.NavBarEventArgs e)
        {
            switch (e.NavAction)
            {
            case ControlsLibrary.NavBar.NavActionEnum.suivant:
                IndiceCourant += 1;
                break;

            case ControlsLibrary.NavBar.NavActionEnum.precedent:
                IndiceCourant -= 1;
                break;

            case ControlsLibrary.NavBar.NavActionEnum.premier:
                IndiceCourant = 0;
                break;

            case ControlsLibrary.NavBar.NavActionEnum.dernier:
                IndiceCourant = MgtClient.GetClients().Count - 1;
                break;
            }
        }