Example #1
0
 public void AddRefresh(SVC.Patient listmembership, SVC.SalleDattente selectSalle)
 {
     txtCode.Text             = listmembership.Id.ToString();
     txtNomPrénom.Text        = listmembership.Nom + " " + listmembership.Prénom;
     txtNomPrénomMedecin.Text = selectSalle.NomMedecin + " " + selectSalle.PrénomMedecin;
     reader = new SpeechSynthesizer();
     //  String voix = "Microsoft Server Speech Text to Speech Voice (fr-FR, Hortense)";
     //reader.SelectVoice(voix);
     reader.SpeakAsync(txtc.Content + txtCode.Text + txtNomPrénom.Text + txt.Content + txtNomPrénomMedecin.Text);
 }
Example #2
0
        /*******************************************/


        public Arrivée(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, SVC.RendezVou rendezvousrecu, SVC.Medecin medecinrecu, DateTime DateRecu, int interfacerecu, SVC.Patient patientrecu, SVC.SalleDattente salleattenterecu)
        {
            try
            {
                InitializeComponent();
                proxy                     = proxyrecu;
                UserMembership            = memberrecu;
                callback                  = callbackrecu;
                rendezvous                = rendezvousrecu;
                DateSalleAttente          = DateRecu;
                MedecinForSalleAttente    = medecinrecu;
                interf                    = interfacerecu;
                txtdateRendezVous.Content = DateRecu.ToLongDateString();

                /************ne pas oublié dans tout les interfaces*****************/

                callbackrecu.InsertPatientCallbackEvent += new ICallback.CallbackEventHandler7(callbackrecu_Refresh);
                proxy.InnerDuplexChannel.Faulted        += new EventHandler(InnerDuplexChannel_Faulted);

                proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
                /*dans la salle d'attente button in datagrid rendez vous        */
                if (interf == 1)
                {
                    List <SVC.Medecin> testmedecin = proxy.GetAllMedecin().OrderBy(n => n.Nom).ToList();
                    txtMedecin.ItemsSource = testmedecin;
                    List <SVC.Medecin> tte = testmedecin.Where(n => n.Id == MedecinForSalleAttente.Id).OrderBy(n => n.Nom).ToList();
                    txtMedecin.SelectedItem = tte.First();

                    List <SVC.Patient> testmedecin1 = proxy.GetAllPatientBYID(rendezvous.CodePatient.Value).OrderBy(n => n.Nom).ToList();
                    txtPatient.ItemsSource = testmedecin1;
                    List <SVC.Patient> tte1 = testmedecin1.Where(n => n.Id == rendezvous.CodePatient).OrderBy(n => n.Nom).ToList();
                    txtPatient.SelectedItem = tte1.First();

                    txtArrivée.Text = Convert.ToString(DateTime.Now.TimeOfDay);

                    txtFonction.ItemsSource    = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                    RendezVousGrid.DataContext = rendezvousrecu;
                    //  txtFonction.SelectedValue = rendezvousrecu.Motif.ToString();

                    PatientSalleDattente = tte1.First();
                    txtPatient.IsEnabled = false;
                    //  txtMedecin.IsEnabled = false;
                    btnPatient.IsEnabled  = false;
                    txtPatient.Visibility = Visibility.Visible;
                    accbStates.Visibility = Visibility.Collapsed;
                    auto = false;
                }
                else
                {/* 1-Arrivage dans liste home.xaml c-a-d patient connu
                  * 2-Arrivée sans rendez vous dans la salle d'attente patient non connu
                  */
                    if (interf == 2)
                    {
                        if (patientrecu != null)
                        {
                            PatientSalleDattente = patientrecu;
                            List <SVC.Medecin> testmedecin = proxy.GetAllMedecin().OrderBy(n => n.Nom).ToList();
                            txtMedecin.ItemsSource = testmedecin;
                            List <SVC.Medecin> tte = testmedecin.Where(n => n.Nom == PatientSalleDattente.SuiviParNom && n.Prénom == PatientSalleDattente.SuiviParPrénom).OrderBy(n => n.Nom).ToList();
                            txtMedecin.SelectedItem = tte.First();

                            List <SVC.Patient> testmedecin1 = proxy.GetAllPatientBYID(PatientSalleDattente.Id).OrderBy(n => n.Nom).ToList();
                            txtPatient.ItemsSource = testmedecin1;

                            List <SVC.Patient> tte1 = testmedecin1.Where(n => n.Id == PatientSalleDattente.Id).OrderBy(n => n.Nom).ToList();
                            txtPatient.SelectedItem = tte1.First();

                            txtArrivée.Text = Convert.ToString(DateTime.Now.TimeOfDay);

                            txtFonction.ItemsSource = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                            txtPatient.IsEnabled    = false;
                            txtPatient.Visibility   = Visibility.Visible;
                            accbStates.Visibility   = Visibility.Collapsed;
                            auto = false;
                        }
                        else
                        {
                            List <SVC.Medecin> testmedecin = proxy.GetAllMedecin().OrderBy(n => n.Nom).ToList();
                            txtMedecin.ItemsSource = testmedecin;


                            txtArrivée.Text         = Convert.ToString(DateTime.Now.TimeOfDay);
                            txtFonction.ItemsSource = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);


                            //  accbStates.ItemsSource = proxy.GetAllPatient();

                            /*  SVC.Patient obpa = new SVC.Patient();
                             * List<SVC.Patient> pa = new List<SVC.Patient>();
                             * pa.Add(obpa);
                             * accbStates.ItemsSource = pa;
                             * accbStates.DataContext = pa;*/
                            txtPatient.Visibility = Visibility.Collapsed;

                            auto = true;
                        }
                    }
                    else
                    {
                        if (interf == 3)
                        {
                            SalleAttenteP = salleattenterecu;
                            List <SVC.Medecin> testmedecin = proxy.GetAllMedecin().OrderBy(n => n.Nom).ToList();
                            txtMedecin.ItemsSource = testmedecin;
                            List <SVC.Medecin> tte = testmedecin.Where(n => n.Id == MedecinForSalleAttente.Id).OrderBy(n => n.Nom).ToList();
                            txtMedecin.SelectedItem = tte.First();

                            List <SVC.Patient> testmedecin1 = proxy.GetAllPatientBYID(patientrecu.Id).OrderBy(n => n.Nom).ToList();
                            txtPatient.ItemsSource = testmedecin1;
                            List <SVC.Patient> tte1 = testmedecin1.Where(n => n.Id == patientrecu.Id).OrderBy(n => n.Nom).ToList();
                            txtPatient.SelectedItem = tte1.First();

                            List <SVC.MotifVisite> testmotif = proxy.GetAllMotifVisite().OrderBy(n => n.Motif).ToList();
                            txtFonction.ItemsSource = testmotif;
                            //List<SVC.MotifVisite> ttemitif = testmotif.Where(n => n.Motif == salleattenterecu.Motif).ToList();
                            txtFonction.SelectedItem   = salleattenterecu.Motif;
                            txtArrivée.Text            = salleattenterecu.Arrivée.ToString();
                            RendezVousGrid.DataContext = SalleAttenteP;
                            txtPatient.Visibility      = Visibility.Visible;
                            accbStates.Visibility      = Visibility.Collapsed;
                            auto = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #3
0
        private void btnCreer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                bool RendezVousResult   = false;
                bool SalleAttenteResult = false;
                /*dans la salle d'attente button in datagrid rendez vous        */
                if (interf == 1 && UserMembership.CréationSalleAttente == true && txtFonction.SelectedItem != null && txtArrivée.Text != "" && txtMedecin.SelectedItem != null)
                {
                    using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew))
                    {
                        rendezvous.Confirm = true;
                        SVC.Medecin       SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin;
                        SVC.MotifVisite   SelectMotif   = txtFonction.SelectedItem as SVC.MotifVisite;
                        SVC.SalleDattente sl            = new SVC.SalleDattente
                        {
                            Nom               = rendezvous.Nom,
                            Prénom            = rendezvous.Prénom,
                            Arrivée           = TimeSpan.Parse(txtArrivée.Text),
                            Rdv               = rendezvous.RendezVousD,
                            DateRendez        = rendezvous.Date,
                            DateArrivée       = DateSalleAttente,
                            DateDeNaissance   = PatientSalleDattente.DateDeNaissance,
                            Age               = Convert.ToInt16(DateTime.Now.Date.Year - (PatientSalleDattente.DateDeNaissance).Value.Year),
                            Commentaire       = txtCommentaire.Text,
                            NomMedecin        = SelectMedecin.Nom,
                            PrénomMedecin     = SelectMedecin.Prénom,
                            NuméroRendezVous  = rendezvous.NuméroRendezVous,
                            CodePatient       = rendezvous.CodePatient,
                            Quit              = false,
                            Motif             = SelectMotif.Motif,
                            MedecinSalle      = false,
                            NumFilleAttente   = 0,
                            FinDeConsultation = false,
                            CodeMedecin       = SelectMedecin.Id,
                        };
                        proxy.UpdateRendezVous(rendezvous);
                        RendezVousResult = true;
                        proxy.InsertSalleDatente(sl);
                        SalleAttenteResult = true;
                        if (RendezVousResult && SalleAttenteResult)
                        {
                            ts.Complete();
                            MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Properties.Resources.OperationSuccées, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
                        }
                        else
                        {
                            MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(GestionClinique.Properties.Resources.Opérationéchouée, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                    proxy.AjouterSalleAtentefRefresh();
                    proxy.AjouterRendezVOUSfRefresh();
                }
                else
                {
                    if (interf == 2 && UserMembership.CréationSalleAttente == true && txtFonction.SelectedItem != null && txtArrivée.Text != "" && txtMedecin.SelectedItem != null)
                    {
                        using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew))
                        {
                            if (PatientSalleDattente != null)
                            {
                                SVC.Medecin       SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin;
                                SVC.Patient       selectpatient = PatientSalleDattente;// txtPatient.SelectedItem as SVC.Patient;
                                SVC.MotifVisite   SelectMotif   = txtFonction.SelectedItem as SVC.MotifVisite;
                                SVC.SalleDattente sl            = new SVC.SalleDattente
                                {
                                    Nom               = selectpatient.Nom,
                                    Prénom            = selectpatient.Prénom,
                                    Arrivée           = TimeSpan.Parse(txtArrivée.Text),
                                    Rdv               = TimeSpan.Parse(txtArrivée.Text),
                                    DateRendez        = DateSalleAttente,
                                    DateArrivée       = DateSalleAttente,
                                    DateDeNaissance   = selectpatient.DateDeNaissance,
                                    Age               = Convert.ToInt16(DateTime.Now.Date.Year - (selectpatient.DateDeNaissance).Value.Year),
                                    Commentaire       = txtCommentaire.Text,
                                    NomMedecin        = SelectMedecin.Nom,
                                    PrénomMedecin     = SelectMedecin.Prénom,
                                    NuméroRendezVous  = "Sans Rendez Vous",
                                    CodePatient       = selectpatient.Id,
                                    Quit              = false,
                                    Motif             = SelectMotif.Motif,
                                    MedecinSalle      = false,
                                    NumFilleAttente   = 0,
                                    FinDeConsultation = false,
                                    CodeMedecin       = SelectMedecin.Id,
                                };

                                proxy.InsertSalleDatente(sl);
                                SalleAttenteResult = true;
                            }
                            else
                            {
                                SVC.Medecin       SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin;
                                SVC.Patient       selectpatient = proxy.GetAllPatient().Find(n => (n.Nom + " " + n.Prénom).Trim() == accbStates.Text.Trim());
                                SVC.MotifVisite   SelectMotif   = txtFonction.SelectedItem as SVC.MotifVisite;
                                SVC.SalleDattente sl            = new SVC.SalleDattente
                                {
                                    Nom               = selectpatient.Nom,
                                    Prénom            = selectpatient.Prénom,
                                    Arrivée           = TimeSpan.Parse(txtArrivée.Text),
                                    Rdv               = TimeSpan.Parse(txtArrivée.Text),
                                    DateRendez        = DateSalleAttente,
                                    DateArrivée       = DateSalleAttente,
                                    DateDeNaissance   = selectpatient.DateDeNaissance,
                                    Age               = Convert.ToInt16(DateTime.Now.Date.Year - (selectpatient.DateDeNaissance).Value.Year),
                                    Commentaire       = txtCommentaire.Text,
                                    NomMedecin        = SelectMedecin.Nom,
                                    PrénomMedecin     = SelectMedecin.Prénom,
                                    NuméroRendezVous  = "Sans Rendez Vous",
                                    CodePatient       = selectpatient.Id,
                                    Quit              = false,
                                    Motif             = SelectMotif.Motif,
                                    CodeMedecin       = SelectMedecin.Id,
                                    MedecinSalle      = false,
                                    NumFilleAttente   = 0,
                                    FinDeConsultation = false,
                                };

                                proxy.InsertSalleDatente(sl);
                                SalleAttenteResult = true;
                            }



                            if (SalleAttenteResult)
                            {
                                ts.Complete();
                                MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(GestionClinique.Properties.Resources.OperationSuccées, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
                            }
                            else
                            {
                                MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(GestionClinique.Properties.Resources.Opérationéchouée, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                            }
                        }
                        proxy.AjouterSalleAtentefRefresh();
                    }
                    else
                    {
                        if (interf == 3 && UserMembership.ModificationSalleAttente == true && txtFonction.SelectedItem != null && txtArrivée.Text != "" && txtMedecin.SelectedItem != null)
                        {
                            using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew))
                            {
                                SVC.Medecin     SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin;
                                SVC.Patient     selectpatient = txtPatient.SelectedItem as SVC.Patient;
                                SVC.MotifVisite SelectMotif   = txtFonction.SelectedItem as SVC.MotifVisite;

                                SalleAttenteP.Age         = Convert.ToInt16(DateTime.Now.Date.Year - (selectpatient.DateDeNaissance).Value.Year);
                                SalleAttenteP.Arrivée     = TimeSpan.Parse(txtArrivée.Text);
                                SalleAttenteP.CodePatient = selectpatient.Id;
                                SalleAttenteP.Commentaire = txtCommentaire.Text;
                                //  SalleAttenteP.DateArrivée = DateTime.Now;

                                SalleAttenteP.DateDeNaissance = selectpatient.DateDeNaissance;
                                SalleAttenteP.Motif           = SelectMotif.Motif;
                                SalleAttenteP.Nom             = selectpatient.Nom;
                                SalleAttenteP.Prénom          = selectpatient.Prénom;

                                SalleAttenteP.NomMedecin    = SelectMedecin.Nom;
                                SalleAttenteP.PrénomMedecin = SelectMedecin.Prénom;
                                SalleAttenteP.CodeMedecin   = SelectMedecin.Id;

                                /*Rdv+DateRendez+NuméroRendezVous+Quit+MedecinSalle+NumFilleAttente+TempsChezMedecin
                                 * +TempsQuitMededcinSalle+FinDeConsultation */
                                proxy.UpdateSalleDattente(SalleAttenteP);
                                SalleAttenteResult = true;

                                if (SalleAttenteResult)
                                {
                                    ts.Complete();
                                    MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(GestionClinique.Properties.Resources.OperationSuccées, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
                                }
                                else
                                {
                                    MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(GestionClinique.Properties.Resources.Opérationéchouée, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                                }
                            }
                            proxy.AjouterSalleAtentefRefresh();
                        }
                    }
                }
            } catch (Exception ex)
            {
                MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }