Exemple #1
0
 private void txtRecherche_TextChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
 {
     try
     {
         TextEdit        t      = (TextEdit)sender;
         string          filter = t.Text;
         ICollectionView cv     = CollectionViewSource.GetDefaultView(PatientDataGrid.ItemsSource);
         if (filter == "")
         {
             cv.Filter = null;
         }
         else
         {
             cv.Filter = o =>
             {
                 SVC.Depense p = o as SVC.Depense;
                 if (t.Name == "txtId")
                 {
                     return(p.Id == Convert.ToInt32(filter));
                 }
                 return(p.RubriqueComptable.ToUpper().Contains(filter.ToUpper()));
             };
         }
     }
     catch (Exception ex)
     {
         MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemple #2
0
 private void btnSupp_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (memberuser.SuppréssionCaisse == true && PatientDataGrid.SelectedItem != null)
         {
             SVC.Depense SelectMedecin = PatientDataGrid.SelectedItem as SVC.Depense;
             if (SelectMedecin.Auto != true)
             {
                 MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxQuestionOperation, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.YesNo, MessageBoxImage.Question);
                 if (result == MessageBoxResult.Yes)
                 {
                     using (var ts = new TransactionScope())
                     {
                         proxy.DeleteDepense(SelectMedecin);
                         ts.Complete();
                     }
                     proxy.AjouterDepenseRefresh();
                 }
             }
             else
             {
                 MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxEcriutreautomatique, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Exclamation);
             }
         }
     }catch (Exception ex)
     {
         MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
     }
 }
Exemple #3
0
        private void btnImprimer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (memberuser.ImressionCaisse == true)
                {
                    var itemsSource0 = PatientDataGrid.ItemsSource as IEnumerable <SVC.Depense>;
                    List <SVC.Depense> itemsSource1  = new List <SVC.Depense>();
                    DateTime           dateinfreport = DateTime.Now;
                    foreach (SVC.Depense item in itemsSource0)
                    {
                        if (item.DateDebit <= dateinfreport)
                        {
                            dateinfreport = Convert.ToDateTime(item.DateDebit);
                        }
                        itemsSource1.Add(item);
                    }
                    var         soldedepartmontant = proxy.GetAllDepense().Where(n => n.DateDebit < Convert.ToDateTime(dateinfreport)).AsEnumerable().Sum(o => o.MontantCrédit - o.Montant);
                    SVC.Depense soldedepart        = new SVC.Depense
                    {
                        CompteDébité      = "Solde de départ",
                        DateSaisie        = dateinfreport,
                        DateDebit         = dateinfreport,
                        Username          = "******",
                        ModePaiement      = "Solde de départ",
                        RubriqueComptable = "Solde de départ",
                    };
                    if (soldedepartmontant < 0)
                    {
                        soldedepart.Montant       = soldedepartmontant * -1;
                        soldedepart.MontantCrédit = 0;
                    }
                    else
                    {
                        soldedepart.Montant       = 0;
                        soldedepart.MontantCrédit = soldedepartmontant;
                    }

                    itemsSource1.Insert(0, soldedepart);
                    ImpressionMouvement cl = new ImpressionMouvement(proxy, itemsSource1);
                    cl.Show();
                }
                else
                {
                    MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemple #4
0
        public void AddRefresh(SVC.Depense listmembership, int oper)
        {
            try
            {
                var LISTITEM1 = PatientDataGrid.ItemsSource as IEnumerable <SVC.Depense>;
                List <SVC.Depense> 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;

                // PatientDataGrid.ItemsSource = proxy.GetAllDepense();
                var test = PatientDataGrid.ItemsSource as IEnumerable <SVC.Depense>;
                txtDebit.Text   = Convert.ToString((LISTITEM).AsEnumerable().Sum(o => o.Montant));
                TxtCreebit.Text = Convert.ToString((LISTITEM).AsEnumerable().Sum(o => o.MontantCrédit));
                txtSolde.Text   = Convert.ToString((LISTITEM).AsEnumerable().Sum(o => o.MontantCrédit) - ((test).AsEnumerable().Sum(o => o.Montant)));
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Exemple #5
0
        /*  private void txtRecherche_TextChanged(object sender, TextChangedEventArgs e)
         * {
         *    TextBox t = (TextBox)sender;
         *    string filter = t.Text;
         *    ICollectionView cv = CollectionViewSource.GetDefaultView(PatientDataGrid.ItemsSource);
         *    if (filter == "")
         *        cv.Filter = null;
         *    else
         *    {
         *        cv.Filter = o =>
         *        {
         *            SVC.Depense p = o as SVC.Depense;
         *            if (t.Name == "txtId")
         *                return (p.Id == Convert.ToInt32(filter));
         *            return (p.RubriqueComptable.ToUpper().Contains(filter.ToUpper()));
         *        };
         *    }
         * }*/

        private void ClientsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                if (PatientDataGrid.SelectedItem != null && memberuser.ModificationCaisse == true)
                {
                    SVC.Depense SelectMedecin = PatientDataGrid.SelectedItem as SVC.Depense;
                    if (SelectMedecin.Auto == false)
                    {
                        AjouterTransaction bn = new AjouterTransaction(proxy, memberuser, callback, SelectMedecin, 1, null, null);
                        bn.Show();
                    }
                    else
                    {
                        MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxEcriutreautomatique, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    }
                }
            }catch (Exception ex)
            {
                MessageBoxResult resultc1 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }