private void txtRecherche_TextChanged(object sender, TextChangedEventArgs e) { try { if (txtRecherche.Text != "") { TextBox t = (TextBox)sender; string filter = t.Text; ICollectionView cv = CollectionViewSource.GetDefaultView(PatientDataGrid.ItemsSource); if (filter == "") { cv.Filter = null; } else { cv.Filter = o => { SVC.Patient p = o as SVC.Patient; if (t.Name == "txtId") { return(p.Id == Convert.ToInt32(filter)); } return(p.Nom.ToUpper().StartsWith(filter.ToUpper())); }; } } } catch (Exception ex) { HandleProxy(); } }
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); } }
private void supprimer(object sender, RoutedEventArgs e) { try { if (PatientDataGrid.SelectedItem != null) { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; int nbvisite = proxy.GetAllVisiteByVisite(SelectMedecin.Id).Count(); if (nbvisite == 0) { using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { proxy.DeletePatient(SelectMedecin); ts.Complete(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } proxy.AjouterPatientRefresh(); } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } } catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void FolderClick(object sender, RoutedEventArgs e) { try { if (PatientDataGrid.SelectedItem != null) { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; if ((MedecinEnCours != null && SelectMedecin.SuiviParCode == MedecinEnCours.Id) || memberuser.AccèsToutLesDossierPatient == true) { DossierPatient dd = new DossierPatient(proxy, SelectMedecin, callback, memberuser, "Sans Rendez Vous", MedecinEnCours, localclient); dd.Show(); } else { if (memberuser.AccèsToutLesDossierPatient == true) { DossierPatient dd = new DossierPatient(proxy, SelectMedecin, callback, memberuser, "Sans Rendez Vous", null, localclient); dd.Show(); } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, 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); } }
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); }
public VersementPatient(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership membershiprecu, ICallback callbackrecu, SVC.Patient fournrecu, SVC.Visite visiterecu, bool valeurbool) { try { InitializeComponent(); proxy = proxyrecu; callback = callbackrecu; MemberUser = membershiprecu; PatientR = fournrecu; VisiteAregler = visiterecu; //Convert.ToString(VisiteApayer.Id) + Convert.ToString(DateTime.Now.TimeOfDay) // cléfiltre = Convert.ToString(VisiteAregler.Id) + Convert.ToString(DateTime.Now.TimeOfDay) ; // if (valeurbool==false) // { depaiemlist = (proxy.GetAllDepeiment()).Where(n => n.cle == VisiteAregler.cle).ToList(); // }else // { // SVC.Depeiment soldededepart= (proxy.GetAllDepeiment()).Find(n => n.cle == PatientR.cle); // depaiemlist.Add(soldededepart); // } labelFournisseur.Content = fournrecu.Id + " " + fournrecu.Nom + " " + fournrecu.Prénom; // var okmultiple = (proxy.GetAllDepeiementMultiple()).Find(n => n.cleVisite == VisiteAregler.cle); var okmultiple = (proxy.GetAllDepeiementMultiple()).FindAll(n => n.cleVisite == VisiteAregler.cle); if (okmultiple.Count > 0) { foreach (SVC.DepeiementMultiple itemmultiple in okmultiple) { DepeimentMultiple = proxy.GetAllDepeiment().Find(n => n.CleMultiple == itemmultiple.cleMultiple); if (!depaiemlist.Contains(DepeimentMultiple) && DepeimentMultiple.Multiple == true) { depaiemlist.Add(DepeimentMultiple); } } FournDataGrid.ItemsSource = depaiemlist; } else { FournDataGrid.ItemsSource = depaiemlist; } callbackrecu.InsertDepaiemCallbackevent += new ICallback.CallbackEventHandler32(callbackrecu_Refresh); 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); } }
public ImpressionDiagnostic(SVC.ServiceCliniqueClient proxyrecu, SVC.Patient patientrecu, List <SVC.Diagnostic> diagnosticrecu, int interfacerecu) { try { InitializeComponent(); proxy = proxyrecu; // datable = datatablerecu; if (interfacerecu == 1) { MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.DiagnosticDiab), false); reportViewer1.LocalReport.LoadReportDefinition(MyRptStream); } else { if (interfacerecu == 2) { MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.ConsultationClinique), false); reportViewer1.LocalReport.LoadReportDefinition(MyRptStream); } } List <SVC.Patient> listpatient = new List <SVC.Patient>(); listpatient.Add(patientrecu); var selpara = new List <SVC.Param>(); selpara.Add((proxy.GetAllParamétre())); reportViewer1.LocalReport.EnableExternalImages = true; this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", selpara)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", listpatient)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet3", diagnosticrecu)); 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.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted); proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed); } catch { HandleProxy(); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { try { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; NewPatient CLMedecin = new NewPatient(proxy, memberuser, SelectMedecin); CLMedecin.Show(); } catch (Exception ex) { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }
private void btnImprimer_Click(object sender, RoutedEventArgs e) { try { if (memberuser.ImpressionPatient == true) { if (PatientDataGrid.SelectedItem != null) { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; FichePatient clsho = new FichePatient(proxy, SelectMedecin); clsho.Show(); } else { if (txtRecherche.Text != "") { List <SVC.Patient> test = PatientDataGrid.ItemsSource as List <SVC.Patient>; var t = (from e1 in test where e1.Nom.ToUpper().StartsWith(txtRecherche.Text.ToUpper()) select e1); ReportListePatient clsho = new ReportListePatient(proxy, t.ToList()); clsho.Show(); } else { List <SVC.Patient> test = PatientDataGrid.ItemsSource as List <SVC.Patient>; ReportListePatient clsho = new ReportListePatient(proxy, test.ToList()); clsho.Show(); } } } else { MessageBoxResult resul03 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } catch (Exception ex) { HandleProxy(); } }
public ImpressionExamenRadio(SVC.ServiceCliniqueClient proxyrecu, SVC.Patient patientrecu, List <ExamenRadiologie> examenmm, string examenvariable) { try { InitializeComponent(); proxy = proxyrecu; MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.BonExamenRadio), false); reportViewer1.LocalReport.LoadReportDefinition(MyRptStream); List <SVC.Patient> listpatient = new List <SVC.Patient>(); listpatient.Add(patientrecu); var selpara = new List <SVC.Param>(); selpara.Add((proxy.GetAllParamétre())); reportViewer1.LocalReport.EnableExternalImages = true; /**********************************************************************************/ ReportParameter paramexamenvariable = new ReportParameter(); paramexamenvariable.Name = "AutreBilan"; paramexamenvariable.Values.Add(examenvariable.ToString()); reportViewer1.LocalReport.SetParameters(paramexamenvariable); /*********************************************************************************/ ReportParameter paramLogo = new ReportParameter(); paramLogo.Name = "ImagePath"; String photolocation = System.Environment.CurrentDirectory + "/Logo.png"; paramLogo.Values.Add(@"file:///" + photolocation); reportViewer1.LocalReport.SetParameters(paramLogo); /**********************************************************************************/ this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", selpara)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", listpatient)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet3", examenmm)); reportViewer1.RefreshReport(); proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted); proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed); } catch (Exception ex) { HandleProxy(); } }
private void btnSupp_Click(object sender, RoutedEventArgs e) { try { if (memberuser.SuppressionPatient == true && PatientDataGrid.SelectedItem != null) { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; proxy.DeletePatient(SelectMedecin); } 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) { HandleProxy(); } }
private void ArrivageNew_Click(object sender, RoutedEventArgs e) { try { if (PatientDataGrid.SelectedItem != null && memberuser.CréationSalleAttente == true) { SVC.Patient SelectPatient = PatientDataGrid.SelectedItem as SVC.Patient; Arrivée cl = new Arrivée(proxy, memberuser, callback, null, null, DateTime.Now, 2, SelectPatient, null); cl.Show(); } else { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }catch (Exception ex) { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }
public void AddRefresh(SVC.Patient listmembership, int oper) { try { var LISTITEM1 = PatientDataGrid.ItemsSource as IEnumerable <SVC.Patient>; List <SVC.Patient> LISTITEM = LISTITEM1.ToList(); if (oper == 1) { LISTITEM.Add(listmembership); } else { if (oper == 2) { // var objectmodifed = LISTITEM.Find(n => n.Id == listmembership.Id); // objectmodifed = listmembership; var objectmodifed = LISTITEM.Find(n => n.Id == listmembership.Id); //objectmodifed = listmembership; var index = LISTITEM.IndexOf(objectmodifed); if (index != -1) { LISTITEM[index] = 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); } } } PatientDataGrid.ItemsSource = LISTITEM; } catch (Exception ex) { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }
private void ClientsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { if (memberuser.ModificationPatient == true && PatientDataGrid.SelectedItem != null) { SVC.Patient SelectMedecin = PatientDataGrid.SelectedItem as SVC.Patient; NewPatient CLMedecin = new NewPatient(proxy, memberuser, SelectMedecin); CLMedecin.Show(); } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, 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); } }
public BonExamen(SVC.ServiceCliniqueClient proxyrecu, ICallback callbackrecu, SVC.Patient patientrecu) { try { InitializeComponent(); proxy = proxyrecu; callback = callbackrecu; Patient = patientrecu; pp = new ExamenCom { ACIDEURIQUE = false, CHOHDLLDL = false, FERSER = false, VS = false, CHOLTOTAL = false, COPRO = false, CREA = false, GLYC = false, ECBUATB = false, ELECHB = false, GroupageRhésus = false, FNSEQUILIBRE = false, IONOGR = false, SEROL = false, T3T4TSH = false, Triglycerides = false, UREE = false, }; InfGénéral.DataContext = pp; popol = new ExamenRadiologie { Echographie = false, Rachis = false, Téléthorax = false, }; GridRadioExamen.DataContext = popol; } catch (Exception ex) { MessageBoxResult results = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Logiciel, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
public FichePatient(SVC.ServiceCliniqueClient proxyrecu, SVC.Patient patientrecu) { try { InitializeComponent(); var people = new List <SVC.Patient>(); people.Add(patientrecu); proxy = proxyrecu; // datable = datatablerecu; reportViewer1.LocalReport.ReportPath = "../../Patient/ReportOnePatient.rdlc"; // reportViewer1.LocalReport.ReportPath = "../../Patient/ReportOnePatient.rdlc"; ReportDataSource rds = new ReportDataSource(); rds.Name = "DataSet1";//This refers to the dataset name in the RDLC file rds.Value = people; this.reportViewer1.LocalReport.DataSources.Add(rds); var selpara = new List <SVC.Param>(); selpara.Add((proxy.GetAllParamétre())); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", selpara)); 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.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); } }
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); } }
private void btnCreer_Click(object sender, RoutedEventArgs e) { try { /****************prendez rendez vous dans la page des rendez vous************************/ if (MemberUser.CréationRendezVous == true /*&& txtPatient.SelectedItem != null*/ && rendezVousP.Nom == null && rendezVousP.Prénom == null && RendezInterface == 1 && accbStates.Text.Trim() != "" && txtFonction.SelectedItem != null) { // SVC.Patient Selectpatient = txtPatient.SelectedItem as SVC.Patient; SVC.Patient Selectpatient = proxy.GetAllPatientNomPrenom(accbStates.Text.Trim()); SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; rendezVousP.Nom = Selectpatient.Nom; rendezVousP.Prénom = Selectpatient.Prénom; rendezVousP.Adresse = Selectpatient.Adresse; rendezVousP.PrisPar = MemberUser.UserName; rendezVousP.Email = Selectpatient.Email; rendezVousP.Téléphone = Selectpatient.Téléphone; rendezVousP.NuméroRendezVous = (rendezVousP.Date).Value.ToString("ddMMyyyy") + ((rendezVousP.RendezVousD).Value).ToString(@"hhmm") + Selectpatient.Id.ToString();//"HH:mm" rendezVousP.CodePatient = Selectpatient.Id; rendezVousP.MedecinNom = SelectMedecin.Nom; rendezVousP.CodeMedecin = SelectMedecin.Id; rendezVousP.MedecinPrénom = SelectMedecin.Prénom; rendezVousP.Confirm = false; // MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show("INTERFACE 1", Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); if (MemberUser.ImpressionRendezVous == true && ChImprimerTicket.IsChecked == true) { proxy.InsertRendez(rendezVousP); ImpressionTicket clsho = new ImpressionTicket(proxy, rendezVousP); clsho.Show(); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { if (ChImprimerTicket.IsChecked == false && MemberUser.ImpressionRendezVous == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } } btnCreer.IsEnabled = false; // proxy.AjouterSalleAtentefRefresh(); proxy.AjouterRendezVOUSfRefresh(); this.Close(); } else { if (MemberUser.ModificationRendezVous == true && txtPatient.SelectedItem != null && rendezVousP.Id != 0 && txtMedecin.SelectedItem != null && txtFonction.SelectedItem != null) { using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { SVC.Patient Selectpatient = txtPatient.SelectedItem as SVC.Patient; SVC.MotifVisite selectedmotif = txtFonction.SelectedItem as SVC.MotifVisite; rendezVousP.Motif = selectedmotif.Motif; rendezVousP.Adresse = Selectpatient.Adresse; rendezVousP.Nom = Selectpatient.Nom; rendezVousP.Email = Selectpatient.Email; rendezVousP.Date = txtDate.SelectedDate; rendezVousP.Prénom = Selectpatient.Prénom; SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; rendezVousP.MedecinNom = SelectMedecin.Nom; rendezVousP.MedecinPrénom = SelectMedecin.Prénom; rendezVousP.CodePatient = Selectpatient.Id; rendezVousP.SpécialitéMedecin = SelectMedecin.SpécialitéMedecin; rendezVousP.CodeMedecin = SelectMedecin.Id; rendezVousP.RendezVousD = TimeSpan.Parse(txtHoraire.Text); rendezVousP.RendezVousF = SelectMedecin.TempsVisite; rendezVousP.Téléphone = Selectpatient.Téléphone; rendezVousP.Confirm = ComboPresent.IsChecked; /********************/ /*****************/ proxy.UpdateRendezVous(rendezVousP); ts.Complete(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } proxy.AjouterRendezVOUSfRefresh(); proxy.AjouterSalleAtentefRefresh(); this.Close(); } else { /*******************************prendez rendez vous dans home.xaml + dans mainwindow c-a-d ni heure ni jours*****************************************************/ if (MemberUser.CréationRendezVous == true /*&& txtPatient.SelectedItem != null*/ && rendezVousP.Id == 0 && txtMedecin.SelectedItem != null && RendezInterface == 3 && accbStates.Text.Trim() != "" && txtFonction.SelectedItem != null) { // SVC.Patient Selectpatient = txtPatient.SelectedItem as SVC.Patient; SVC.Patient Selectpatient = proxy.GetAllPatient().Find(n => (n.Nom + " " + n.Prénom).Trim() == accbStates.Text.Trim()); SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; rendezVousP.Nom = Selectpatient.Nom; rendezVousP.Prénom = Selectpatient.Prénom; rendezVousP.Adresse = Selectpatient.Adresse; rendezVousP.PrisPar = MemberUser.UserName; rendezVousP.Email = Selectpatient.Email; rendezVousP.Téléphone = Selectpatient.Téléphone; rendezVousP.MedecinNom = SelectMedecin.Nom; rendezVousP.MedecinPrénom = SelectMedecin.Prénom; rendezVousP.Date = txtDate.SelectedDate; rendezVousP.SpécialitéMedecin = SelectMedecin.SpécialitéMedecin; rendezVousP.NuméroRendezVous = (txtDate.SelectedDate).Value.ToString("ddMMyyyy") + (TimeSpan.Parse(txtHoraire.Text)).ToString(@"hhmm") + Selectpatient.Id.ToString();//"HH:mm" rendezVousP.CodePatient = Selectpatient.Id; rendezVousP.CodeMedecin = SelectMedecin.Id; rendezVousP.RendezVousD = TimeSpan.Parse(txtHoraire.Text); rendezVousP.RendezVousF = SelectMedecin.TempsVisite; rendezVousP.Confirm = false; if (MemberUser.ImpressionRendezVous == true && ChImprimerTicket.IsChecked == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); ImpressionTicket clsho = new ImpressionTicket(proxy, rendezVousP); clsho.Show(); } else { if (ChImprimerTicket.IsChecked == false && MemberUser.ImpressionRendezVous == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } } proxy.AjouterRendezVOUSfRefresh(); this.Close(); // proxy.AjouterSalleAtentefRefresh(); } else {/******************rendez datagrid existe dans rendezvous.xaml date ok***************************/ if (MemberUser.CréationRendezVous == true /* && rendezVousP.Nom == null && rendezVousP.Prénom == null*/ && RendezInterface == 2 && txtFonction.SelectedItem != null) { SVC.Patient Selectpatient = new SVC.Patient(); if (NomPrenoRendezVousnull == true && accbStates.Text.Trim() != "") { Selectpatient = proxy.GetAllPatient().Find(n => (n.Nom + " " + n.Prénom).Trim() == accbStates.Text.Trim()); SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; rendezVousP.Nom = Selectpatient.Nom; rendezVousP.Prénom = Selectpatient.Prénom; rendezVousP.Adresse = Selectpatient.Adresse; rendezVousP.PrisPar = MemberUser.UserName; rendezVousP.Email = Selectpatient.Email; rendezVousP.Téléphone = Selectpatient.Téléphone; rendezVousP.MedecinNom = SelectMedecin.Nom; rendezVousP.MedecinPrénom = SelectMedecin.Prénom; rendezVousP.NuméroRendezVous = (rendezVousP.Date).Value.ToString("ddMMyyyy") + ((rendezVousP.RendezVousD).Value).ToString(@"hhmm") + Selectpatient.Id.ToString();//"HH:mm" rendezVousP.CodePatient = Selectpatient.Id; rendezVousP.CodeMedecin = SelectMedecin.Id; rendezVousP.Confirm = false; if (MemberUser.ImpressionRendezVous == true && ChImprimerTicket.IsChecked == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); ImpressionTicket clsho = new ImpressionTicket(proxy, rendezVousP); clsho.Show(); } else { if (ChImprimerTicket.IsChecked == false && MemberUser.ImpressionRendezVous == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } } proxy.AjouterRendezVOUSfRefresh(); // proxy.AjouterSalleAtentefRefresh(); btnCreer.IsEnabled = false; this.Close(); } else { if (NomPrenoRendezVousnull == false) { Selectpatient = txtPatient.SelectedItem as SVC.Patient; } } // } else { /***************rendez vous dans listepatienthome c-a-d**************************************/ if (MemberUser.CréationRendezVous == true && txtPatient.SelectedItem != null && /* rendezVousP.Nom == null && rendezVousP.Prénom == null &&*/ RendezInterface == 4 && txtMedecin.SelectedItem != null && txtDate.SelectedDate != null && txtHoraire.Text != "" && txtFonction.SelectedItem != null) { SVC.Patient Selectpatient = txtPatient.SelectedItem as SVC.Patient; SVC.Medecin selectmedecin = txtMedecin.SelectedItem as SVC.Medecin; rendezVousP.Nom = Selectpatient.Nom; rendezVousP.Prénom = Selectpatient.Prénom; rendezVousP.Adresse = Selectpatient.Adresse; rendezVousP.PrisPar = MemberUser.UserName; rendezVousP.Email = Selectpatient.Email; rendezVousP.Téléphone = Selectpatient.Téléphone; rendezVousP.RendezVousD = TimeSpan.Parse(txtHoraire.Text); rendezVousP.Date = txtDate.SelectedDate; rendezVousP.NuméroRendezVous = (txtDate.SelectedDate).Value.ToString("ddMMyyyy") + ((rendezVousP.RendezVousD).Value).ToString(@"hhmm") + Selectpatient.Id.ToString();//"HH:mm" rendezVousP.CodePatient = Selectpatient.Id; rendezVousP.MedecinNom = selectmedecin.Nom; rendezVousP.MedecinPrénom = selectmedecin.Prénom; rendezVousP.CodeMedecin = selectmedecin.Id; rendezVousP.RendezVousF = rendezVousP.RendezVousD + selectmedecin.TempsVisite; rendezVousP.Confirm = false; if (MemberUser.ImpressionRendezVous == true && ChImprimerTicket.IsChecked == true) { proxy.InsertRendez(rendezVousP); ImpressionTicket clsho = new ImpressionTicket(proxy, rendezVousP); clsho.Show(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { if (ChImprimerTicket.IsChecked == false && MemberUser.ImpressionRendezVous == true) { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { proxy.InsertRendez(rendezVousP); MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } } proxy.AjouterRendezVOUSfRefresh(); // proxy.AjouterSalleAtentefRefresh(); btnCreer.IsEnabled = false; this.Close(); } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } } } } } catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
public ImpressionOrdonnance(SVC.ServiceCliniqueClient proxyrecu, List <SVC.OrdonnancePatient> OrdonnancePatientRecu, SVC.Patient PatientRecu, SVC.Medecin SelectMedecinListe, SVC.EnteteOrdonnace selectedEnteteOrdonnance, bool a4) { try { InitializeComponent(); var people = new List <SVC.Patient>(); people.Add(PatientRecu); proxy = proxyrecu; var Entetemededcin = new List <SVC.EnteteOrdonnace>(); Entetemededcin.Add(selectedEnteteOrdonnance); if (a4 == false) { MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.Ordonnance), false); reportViewer1.LocalReport.LoadReportDefinition(MyRptStream); } else { if (a4 == true) { MemoryStream MyRptStream = new MemoryStream((Medicus.Properties.Resources.OrdonnanceA4), false); reportViewer1.LocalReport.LoadReportDefinition(MyRptStream); } } ReportDataSource rds = new ReportDataSource(); rds.Name = "DataSet2";//This refers to the dataset name in the RDLC file rds.Value = people; this.reportViewer1.LocalReport.DataSources.Add(rds); var selpara = new List <SVC.Param>(); SVC.Param paramlocal = (proxy.GetAllParamétre()); paramlocal.CheminLogo = "D/Logo.jpg"; selpara.Add((paramlocal)); var peoplemededcin = new List <SVC.Medecin>(); peoplemededcin.Add(SelectMedecinListe); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", selpara)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet3", OrdonnancePatientRecu)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet4", peoplemededcin)); this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet5", Entetemededcin)); if (proxy.GetAllParamétre().CheminLogo != "") { if (proxy.DownloadDocumentIsHere(proxy.GetAllParamétre().CheminLogo.ToString()) == true) { reportViewer1.LocalReport.EnableExternalImages = true; /* var image = LoadImage(proxy.DownloadDocument(proxy.GetAllParamétre().CheminLogo.ToString())); * JpegBitmapEncoder encoder = new JpegBitmapEncoder(); * Guid photoID = System.Guid.NewGuid(); * * encoder.Frames.Add(BitmapFrame.Create((BitmapImage)image)); * using (var filestream = new FileStream(photolocation, FileMode.Create)) * encoder.Save(filestream);*/ String photolocation = System.Environment.CurrentDirectory + "/Logo.png"; ReportParameter paramLogo = new ReportParameter(); paramLogo.Name = "ImagePath"; // paramLogo.Values.Add(@"file:///C:\Logo.png"); paramLogo.Values.Add(@"file:///" + photolocation); reportViewer1.LocalReport.SetParameters(paramLogo); // reportViewer1.LocalReport.SetParameters(parameter); } } reportViewer1.RefreshReport(); 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); } }
public NewPatient(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, SVC.Patient patientrecu) { try { InitializeComponent(); proxy = proxyrecu; proxy.InnerDuplexChannel.Opened += new EventHandler(InnerDuplexChannel_Opened); proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed); member = memberrecu; if (patientrecu == null) { Création = true; btnCreer.IsEnabled = false; txtMedecin.ItemsSource = proxy.GetAllMedecin(); txtMedecin.SelectedIndex = 0; } else { patient = patientrecu; PatientGrid.DataContext = patient; List <SVC.Medecin> testmedecin = proxy.GetAllMedecin(); txtMedecin.ItemsSource = testmedecin; if (patientrecu.SuiviParCode != null /* && patientrecu.SuiviParPrénom != ""*/) { List <SVC.Medecin> tte = testmedecin.Where(n => n.Id == patientrecu.SuiviParCode).ToList(); txtMedecin.SelectedItem = tte.First(); } if (patientrecu.CheminPhoto.ToString() != "") { if (proxy.DownloadDocumentIsHere(patientrecu.CheminPhoto.ToString()) == true) { imgPhoto.Source = LoadImage(proxy.DownloadDocument(patientrecu.CheminPhoto.ToString())); Création = false; patient = patientrecu; op.FileName = patientrecu.CheminPhoto; btnCreer.IsEnabled = true; btnCreer.Content = "Modifier"; } else { MessageBoxResult results = Xceed.Wpf.Toolkit.MessageBox.Show("Attention la photo du patient n'existe plus dans le serveur", "Medicus", MessageBoxButton.OK, MessageBoxImage.Error); op.FileName = ""; Création = false; patient = patientrecu; btnCreer.IsEnabled = true; btnCreer.Content = "Modifier"; } } } } catch (Exception ex) { MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void btnCreer_Click(object sender, RoutedEventArgs e) { try { string nommedecin; string prénommedecin; int codemedecin; SVC.Patient pa; if (Création == true && member.CréationPatient == true && txtMedecin.SelectedItem != null && txtDate.SelectedDate != null && SexeCombo.SelectedValuePath != null && EtatCivicCombo.SelectedValuePath != null) { try { SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; if (SelectMedecin != null) { nommedecin = SelectMedecin.Nom; prénommedecin = SelectMedecin.Prénom; codemedecin = SelectMedecin.Id; } else { nommedecin = ""; prénommedecin = ""; codemedecin = 0; } /*****************transfert***********************/ serverfilepath = op.FileName; filepath = ""; if (serverfilepath != "") { filepath = op.FileName; serverfilepath = @"Patient\PhotoPatient\" + (txtNom.Text.Trim() + txtPrenom.Text.Trim()) + ".png"; byte[] buffer = null; // read the file and return the byte[ using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read)) { buffer = new byte[fs.Length]; fs.Read(buffer, 0, (int)fs.Length); } if (buffer != null) { proxy.UploadDocument(serverfilepath, buffer); } } pa = new SVC.Patient { Nom = txtNom.Text.Trim(), Prénom = txtPrenom.Text.Trim(), Adresse = txtAdresse.Text.Trim(), Téléphone = txtTelfixe.Text.Trim(), EtatCiv = EtatCivicCombo.SelectionBoxItem.ToString(), Sexe = SexeCombo.SelectionBoxItem.ToString(), DateDeNaissance = txtDate.SelectedDate, NuméroSS = txtSS.Text.Trim(), Assurance = txtAssurance.Text.Trim(), Fonction = txtFonction.Text.Trim(), Mobile = txtTelPerso.Text.Trim(), Remarques = txtRemarque.Text.Trim(), Email = txtEmail.Text.Trim(), SuiviParNom = nommedecin, SuiviParPrénom = prénommedecin, CheminPhoto = serverfilepath, cle = txtNom.Text.Trim() + txtPrenom.Text.Trim() + DateTime.Now, SuiviParCode = codemedecin, GroupeSanguin = GroupeTXT.Text.Trim(), }; if (DossierTXT.Text != "") { pa.Dossier = Convert.ToInt16(DossierTXT.Text); /********************************************************/ } else { pa.Dossier = 0; } if (txtRéf.Text != "") { pa.Ref = Convert.ToInt16(txtRéf.Text); /********************************************************/ } else { pa.Ref = 0; } if (txtCrédit.Text != "") { pa.Solde = Convert.ToDecimal(txtCrédit.Text); /********************************************************/ } else { pa.Solde = 0; } bool succéespatient = false; bool succéesvisite = false; int interfaceoper; using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { proxy.InsertPatient(pa); interfaceoper = 0; succéespatient = true; if (pa.Solde != 0) { interfaceoper = 1; succéesvisite = true; SVC.Visite cas = new SVC.Visite { Motif = "Ancien Solde", Interrogatoire = "Ancien Solde", Examen = "Ancien Solde", Conclusions = "Ancien Solde", Date = DateTime.Now, Datetime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second), CasTraite = "Ancien Solde", NuméroRendezVous = "Ancien Solde", UserName = member.UserName, NomPatient = pa.Nom, PrénomPatient = pa.Prénom, Montant = pa.Solde, Versement = 0, Reste = pa.Solde, Soldé = false, CodePatient = 0, IdCas = 0, IdMotif = 0, ModeFacturation = 0, cle = pa.cle, VisiteParNom = nommedecin, VisiteParPrénom = prénommedecin, CodeMedecin = codemedecin, }; proxy.InsertVisite(cas); } if (interfaceoper == 0 && succéespatient == true) { ts.Complete(); btnCreer.IsEnabled = false; rempliridsivisite(pa); } else { if (interfaceoper == 1 && succéespatient == true && succéesvisite == true) { ts.Complete(); } else { btnCreer.IsEnabled = false; MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } } if (interfaceoper == 0 && succéespatient == true) { proxy.AjouterPatientRefresh(); // proxy.AjouterSoldeVisiteRefresh(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); this.Close(); } else { if (interfaceoper == 1 && succéespatient == true && succéesvisite == true) { proxy.AjouterPatientRefresh(); proxy.AjouterSoldeVisiteRefresh(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); this.Close(); } } /* proxy.AjouterPatientRefresh(); * proxy.AjouterSoldeVisiteRefresh();*/ } catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } else { try { if (Création == false && member.ModificationPatient == true && txtMedecin.SelectedItem != null && txtDate.SelectedDate != null && SexeCombo.SelectedValuePath != null && EtatCivicCombo.SelectedValuePath != null) { bool succesUpdatePatient = false; bool succesUpdateVisite = false; SVC.Medecin SelectMedecin = txtMedecin.SelectedItem as SVC.Medecin; if (SelectMedecin != null) { patient.SuiviParNom = SelectMedecin.Nom; patient.SuiviParPrénom = SelectMedecin.Prénom; patient.SuiviParCode = SelectMedecin.Id; } if (DossierTXT.Text != "") { patient.Dossier = Convert.ToInt16(DossierTXT.Text); /********************************************************/ } else { patient.Dossier = 0; } if (txtRéf.Text != "") { patient.Ref = Convert.ToInt16(txtRéf.Text); /********************************************************/ } else { patient.Ref = 0; } if (op.FileName != "") { serverfilepath = op.FileName; filepath = ""; if (patient.CheminPhoto == "") { if (serverfilepath != "") { filepath = op.FileName; serverfilepath = @"Patient\PhotoPatient\" + (txtNom.Text.Trim() + txtPrenom.Text.Trim()) + ".png"; byte[] buffer = null; // read the file and return the byte[ using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read)) { buffer = new byte[fs.Length]; fs.Read(buffer, 0, (int)fs.Length); } if (buffer != null) { proxy.UploadDocument(serverfilepath, buffer); } patient.CheminPhoto = serverfilepath; } else { patient.CheminPhoto = ""; } } else { if (serverfilepath == "") { patient.CheminPhoto = ""; } else { filepath = op.FileName; serverfilepath = @"Patient\PhotoPatient\" + (txtNom.Text.Trim() + txtPrenom.Text.Trim()) + ".png"; byte[] buffer = null; // read the file and return the byte[ using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read)) { buffer = new byte[fs.Length]; fs.Read(buffer, 0, (int)fs.Length); } if (buffer != null) { proxy.UploadDocument(serverfilepath, buffer); } patient.CheminPhoto = serverfilepath; } } } else { patient.CheminPhoto = ""; } if (txtCrédit.Text != "") { patient.Solde = Convert.ToDecimal(txtCrédit.Text); } else { patient.Solde = 0; } patient.DateDeNaissance = txtDate.SelectedDate; var found = (proxy.GetAllVisiteByClepatient(patient.cle).Find(n => n.cle == patient.cle)); int interfaceModif = 3; using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { if (found != null) { if (patient.Solde != 0) { found.Montant = patient.Solde; found.Reste = patient.Solde - found.Versement; found.VisiteParNom = SelectMedecin.Nom; found.VisiteParPrénom = SelectMedecin.Prénom; found.CodeMedecin = SelectMedecin.Id; proxy.UpdateVisite(found); interfaceModif = 1; succesUpdateVisite = true; proxy.UpdatePatient(patient); succesUpdatePatient = true; } else { if (patient.Solde == 0) { if (found.Versement == 0) { proxy.DeleteVisite(found); interfaceModif = 1; succesUpdateVisite = true; proxy.UpdatePatient(patient); succesUpdatePatient = true; } else { MessageBoxResult results = Xceed.Wpf.Toolkit.MessageBox.Show("Attention erreur dans le solde patient qui contient un versement", Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } } } else { if (found == null) { if (patient.Solde != 0) { SVC.Visite cas = new SVC.Visite { Motif = "Ancien Solde", Interrogatoire = "Ancien Solde", Examen = "Ancien Solde", Conclusions = "Ancien Solde", Date = DateTime.Now, Datetime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second), CasTraite = "Ancien Solde", NuméroRendezVous = "Ancien Solde", UserName = member.UserName, NomPatient = patient.Nom, PrénomPatient = patient.Prénom, Montant = patient.Solde, Versement = 0, Reste = patient.Solde, Soldé = false, CodePatient = 0, IdCas = 0, IdMotif = 0, ModeFacturation = 0, cle = patient.cle, VisiteParNom = SelectMedecin.Nom, VisiteParPrénom = SelectMedecin.Prénom, CodeMedecin = SelectMedecin.Id, }; proxy.InsertVisite(cas); interfaceModif = 1; succesUpdateVisite = true; proxy.UpdatePatient(patient); succesUpdatePatient = true; } else { if (patient.Solde == 0) { interfaceModif = 0; proxy.UpdatePatient(patient); succesUpdatePatient = true; } } } } if (interfaceModif == 0 && succesUpdatePatient == true && succesUpdateVisite == false) { ts.Complete(); } else { if (interfaceModif == 1 && succesUpdatePatient == true && succesUpdateVisite == true) { ts.Complete(); } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } } if (interfaceModif == 0 && succesUpdatePatient == true && succesUpdateVisite == false) { // proxy.AjouterSoldeVisiteRefresh(); proxy.AjouterPatientRefresh(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); this.Close(); } else { if (interfaceModif == 1 && succesUpdatePatient == true && succesUpdateVisite == true) { proxy.AjouterSoldeVisiteRefresh(); proxy.AjouterPatientRefresh(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); this.Close(); } } } else { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.Opérationéchouée, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, 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); } }
private void btnFilter_Click(object sender, RoutedEventArgs e) { try { Boolean Value = false; if (DateVisiteDébut.SelectedDate != null && DateVisiteFin.SelectedDate != null) { if (chVisiteRegler.IsChecked == true) { Value = true; } else { if (chVisitenONRegler.IsChecked == true) { Value = false; } else { // Value = null; } } if (MedecinCombo.SelectedItem == null && PatientCombo.SelectedItem == null) { PatientDataGrid.ItemsSource = (proxy.GetAllVisite(DateVisiteDébut.SelectedDate.Value, DateVisiteFin.SelectedDate.Value)).Where(n => n.Soldé == Value); interfaceimpression = 3; } else { if (MedecinCombo.SelectedItem != null && PatientCombo.SelectedItem == null) { SVC.Medecin ValueFourn = MedecinCombo.SelectedItem as SVC.Medecin; PatientDataGrid.ItemsSource = (proxy.GetAllVisiteByVisiteMedecin(ValueFourn.Id)).Where(n => n.Date >= DateVisiteDébut.SelectedDate.Value && n.Date <= DateVisiteFin.SelectedDate.Value && n.Soldé == Value); // MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show("patient combo vide " + Value.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); interfaceimpression = 3; } else { if (MedecinCombo.SelectedItem == null && PatientCombo.SelectedItem != null) { SVC.Patient PatientSelected = PatientCombo.SelectedItem as SVC.Patient; PatientDataGrid.ItemsSource = (proxy.GetAllVisite(DateVisiteDébut.SelectedDate.Value, DateVisiteFin.SelectedDate.Value)).Where(n => (n.CodePatient == PatientSelected.Id || n.cle == PatientSelected.cle) && n.Soldé == Value); // MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show("medecin combo vide " + Value.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); interfaceimpression = 2; } else { if (MedecinCombo.SelectedItem != null && PatientCombo.SelectedItem != null) { SVC.Patient PatientSelected = PatientCombo.SelectedItem as SVC.Patient; SVC.Medecin ValueMedecin = MedecinCombo.SelectedItem as SVC.Medecin; PatientDataGrid.ItemsSource = (proxy.GetAllVisite(DateVisiteDébut.SelectedDate.Value, DateVisiteFin.SelectedDate.Value)).Where(n => (n.CodePatient == PatientSelected.Id || n.cle == PatientSelected.cle) && n.Soldé == Value && n.CodeMedecin == ValueMedecin.Id); // MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show("deux combo not vide " + Value.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); interfaceimpression = 2; } } } } } var test = PatientDataGrid.ItemsSource as IEnumerable <SVC.Visite>; txtAchat.Text = Convert.ToString((test).AsEnumerable().Sum(o => o.Montant)); TxtVersement.Text = Convert.ToString((test).AsEnumerable().Sum(o => o.Versement)); txtFournisseur.Text = Convert.ToString(((test).AsEnumerable().Sum(o => o.Reste))); }catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
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); } }
public void AddRefresh(SVC.Patient listmembership, int oper) { if (auto == false) { var LISTITEM1 = txtPatient.ItemsSource as IEnumerable <SVC.Patient>; List <SVC.Patient> LISTITEM = LISTITEM1.ToList(); if (oper == 1) { LISTITEM.Add(listmembership); } else { if (oper == 2) { // var objectmodifed = LISTITEM.Find(n => n.Id == listmembership.Id); // objectmodifed = listmembership; var objectmodifed = LISTITEM.Find(n => n.Id == listmembership.Id); //objectmodifed = listmembership; var index = LISTITEM.IndexOf(objectmodifed); if (index != -1) { LISTITEM[index] = listmembership; } } else { if (oper == 3) { // MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show("Supp rendezvous :"+ listmembership.Id.ToString(), GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); var deleterendez = LISTITEM.Where(n => n.Id == listmembership.Id).First(); LISTITEM.Remove(deleterendez); } } } txtPatient.ItemsSource = LISTITEM; } else { if (auto == true) { var LISTITEM11 = accbStates.ItemsSource as IEnumerable <SVC.Patient>; List <SVC.Patient> LISTITEM0 = LISTITEM11.ToList(); if (oper == 1) { LISTITEM0.Add(listmembership); } else { if (oper == 2) { //var objectmodifed = LISTITEM0.Find(n => n.Id == listmembership.Id); // var objectmodifed = listmembership; var objectmodifed = LISTITEM0.Find(n => n.Id == listmembership.Id); //objectmodifed = listmembership; var index = LISTITEM0.IndexOf(objectmodifed); if (index != -1) { LISTITEM0[index] = listmembership; } } else { if (oper == 3) { // MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show("Supp rendezvous :"+ listmembership.Id.ToString(), GestionClinique.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); var deleterendez = LISTITEM0.Where(n => n.Id == listmembership.Id).First(); LISTITEM0.Remove(deleterendez); } } } accbStates.ItemsSource = LISTITEM0; // accbStates.AutoCompleteManager.DataProvider = new SimpleStaticDataProvider(from c in LISTITEM0 // select c.Nom + " " + c.Prénom); // accbStates.AutoCompleteManager.AutoAppend = true; } } }
public void rempliridsivisite(SVC.Patient pa) { try { if (txtCrédit.Text != "") { var found = (proxy.GetAllPatient()).Find(n => n.Nom.Trim() == pa.Nom.Trim() && n.Prénom.Trim() == pa.Prénom.Trim()); /***********************************************/ if (found.Solde != 0) { bool interfaceVisite = false; using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { SVC.Visite cas = new SVC.Visite { Motif = "Ancien Solde", Interrogatoire = "Ancien Solde", Examen = "Ancien Solde", Conclusions = "Ancien Solde", Date = DateTime.Now, Datetime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second), CasTraite = "Ancien Solde", NuméroRendezVous = "Ancien Solde", UserName = member.UserName, NomPatient = found.Nom, PrénomPatient = found.Prénom, Montant = found.Solde, Versement = 0, Reste = found.Solde, Soldé = false, // CodePatient = 0, CodePatient = found.Id, IdCas = 0, IdMotif = 0, ModeFacturation = 0, // cle = "Ancien Solde" + 0, cle = "Ancien Solde" + found.Id, }; cas.VisiteParNom = member.UserName + " " + "User"; cas.VisiteParPrénom = member.Prénom + " " + "User"; cas.CodeMedecin = 1987; proxy.InsertVisite(cas); interfaceVisite = true; if (interfaceVisite == true) { ts.Complete(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBoxResult resultc1 = 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); } }
/*******************************************/ 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); } }
public void AddRefreshfourn(SVC.Patient listmembership, int oper) { try { if (medecinsession == false) { var LISTITEM11 = PatientCombo.ItemsSource as IEnumerable <SVC.Patient>; List <SVC.Patient> LISTITEM0 = LISTITEM11.ToList(); if (oper == 1) { LISTITEM0.Add(listmembership); } else { if (oper == 2) { var objectmodifed = LISTITEM0.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 = LISTITEM0.Where(n => n.Id == listmembership.Id).First(); LISTITEM0.Remove(deleterendez); } } } PatientCombo.ItemsSource = LISTITEM0; // PatientCombo.ItemsSource = listmembership.OrderBy(x => x.Nom); ; } else { if (listmembership.SuiviParCode == SELECTEDMEDECIN.Id) { var LISTITEM11 = PatientCombo.ItemsSource as IEnumerable <SVC.Patient>; List <SVC.Patient> LISTITEM0 = LISTITEM11.ToList(); if (oper == 1) { LISTITEM0.Add(listmembership); } else { if (oper == 2) { var objectmodifed = LISTITEM0.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 = LISTITEM0.Where(n => n.Id == listmembership.Id).First(); LISTITEM0.Remove(deleterendez); } } } PatientCombo.ItemsSource = LISTITEM0.OrderBy(x => x.Nom); } } } catch (Exception ex) { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }