Example #1
0
 public AccueilPrepose(employe emp)
 {
     InitializeComponent();
     patientTrouver = new List <patient>();
     dgPatientTrouver.DataContext = patientTrouver;
     cetEmploye = emp;
 }
Example #2
0
 public Commentaires(patient patient, employe emp)
 {
     InitializeComponent();
     cePatient      = patient;
     cetEmploye     = emp;
     lblNom.Content = cePatient.prenom + " " + cePatient.nom;
 }
Example #3
0
 public nouvelleAdmission(patient patient, employe emp)
 {
     InitializeComponent();
     cePatient  = patient;
     cetEmploye = emp;
     dateAdmission.SelectedDate = DateTime.Now;
     chargementInfoLabel(cePatient);
     populateCombobox();
 }
Example #4
0
 private void btnModifier_Click(object sender, RoutedEventArgs e)
 {
     if (dgEmployes.SelectedItem != null)
     {
         employe      sEmp     = (employe)dgEmployes.SelectedItem;
         FicheEmploye modifEmp = new FicheEmploye(sEmp);
         modifEmp.ShowDialog();
         actualiser();
     }
 }
Example #5
0
 public AccueilAdmin(employe emp)
 {
     InitializeComponent();
     cetEmploye    = emp;
     listeEmployes = new ObservableCollection <employe>();
     using (NorthenLightsHopitalEntities db = new NorthenLightsHopitalEntities())
     {
         cbxRole.DataContext = db.roles.ToList();
     }
     dgEmployes.DataContext = listeEmployes;
 }
        public FicheEmploye(employe emp)
        {
            InitializeComponent();
            cetEmploye          = emp;
            cbxRole.DataContext = db.roles.ToList();

            txtNom.Text           = emp.nom;
            txtPrenom.Text        = emp.prenom;
            txtUsername.Text      = emp.nom_utilisateur;
            txtPasswd.Password    = emp.mot_passe;
            cbxRole.SelectedIndex = emp.id_role - 1;
        }
 private void btnValider_Click(object sender, RoutedEventArgs e)
 {
     if (champsRemplis())
     {
         try
         {
             if (cetEmploye != null)
             {
                 //employe empAModif = db.employes
                 //    .Where(emp => emp.id == cetEmploye.id)
                 //    .FirstOrDefault();
                 employe empAModif = cetEmploye;
                 empAModif.nom             = txtNom.Text;
                 empAModif.prenom          = txtPrenom.Text;
                 empAModif.nom_utilisateur = txtUsername.Text;
                 empAModif.mot_passe       = txtPasswd.Password;
                 empAModif.id_role         = (int)cbxRole.SelectedValue;
                 db.Entry(empAModif).State = System.Data.Entity.EntityState.Modified;
                 db.SaveChanges();
                 MessageBox.Show("Modification reussi!", "succes"
                                 , MessageBoxButton.OK, MessageBoxImage.Exclamation);
                 this.Close();
             }
             else
             {
                 employe nouvelEmploye = new employe
                 {
                     nom             = txtNom.Text,
                     prenom          = txtPrenom.Text,
                     nom_utilisateur = txtUsername.Text,
                     mot_passe       = txtPasswd.Password,
                     id_role         = (int)cbxRole.SelectedValue
                 };
                 db.employes.Add(nouvelEmploye);
                 db.SaveChanges();
                 MessageBox.Show("Ajout reussi!", "succes"
                                 , MessageBoxButton.OK, MessageBoxImage.Exclamation);
                 this.Close();
             }
         }catch (Exception ex)
         {
             MessageBox.Show("Une erreur s'est produite : \n" +
                             ex.Message.ToString(), "Attention"
                             , MessageBoxButton.OK, MessageBoxImage.Error);
             this.Close();
         }
     }
 }
Example #8
0
        public AccueilMedecin(employe emp)
        {
            InitializeComponent();
            employe                  = emp;
            patientInfo              = new ObservableCollection <View_dossier_nom_prenom>();
            patientHistorique        = new ObservableCollection <View_nom_medecin>();
            dgHistorique.DataContext = patientHistorique;
            dgPatients.DataContext   = patientInfo;
            lblGreeting.Content      = "Bonjour, " + emp.prenom.TrimEnd() + " " + emp.nom.Trim();


            using (db = new NorthenLightsHopitalEntities())
            {
                cboPatient.DataContext = db.View_dossier_nom_prenom
                                         .Where(pat => pat.id_medecin == employe.id)
                                         .GroupBy(pat => pat.id_client)
                                         .Select(pati => pati.FirstOrDefault())
                                         .ToList();
            }
        }
Example #9
0
 private void btnSupprimer_Click(object sender, RoutedEventArgs e)
 {
     if (dgEmployes.SelectedItem != null)
     {
         employe employeSel = dgEmployes.SelectedItem as employe;
         var     result     = MessageBox.Show("Voulez-vous vraiment supprimer cet usager ?", "Attention"
                                              , MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
         if (result == MessageBoxResult.Yes)
         {
             using (NorthenLightsHopitalEntities db = new NorthenLightsHopitalEntities())
             {
                 var empASup = db.employes
                               .Where(emp => emp.id == employeSel.id)
                               .FirstOrDefault();
                 if (empASup != null)
                 {
                     db.employes.Remove(empASup);
                     db.SaveChanges();
                 }
             }
         }
         actualiser();
     }
 }
Example #10
0
 private void btnValider_Click(object sender, RoutedEventArgs e)
 {
     if (cbxDepartement.SelectedItem != null &&
         cbxMedecin.SelectedItem != null &&
         cbxRaisonAdmission.SelectedItem != null &&
         dateAdmission.SelectedDate != null)
     {
         employe                     medoc         = cbxMedecin.SelectedItem as employe;
         raison_admission            raison        = cbxRaisonAdmission.SelectedItem as raison_admission;
         Dictionary <string, string> admissionData = new Dictionary <string, string>();
         admissionData.Add("id_client", cePatient.id.ToString());
         admissionData.Add("id_medecin", medoc.id.ToString());
         admissionData.Add("date_admission", ((DateTime)dateAdmission.SelectedDate).ToString());
         admissionData.Add("raison_admission", raison.designation);
         Accomodations choixAccomodations = new Accomodations(cePatient, cbxDepartement.SelectedItem as departement, admissionData);
         choixAccomodations.ShowDialog();
         this.Close();
     }
     else
     {
         MessageBox.Show("Veuillez remplir toutes les options", "Attention"
                         , MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }