// Clic
        private void BTN_AjouterActe_Click(object sender, EventArgs e)
        {
            COMBO_Veto.Enabled        = true;
            COMBO_TypeActe.Enabled    = true;
            COMBO_LibelleActe.Enabled = true;

            TXT_Prix.Enabled = true;

            ChangementCOMBO(false, true);

            _maConsu             = MgtConsultation.AfficherTout().Find(x => x.CodeAnimal == Guid.Parse(TXT_CodeAnimal.Text) && x.CodeVeto == ((Veterinaires)COMBO_Veto.SelectedItem).CodeVeto.Value && x.DateConsultation == DateTime.Parse(DATE_Acte.Text));
            TXT_Commentaire.Text = _maConsu.Commentaire;

            if (_maConsu == null)
            {
                _maConsu                  = new Consultation();
                _maConsu.CodeAnimal       = _monAnimal.CodeAnimal.Value;
                _maConsu.CodeVeto         = _monVeto.CodeVeto.Value;
                _maConsu.Commentaire      = TXT_Commentaire.Text;
                _maConsu.DateConsultation = DateTime.Parse(DATE_Acte.Text);

                MgtConsultation.AjouterNouvelleConsu(_maConsu);
                _maConsu = MgtConsultation.AfficherTout().Find(x => x.CodeAnimal == Guid.Parse(TXT_CodeAnimal.Text) && x.CodeVeto == ((Veterinaires)COMBO_Veto.SelectedItem).CodeVeto.Value && x.DateConsultation == DateTime.Parse(DATE_Acte.Text));

                ChargementGrid();
                BTN_Supprimer_Click(null, null); // Car insère une ligne à cause de la procedure stocké
            }

            ChargementGrid();

            BTN_AjouterActe.Enabled  = false;
            BTN_AnnulerConsu.Enabled = true;
        }
예제 #2
0
        private void FormDossierMédical_Load(object sender, EventArgs e)
        {
            richTBox_Dossier.TabStop   = false;
            richTBox_Dossier.ReadOnly  = true;
            richTBox_Dossier.BackColor = Color.White;
            richTBox_Dossier.Cursor    = Cursors.Arrow;

            _consultations = MgtConsultation.GetConsultationsByAnimal(CodeAnimal);

            AfficherEntête();
            AfficherPropriétaire();
            AfficherConsultations();
        }
예제 #3
0
        /// <summary>
        /// Met à jour l'état de la Facture et de la Consultation, puis affiche le visuel de la facture
        /// </summary>
        private void BTN_Créer_Click(object sender, EventArgs e)
        {
            _factureCourante             = new Facture(new Guid(), DateTime.Now, 0);
            _factureCourante.dateConsult = _consultationCourante.dateConsultation;
            _factureCourante.nomAnimal   = _consultationCourante.nomAnimal;
            _factureCourante.nomVeto     = _consultationCourante.nomVeto;

            Guid numFacture = MgtFacture.CreateFacture(_factureCourante);

            DataGrid_Factures.DataSource = MgtConsultation.GetConsultations();

            FormFactures_Afficher frm = new FormFactures_Afficher(numFacture);

            frm.MdiParent = this.MdiParent;
            frm.Show();
            frm.BringToFront();
        }
예제 #4
0
        /// <summary>
        /// Met à Jour le commentaire de la consultation et enregistre celle-ci puis ses actes dans la Base de Données
        /// </summary>
        private void BTN_Valider_Click(object sender, EventArgs e)
        {
            if (TBox_Tatouage.Enabled && String.IsNullOrWhiteSpace(TBox_Tatouage.Text))
            {
                errorSaisie.SetError(TBox_Tatouage, "Veuillez saisir le N° du Tatouage effectué !");
                TBox_Tatouage.Focus();
            }
            else
            {
                _consultationCourante.commentaire = TBox_Commentaire.Text == null ? null : TBox_Commentaire.Text;
                Guid consultationCreee = MgtConsultation.CreateConsultation(_consultationCourante);

                foreach (Acte unActe in _consultationCourante.actes)
                {
                    unActe.numConsultation = consultationCreee;
                }

                foreach (Acte unActe in _consultationCourante.actes)
                {
                    MgtActe.CreateActe(unActe);
                }

                // Si un tatouage a été effectué et saisi, on met l'animal à jour
                if (TBox_Tatouage.Enabled && !String.IsNullOrWhiteSpace(TBox_Tatouage.Text))
                {
                    MgtAnimal.UpdateTatouage(TBox_Tatouage.Text.Trim(), _animalCourant.codeAnimal);
                }

                // Affichage du montant total de la consultation et fermeture de la fenêtre
                DialogResult result = MessageBox.Show(String.Format("Consultation terminée ! Montant Total : {0}€", TBox_Total.Text), "Enregistré", MessageBoxButtons.OK);
                if (result == DialogResult.OK)
                {
                    this.Close();
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            _maConsu.Commentaire = TXT_Commentaire.Text;

            MgtConsultation.Modifier(_maConsu);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            MgtConsultation.Supprimer(_maConsu);

            this.Close();
        }
예제 #7
0
 private void FormFactures_Load(object sender, EventArgs e)
 {
     DataGrid_Factures.DataSource = MgtConsultation.GetConsultations();
     DataGrid_Factures.Columns["nomAnimal"].DisplayIndex = 3;
 }