예제 #1
0
        private void PrendreRendezVous_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (memberuser.CréationRendezVous == true && PatientDataGrid.SelectedItem != null)
                {
                    SVC.Patient   SelectPatient = PatientDataGrid.SelectedItem as SVC.Patient;
                    SVC.RendezVou rendezvous    = new SVC.RendezVou
                    {
                        Nom         = SelectPatient.Nom,
                        Prénom      = SelectPatient.Prénom,
                        CodePatient = SelectPatient.Id,
                        Adresse     = SelectPatient.Adresse,
                        Téléphone   = SelectPatient.Téléphone,
                        Email       = SelectPatient.Email,
                        PrisPar     = memberuser.UserName,
                    };

                    PrendreRendezVous kl = new PrendreRendezVous(rendezvous, proxy, memberuser, callback, 4, SelectPatient);

                    kl.Show();
                }
                else
                {
                    MessageBoxResult resul03 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
            }
        }
예제 #2
0
 private void txtRecherche_TextChanged(object sender, TextChangedEventArgs e)
 {
     try {
         TextBox         t      = (TextBox)sender;
         string          filter = t.Text;
         ICollectionView cv     = CollectionViewSource.GetDefaultView(RendezVousDataGrid.ItemsSource);
         if (filter == "")
         {
             cv.Filter = null;
         }
         else
         {
             cv.Filter = o =>
             {
                 SVC.RendezVou p = o as SVC.RendezVou;
                 if (t.Name == "txtId")
                 {
                     return(p.Id == Convert.ToInt32(filter));
                 }
                 return(p.Nom.ToUpper().StartsWith(filter.ToUpper()));
             };
         }
     }
     catch (Exception ex)
     {
         MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
     }
 }
예제 #3
0
        public ImpressionTicket(SVC.ServiceCliniqueClient proxyrecu, SVC.RendezVou rendezticket)
        {
            try
            {
                InitializeComponent();
                //  rendezvousimpr = rendezticket;

                // rendezvousimpr.NuméroRendezVous = "*" + rendezticket.NuméroRendezVous + "*";
                var people = new List <SVC.RendezVou>();
                people.Add(rendezticket);

                // datable = datatablerecu;
                proxy = proxyrecu;

                MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.ReportRendezVous), false);

                reportViewer1.LocalReport.LoadReportDefinition(MyRptStream);
                // reportViewer1.LocalReport.ReportPath = "../../Patient/ReportOnePatient.rdlc";


                var selmede = new List <SVC.Param>();
                selmede.Add((proxy.GetAllParamétre()));
                //    var selexc = new List<ExclusionDay>();
                //   selexc.Add(selectexclusion);
                //Add datasets
                this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", people));
                this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", selmede));
                reportViewer1.LocalReport.EnableExternalImages = true;
                ReportParameter paramLogo = new ReportParameter();
                paramLogo.Name = "ImagePath";
                String photolocation = System.Environment.CurrentDirectory + "/Logo.png";

                paramLogo.Values.Add(@"file:///" + photolocation);
                reportViewer1.LocalReport.SetParameters(paramLogo);
                reportViewer1.RefreshReport();
                //proxy = proxyrecu;
                proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);

                proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #4
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            try {
                if (RendezVousDataGrid.SelectedItem != null && memberuser.ModificationRendezVous == true)
                {
                    SVC.RendezVou SelectRendezVous = RendezVousDataGrid.SelectedItem as SVC.RendezVou;


                    PrendreRendezVous CLMedecin = new PrendreRendezVous(SelectRendezVous, proxy, memberuser, callback, 2, null);
                    CLMedecin.Show();

                    /*probléme selected item*/
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
            }
        }
