1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using System.ComponentModel;
- using InABox.Core;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for JobEmployeePanel.xaml
- /// </summary>
- public partial class JobEmployeePanel : UserControl, IPanel<JobEmployee>, IJobControl
- {
- public JobEmployeePanel()
- {
- InitializeComponent();
- Employees.OnChanged += (o,e) => Qualifications.Refresh(false, true);
- }
- public Job Job
- {
- get => Employees.Job;
- set
- {
- Employees.Job = value;
- Qualifications.Job = value;
- }
- }
-
- public JobPanelSettings Settings { get; set; }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent OnUpdateDataModel;
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public string SectionName => "Job Employees";
- public DataModel DataModel(Selection selection)
- {
- var ids = Employees.ExtractValues(x => x.ID, selection).ToArray();
- return new JobEmployeeDataModel(new Filter<JobEmployee>(x => x.ID).InList(ids));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public void Refresh()
- {
- Qualifications.Refresh(false, true);
- Employees.Refresh(false, true);
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Setup()
- {
- Employees.Refresh(true, false);
- Qualifications.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public Dictionary<Type, CoreTable> DataEnvironment()
- {
- return new Dictionary<Type, CoreTable>();
- }
- }
- }
|