Exemplo n.º 1
0
        public static void AfficherFacture(Admission patientSortant)
        {
            double television = Facture.CalculerTotalTelevision(patientSortant);
            double telephone  = Facture.CalculerTotalTelephone(patientSortant);
            double chambre    = Facture.CalculerTotalChambre(patientSortant);

            MessageBox.Show("Le prix total du sejour est de " + (chambre + television + telephone) + "$" + " pour un sejour de " + Facture.CalculerNombreJours(patientSortant) + " jours." +
                            "\n ---------------------------------------------" +
                            "\n Détail facture : " +
                            "\n Location chambre : " + chambre + "$" +
                            "\n Location television : " + television + "$" +
                            "\n Location telephone : " + telephone + "$");
        }
Exemplo n.º 2
0
        private void ConfirmerSortie_Click(object sender, RoutedEventArgs e)
        {
            Admission patientSortant = cboxNSS.SelectedItem as Admission;

            patientSortant.Lit.occupe = false;

            if (datePickerSortie.SelectedDate != null)
            {
                if (!(datePickerSortie.SelectedDate < patientSortant.dateAdmission))
                {
                    patientSortant.dateConge = datePickerSortie.SelectedDate;
                    if (MessageBox.Show("Confirmez-vous la sortie de ce patient?", "Confirmation Sortie", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                    {
                        try
                        {
                            MainWindow.myBdd.SaveChanges();
                            MessageBox.Show("Sortie du patient confirmée", "Sortie", MessageBoxButton.OK, MessageBoxImage.Information);
                            Facture.AfficherFacture(patientSortant);
                            cboxNSS.DataContext = (from p in MainWindow.myBdd.Admissions
                                                   where p.dateConge == null
                                                   select p).ToList();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Il ne reste plus de patient à congédier", "Sortie Patient", MessageBoxButton.OK, MessageBoxImage.Information);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("La date de sortie ne peut pas être antérieure à la date d'admission", "Date de sortie", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("Une date de sortie doit être fournie", "Date de sortie", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }