Пример #1
0
        private bool IsMatch(object item, string value)
        {
            bool societeMatch = false;

            if (!(item is ContactVueModele))
            {
                return(false);
            }

            value = value.ToUpper();

            ContactVueModele p = (ContactVueModele)item;

            Personne person = p.Contact;

            if (person.GetType() == typeof(Client))
            {
                Client client = (Client)person;
                if (null != client.Societe)
                {
                    societeMatch = client.Societe.ToUpper().Contains(value);
                }
            }

            return(p.Contact.Nom.ToUpper().Contains(value) || p.Contact.Prenom.ToUpper().Contains(value) || societeMatch);
        }
Пример #2
0
        private void AjoutAmi()
        {
            ContactVueModele cvm = new ContactVueModele(new Ami {
                Nom = "Nouvel", Prenom = "Ami"
            });

            cvm.delFromList += DelFromList;
            ListeContacts.Add(cvm);
        }
Пример #3
0
        private void AjoutClient()
        {
            ContactVueModele cvm = new ContactVueModele(new Client {
                Nom = "Nouveau", Prenom = "Client"
            });

            cvm.delFromList += DelFromList;
            ListeContacts.Add(cvm);
        }
Пример #4
0
        public ContactsVueModele()
        {
            List <Personne> personnes = ContactEFService.Instance.Load();

            //List<Personne> personnes = ContactService.Instance.Load();

            listeContacts = new ObservableCollection <ContactVueModele>();

            foreach (Personne personne in personnes)
            {
                ContactVueModele cvm = new ContactVueModele(personne);
                cvm.delFromList += DelFromList;
                listeContacts.Add(cvm);
            }

            collectionView = CollectionViewSource.GetDefaultView(listeContacts);
            collectionView.CurrentChanged += OnCollectionViewCurrentChanged;
            collectionView.MoveCurrentToFirst();
        }