Example #1
0
 private void dgLits_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (dgLits.SelectedItem != null)
     {
         mgr.pageBack(dgLits.SelectedItem as Lit, "Lit");
     }
 }
Example #2
0
 private void dgMedecins_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (dgMedecins.SelectedItem != null)
     {
         mgr.pageBack(dgMedecins.SelectedItem as MedView, "Medecin");
     }
 }
Example #3
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (checkFields())
            {
                if (!editing)
                {
                    // Nouveau Patient
                    Patient patient = new Patient();
                    patient.Nom       = txtNom.Text;
                    patient.Prenom    = txtPrenom.Text;
                    patient.Parent    = txtParent.Text;
                    patient.BirthDate = dpDateNaiss.SelectedDate;
                    patient.Assurance = txtAssu.Text;

                    mgr.BDD.Patients.Add(patient);
                    mgr.SaveChanges();
                    MessageBox.Show("Nouveau Patient Ajouter aux Dossiers!", "Succès!", MessageBoxButton.OK);
                    mgr.pageBack();
                }
                else
                {
                    // Edition Patient
                    editPat.Nom       = txtNom.Text;
                    editPat.Prenom    = txtPrenom.Text;
                    editPat.Parent    = txtParent.Text;
                    editPat.BirthDate = dpDateNaiss.SelectedDate;
                    editPat.Assurance = txtAssu.Text;

                    mgr.SaveChanges();
                    MessageBox.Show("Modification(s) effectuée(s)!", "Succès!", MessageBoxButton.OK);
                    mgr.pageBack();
                }
            }
            else
            {
                // En cas d'erreur
                txtBoxErreur.Text = message;
                message           = String.Empty;
            }
        }
Example #4
0
 private void btnRetour_Click(object sender, RoutedEventArgs e)
 {
     mgr.pageBack();
 }