예제 #5
0
 private void btnSupp_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (RendezVousDataGrid.SelectedItem != null && memberuser.SuppressionPatient == true)
         {
             SVC.RendezVou SelectRendezVous = RendezVousDataGrid.SelectedItem as SVC.RendezVou;
             proxy.DeleteRendezVous(SelectRendezVous);
             proxy.AjouterRendezVOUSfRefresh();
             proxy.AjouterSalleAtentefRefresh();
         }
         else
         {
             MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
예제 #6
0
        public void AddRefresh(SVC.RendezVou listmembership, int oper)
        {
            try
            {
                var LISTITEM1 = RendezVousDataGrid.ItemsSource as IEnumerable <SVC.RendezVou>;
                List <SVC.RendezVou> LISTITEM = LISTITEM1.ToList();

                if (oper == 1)
                {
                    LISTITEM.Add(listmembership);
                }
                else
                {
                    if (oper == 2)
                    {
                        var objectmodifed = LISTITEM.Find(n => n.Id == listmembership.Id);
                        objectmodifed = listmembership;
                    }
                    else
                    {
                        if (oper == 3)
                        {
                            //    MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show("Supp rendezvous :"+ listmembership.Id.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                            var deleterendez = LISTITEM.Where(n => n.Id == listmembership.Id).First();
                            LISTITEM.Remove(deleterendez);
                        }
                    }

                    RendezVousDataGrid.ItemsSource = LISTITEM;
                    NBSALLEATTENTE.Text            = ((LISTITEM).Where(n => n.Date == DateTime.Now.Date).AsEnumerable().Count()).ToString();
                }
            }catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #7
0
 private void btnImprimer_Click(object sender, RoutedEventArgs e)
 {
     try {
         if (memberuser.ImpressionRendezVous == true && RendezVousDataGrid.SelectedItem != null)
         {
             SVC.RendezVou    SelectMedecin = RendezVousDataGrid.SelectedItem as SVC.RendezVou;
             ImpressionTicket clsho         = new ImpressionTicket(proxy, SelectMedecin);
             clsho.Show();
         }
         else
         {
             if (memberuser.ImpressionRendezVous == true && RendezVousDataGrid.SelectedItem == null)
             {
                 List <SVC.RendezVou>      test1 = proxy.GetAllRendezVous(DateSaisieDébut.SelectedDate.Value, DateSaisieFin.SelectedDate.Value).ToList();
                 ImpressionListeRendezVous clsho = new ImpressionListeRendezVous(proxy, test1);
                 clsho.Show();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
     }
 }
예제 #8
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);
            }
        }
예제 #9
0
        public PrendreRendezVous(SVC.RendezVou rendezvous, SVC.ServiceCliniqueClient proxyrecu, SVC.Membership membershiprecu, ICallback callbackrecu, int Interface, SVC.Patient patientrecu)
        {
            try
            {
                InitializeComponent();

                /*   txtDate.DisplayDate =Convert.ToDateTime(rendezvous.Date);
                 * txtHoraire.ItemsSource = rendezvous.RendezVousD.ToString() + rendezvous.RendezVousF.ToString();*/
                proxy           = proxyrecu;
                MemberUser      = membershiprecu;
                RendezInterface = Interface;
                callbackrecu.InsertPatientCallbackEvent     += new ICallback.CallbackEventHandler7(callbackrecu_Refresh);
                callbackrecu.InsertMotifVisiteCallbackEvent += new ICallback.CallbackEventHandler10(callbackrecuMotif_Refresh);
                proxy.InnerDuplexChannel.Closed             += new EventHandler(InnerDuplexChannel_Closed);
                if (rendezvous != null)
                {
                    rendezVousP = rendezvous;
                    RendezVousGrid.DataContext = rendezVousP;



                    if (rendezvous.Nom == null && rendezvous.Prénom == null && Interface == 1)
                    {
                        txtFonction.ItemsSource = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);

                        txtPatient.Visibility = Visibility.Collapsed;
                        auto = true;
                        List <SVC.Medecin> testmedecin = proxy.GetAllMedecin();
                        txtMedecin.ItemsSource = testmedecin;
                        List <SVC.Medecin> tte = testmedecin.Where(n => n.Nom == rendezVousP.MedecinNom && n.Prénom == rendezVousP.MedecinPrénom).ToList();
                        txtMedecin.SelectedItem = tte.First();
                        btnCreer.IsEnabled      = true;
                        List <SVC.Patient> pp = new List <SVC.Patient>();
                        accbStates.ItemsSource = pp;
                        txtHoraire.Text        = rendezvous.RendezVousD.ToString();
                        txtHoraire.Enabled     = false;
                    }
                    else
                    {
                        if (Interface == 2)
                        {
                            /******************fdans datagrid exist in interface rendez vous**************/
                            if (rendezvous.Nom != null && rendezvous.Prénom != null)
                            {
                                NomPrenoRendezVousnull   = false;
                                btnCreer.IsEnabled       = true;
                                btnCreer.Content         = "Modifier";
                                txtFonction.ItemsSource  = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                                txtFonction.SelectedItem = rendezVousP.Motif;
                                txtHoraire.Text          = (rendezvous.RendezVousD).ToString();



                                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();
                                txtPatient.IsEnabled    = false;
                                auto = false;
                                accbStates.Visibility = Visibility.Collapsed;
                                List <SVC.Medecin> testmedecin = proxy.GetAllMedecin();
                                txtMedecin.ItemsSource = testmedecin;
                                List <SVC.Medecin> tte = testmedecin.Where(n => n.Nom == rendezVousP.MedecinNom && n.Prénom == rendezVousP.MedecinPrénom).ToList();
                                txtMedecin.SelectedItem = tte.First();
                            }
                            else
                            {
                                /*************dans datagrid exist in rendez vous interface********************/
                                if (rendezvous.Nom == null && rendezvous.Prénom == null)
                                {
                                    NomPrenoRendezVousnull = true;
                                    btnCreer.IsEnabled     = true;
                                    //    btnCreer.Content = "Créer";
                                    txtFonction.ItemsSource  = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                                    txtFonction.SelectedItem = rendezVousP.Motif;
                                    txtHoraire.Text          = (rendezvous.RendezVousD).ToString();



                                    List <SVC.Patient> pp = new List <SVC.Patient>();
                                    accbStates.ItemsSource = pp;
                                    txtPatient.Visibility  = Visibility.Collapsed;
                                    auto = true;
                                    List <SVC.Medecin> testmedecin = proxy.GetAllMedecin();
                                    txtMedecin.ItemsSource = testmedecin;

                                    List <SVC.Medecin> tte = testmedecin.Where(n => n.Nom == rendezVousP.MedecinNom && n.Prénom == rendezVousP.MedecinPrénom).ToList();
                                    txtMedecin.SelectedItem = tte.First();
                                }
                            }
                        }
                        else
                        {/***********       Prise de rendez vous dans mainwindow.xaml c-a-d  *************************/
                            if (Interface == 3)
                            {
                                rendezVousP = rendezvous;
                                RendezVousGrid.DataContext = rendezVousP;

                                txtFonction.ItemsSource = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                                // txtPatient.ItemsSource = proxy.GetAllPatient();

                                txtMedecin.ItemsSource   = proxy.GetAllMedecin();
                                txtMedecin.SelectedIndex = 0;
                                List <SVC.Patient> pp = new List <SVC.Patient>();
                                accbStates.ItemsSource = pp;
                                txtPatient.Visibility  = Visibility.Collapsed;
                                auto = true;
                            }
                            else
                            {
                                if (Interface == 4)
                                {
                                    List <SVC.Patient> testmedecin1 = proxy.GetAllPatientBYID(patientrecu.Id).OrderBy(n => n.Nom).ToList();
                                    txtPatient.ItemsSource = testmedecin1;
                                    List <SVC.Patient> tte11 = testmedecin1.Where(n => n.Id == rendezvous.CodePatient).OrderBy(n => n.Nom).ToList();
                                    txtPatient.SelectedItem = tte11.First();
                                    txtPatient.IsEnabled    = false;

                                    List <SVC.Medecin> test = proxy.GetAllMedecin();
                                    txtMedecin.ItemsSource = test;

                                    List <SVC.Medecin> tte1 = test.Where(n => n.Nom == patientrecu.SuiviParNom && n.Prénom == patientrecu.SuiviParPrénom).ToList();
                                    txtMedecin.SelectedItem = tte1.First();


                                    rendezVousP = rendezvous;
                                    RendezVousGrid.DataContext = rendezVousP;
                                    txtFonction.ItemsSource    = proxy.GetAllMotifVisite().OrderBy(n => n.Motif);
                                    accbStates.Visibility      = Visibility.Collapsed;
                                    auto = false;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }