public void Refresh() { filter = ClientRequests.getFilters(); TypeList.ItemsSource = filter.types.Select(x => x.type); CatagoryList.ItemsSource = filter.categories.Select(x => x.category); ServicesList.ItemsSource = filter.services.Select(x => x.name); }
public void addCatagory(object sender, RoutedEventArgs arg) { if (NewCatagory.Text == "") { MessageBox.Show("Cannot add blank name"); return; } ClientRequests.addCatagory(NewCatagory.Text); filter = ClientRequests.getFilters(); CatagoryList.ItemsSource = filter.categories.Select(x => x.category); }
public void addService(object sender, RoutedEventArgs arg) { if (NewService.Text == "") { MessageBox.Show("Cannot add blank name"); return; } ClientRequests.addService(NewService.Text); filter = ClientRequests.getFilters(); ServicesList.ItemsSource = filter.services.Select(x => x.name); }
public FilteView() { InitializeComponent(); dt = new DispatcherTimer(); dt.Tick += new EventHandler(AutoRefresh); dt.Interval = new TimeSpan(0, 5, 0); dt.Start(); filter = ClientRequests.getFilters(); TypeList.ItemsSource = filter.types.Select(x => x.type); CatagoryList.ItemsSource = filter.categories.Select(x => x.category); ServicesList.ItemsSource = filter.services.Select(x => x.name); DataContext = this; }
public void modifyType(object sender, RoutedEventArgs arg) { if (TypeList.SelectedItem == null) { MessageBox.Show("Please select Type to change"); return; } if (ModifyType.Text == "") { MessageBox.Show("Cannot add blank name"); return; } ClientRequests.modifyType((String)TypeList.SelectedItem, ModifyType.Text); filter = ClientRequests.getFilters(); TypeList.ItemsSource = filter.types.Select(x => x.type); }
public void modifyCategory(object sender, RoutedEventArgs arg) { if (CatagoryList.SelectedItem == null) { MessageBox.Show("Please select Catagory to change"); return; } if (ModifyCategory.Text == "") { MessageBox.Show("Cannot add blank name"); return; } ClientRequests.modifyCategory((String)CatagoryList.SelectedItem, ModifyCategory.Text); filter = ClientRequests.getFilters(); CatagoryList.ItemsSource = filter.categories.Select(x => x.category); }