12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System;
- using System.Collections.Generic;
- using System.Windows;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Clients;
- using InABox.Configuration;
- using InABox.Core;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for JobDock.xaml
- /// </summary>
- public partial class JobDock : UserControl, IDockPanel
- {
- private ProjectsGrid _projects;
- public JobDock()
- {
- InitializeComponent();
- }
-
- public void Setup()
- {
- _projects = new ProjectsGrid();
- _projects.SetValue(Grid.RowProperty, 1);
- _projects.ColumnsTag = "JobDock";
- _projects.Refresh(true, false);
- grid.Children.Add(_projects);
-
- var statustable = new Client<JobStatus>().Query(
- new Filter<JobStatus>(x => x.Active).IsEqualTo(true),
- Columns.None<JobStatus>().Add(
- x => x.ID,
- x => x.Description
- ),
- new SortOrder<JobStatus>(x => x.Description)
- );
- JobStatus.ItemsSource = statustable.IntoDictionary<JobStatus, Guid>(
- new Dictionary<Guid, string> { { Guid.Empty, "All Jobs" } },
- x => x.ID,
- x => x.Description
- );
- var settings = new UserConfiguration<JobScreenSettings>().Load();
- _projects.StatusID = settings.JobStatus;
- _projects.Refresh(true, false);
- }
- public void Refresh()
- {
- _projects.Refresh(false, true);
- }
- private void JobStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (_projects == null)
- return;
- _projects.StatusID = (Guid)JobStatus.SelectedValue;
- _projects.Refresh(false, true);
- }
- }
- }
|