Exemplo n.º 1
0
        private void OnCompanyClicked(object sender, RoutedEventArgs e)
        {
            var         d      = (DataInvoice)((Label)sender).DataContext;
            CompanyPage window = new CompanyPage();

            window.DataContext = CompanyHelper.GetCompany(d.ABN);
            window.Owner       = Application.Current.MainWindow;
            window.Show();
        }
Exemplo n.º 2
0
 private bool SearchBarFilter(object item)
 {
     if (string.IsNullOrEmpty(Searchbar.Text))
     {
         return(true);
     }
     else
     {
         return(((item as DataInvoice).CompanyName.IndexOf(Searchbar.Text, StringComparison.OrdinalIgnoreCase) >= 0) ||
                ((item as DataInvoice).ABN.IndexOf(Searchbar.Text, StringComparison.OrdinalIgnoreCase) >= 0) ||
                ((item as DataInvoice).DisplayName.IndexOf(Searchbar.Text, StringComparison.OrdinalIgnoreCase) >= 0) ||
                (CompanyHelper.GetCompany((item as DataInvoice).ABN).Contacts.Where(a => a.Name.IndexOf(Searchbar.Text, StringComparison.OrdinalIgnoreCase) >= 0).Count() > 0));
     }
 }