private void AssigneADepartement(Admission admission) { //Assigne Patients en Chirurgie si lits dispo, sinon autorise assignation dans autre département if (chckChirurgie.IsChecked == true) { cboxDepartement.SelectedIndex = 11; cboxDepartement.ToolTip = "Un patient avec une chirurgie programmée est automatiquement assigné en Chirurgie"; if (RequeteLitLibreChirurgie().Count > 0) { cboxDepartement.IsEnabled = false; } } //Assigne patients de moins de 16 ans sans chirurgie en Pediatrie else if (Validation.IsEnfant(((Patient)cboxNSS.SelectedItem).dateNaissance) && chckChirurgie.IsChecked == false) { cboxDepartement.SelectedIndex = 10; cboxDepartement.IsEnabled = false; cboxDepartement.ToolTip = "Un patient de moins de 16 sans chirurgie est automatiquement assigné en pédiatrie"; chckChoixLit.IsEnabled = true; } else { cboxDepartement.IsEnabled = true; cboxDepartement.ToolTip = "Choisissez le département où assigner le patient"; chckChoixLit.IsEnabled = false; } }
public static double CalculerTotalTelevision(Admission patientSortant) { if (patientSortant.televiseur) { return(CalculerNombreJours(patientSortant) * PRIX_TELE); } else { return(0); } }
public static double CalculerTotalTelephone(Admission patientSortant) { if (patientSortant.telephone) { return(CalculerNombreJours(patientSortant) * PRIX_PHONE); } else { return(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 + "$"); }
private void cboxNSS_SelectionChanged(object sender, SelectionChangedEventArgs e) { Admission afficheAdmis = (Admission)cboxNSS.SelectedItem; txtBoxNom.Text = afficheAdmis.Patient.nom; txtBoxPrenom.Text = afficheAdmis.Patient.prenom; txtBoxDOB.Text = afficheAdmis.Patient.dateNaissance.ToShortDateString(); txtBoxAdresse.Text = afficheAdmis.Patient.adresse; txtBoxVille.Text = afficheAdmis.Patient.ville; txtBoxProvince.Text = afficheAdmis.Patient.province; txtBoxCodePostal.Text = afficheAdmis.Patient.codePostal; txtBoxTelephone.Text = afficheAdmis.Patient.telephone; txtBoxAdmission.Text = afficheAdmis.dateAdmission.ToShortDateString(); }
public static double CalculerTotalChambre(Admission patientSortant) { double nombreJours = CalculerNombreJours(patientSortant); if (patientSortant.Lit.IDType == 2) { if (patientSortant.litInferieurDispo) { return(PRIX_LIT_SEMIPRIVE * nombreJours); } } else if (patientSortant.Lit.IDType == 3) { if (patientSortant.litInferieurDispo) { return(PRIX_LIT_PRIVE * nombreJours); } } return(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); } }
public static double CalculerNombreJours(Admission patientSortant) { return(((TimeSpan)(patientSortant.dateConge - patientSortant.dateAdmission)).TotalDays); }