private void txtRecherche_TextChanged(object sender, TextChangedEventArgs e) { try { TextBox t = (TextBox)sender; string filter = t.Text; ICollectionView cv = CollectionViewSource.GetDefaultView(FournDataGrid.ItemsSource); if (filter == "") { cv.Filter = null; } else { cv.Filter = o => { SVC.Depeiment p = o as SVC.Depeiment; if (t.Name == "txtId") { return(p.Id == Convert.ToInt32(filter)); } return(p.paiem.ToUpper().Contains(filter.ToUpper())); }; } } catch (Exception ex) { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop); } }
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 void AddRefresh(SVC.Depeiment listmembership, int oper) { try { var LISTITEM1 = FournDataGrid.ItemsSource as IEnumerable <SVC.Depeiment>; List <SVC.Depeiment> LISTITEM = LISTITEM1.ToList(); if (listmembership.cle == VisiteAregler.cle) { 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); } } FournDataGrid.ItemsSource = LISTITEM; } } } catch (Exception ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void btnImprimer_Click(object sender, RoutedEventArgs e) { try { if (MemberUser.ImressionCaisse == true && FournDataGrid.SelectedItem != null) { SVC.Depeiment selectdepeiemt = FournDataGrid.SelectedItem as SVC.Depeiment; List <SVC.Visite> vs = new List <SVC.Visite>(); vs.Add(VisiteAregler); List <SVC.Depeiment> dp = new List <SVC.Depeiment>(); dp.Add(selectdepeiemt); ImpressionRecu cl = new ImpressionRecu(proxy, dp, vs); cl.Show(); } else { MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("Vous devez sélectionner un réglement", 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); } }
private void btnSupp_Click(object sender, RoutedEventArgs e) { try { if (MemberUser.SuppréssionCaisse == true && FournDataGrid.SelectedItem != null) { try { SVC.Depeiment selectdepaief = FournDataGrid.SelectedItem as SVC.Depeiment; if (selectdepaief.Multiple == false) { bool SupDepaif = false; bool SupDepanse = false; bool UpdateRecouf = false; var depense = (proxy.GetAllDepense()).Find(n => n.cle == selectdepaief.cle && n.Crédit == true && n.MontantCrédit == selectdepaief.montant); var Recouf = (proxy.GetAllVisiteByVisite(selectdepaief.CodePatient.Value)).Find(n => n.cle == selectdepaief.cle); using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { /*suprimez l'écriture de depaief*/ proxy.DeleteDepeiment(selectdepaief); SupDepaif = true; // MessageBoxResult result11 = Xceed.Wpf.Toolkit.MessageBox.Show("paiement succées", "Medicus", MessageBoxButton.OK, MessageBoxImage.Information); /* suprimez l'écriture de depanse*/ proxy.DeleteDepense(depense); SupDepanse = true; // MessageBoxResult result1g1 = Xceed.Wpf.Toolkit.MessageBox.Show("Deletedepense succées", "Medicus", MessageBoxButton.OK, MessageBoxImage.Information); /* update recouf c-a-d enlevez le montant */ Recouf.Reste = Recouf.Reste + selectdepaief.montant; Recouf.Versement = Recouf.Versement - selectdepaief.montant; if (Recouf.Reste != 0) { Recouf.Soldé = false; } proxy.UpdateVisite(Recouf); UpdateRecouf = true; // MessageBoxResult result1g1d = Xceed.Wpf.Toolkit.MessageBox.Show("Visite yes", "Medicus", MessageBoxButton.OK, MessageBoxImage.Information); if (SupDepaif == true && SupDepanse == true && UpdateRecouf == true) { ts.Complete(); MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.OperationSuccées, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information); } } proxy.AjouterDepenseRefresh(); proxy.AjouterSoldeVisiteRefresh(); proxy.AjouterTransactionPaiementRefresh(); } else { if (selectdepaief.Multiple == true) { bool SuppDepeiement = false; bool SupDepense = false; bool SupDepeiementMultiple = false; bool UpdateVisite = false; List <SVC.Visite> listvisite = new List <SVC.Visite>(); MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("Attention ! Vous allez supprimez un versement multiple qui va affecter d'autres enregistrements !veuillez confirmez votre choix", Medicus.Properties.Resources.SiteWeb, MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { var depense = (proxy.GetAllDepense()).Find(n => n.cle == selectdepaief.cle && n.Crédit == true && n.MontantCrédit == selectdepaief.montant); var depeiememultipl = (proxy.GetAllDepeiementMultiple()).Where(n => n.cleMultiple == selectdepaief.CleMultiple).ToList(); foreach (SVC.DepeiementMultiple itemmultiple in depeiememultipl) { SVC.Visite selectedvisite = proxy.GetAllVisiteByVisite(itemmultiple.CodePatient.Value).Find(n => n.cle == itemmultiple.cleVisite); if (!listvisite.Contains(selectedvisite)) { listvisite.Add(selectedvisite); } } using (var ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { proxy.DeleteDepeiment(selectdepaief); SuppDepeiement = true; proxy.DeleteDepense(depense); SupDepense = true; for (int i = depeiememultipl.Count - 1; i >= 0; i--)/*deux critére 1er connécté plus le parcour de la liste*/ { var itemvisite = depeiememultipl.ElementAt(i); SVC.Visite updatevisiteselected = listvisite.Find(n => n.cle == itemvisite.cleVisite); UpdateVisite = false; updatevisiteselected.Reste = updatevisiteselected.Reste + itemvisite.montant; updatevisiteselected.Versement = updatevisiteselected.Versement - itemvisite.montant; if (updatevisiteselected.Reste != 0) { updatevisiteselected.Soldé = false; } proxy.UpdateVisite(updatevisiteselected); UpdateVisite = true; SupDepeiementMultiple = false; proxy.DeleteDepeiementMultiple(itemvisite); SupDepeiementMultiple = true; } if (SuppDepeiement == true && SupDepense == true && UpdateVisite == true && SupDepeiementMultiple == 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éeTransaction, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error); } } proxy.AjouterDepenseRefresh(); proxy.AjouterSoldeVisiteRefresh(); proxy.AjouterTransactionPaiementRefresh(); } } } } catch (FaultException ex) { MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, 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); } }