コード例 #1
0
ファイル: JobList.xaml.cs プロジェクト: Sammo351/HubV2
        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();
        }
コード例 #2
0
        public async void GetAllCompanies()
        {
            DataCompany[] allCompanies = await CompanyHelper.GetAllCompanies();

            for (int i = 0; i < allCompanies.Length; i++)
            {
                DataCompany c = allCompanies[i];
                Companies.Add(c);
            }

            ListboxCompanies.ItemsSource = Companies;
        }
コード例 #3
0
ファイル: InvoiceList.xaml.cs プロジェクト: Sammo351/HubV2
 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));
     }
 }
コード例 #4
0
ファイル: CompanyPage.xaml.cs プロジェクト: Sammo351/HubV2
 private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     ReadOnly = !ReadOnly;
     EditingLabel.Visibility = ReadOnly ? Visibility.Collapsed : Visibility.Visible;
     if (ReadOnly)
     {
         var r = MessageBox.Show("Are you sure you wish to make changes to the company? This cannot be undone.", "Are you sure?", MessageBoxButton.OKCancel);
         if (r == MessageBoxResult.OK)
         {
             var dataCompany = (DataCompany)DataContext;
             dataCompany.ABN          = TextboxABN.Text;
             dataCompany.CompanyName  = TextboxCompanyName.Text;
             dataCompany.OfficeNumber = TextboxOfficeNumber.Text;
             dataCompany.Email        = TextboxEmail.Text;
             CompanyHelper.SaveChanges(dataCompany);
         }
     }
 }
コード例 #5
0
ファイル: CompanyPage.xaml.cs プロジェクト: Sammo351/HubV2
 private void SaveAllButton_Click(object sender, RoutedEventArgs e)
 {
     CompanyHelper.SaveChanges((DataCompany)DataContext);
 }