using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Comal.Classes;
using System.ComponentModel;
using InABox.Core;
namespace PRSDesktop
{
///
/// Interaction logic for JobEmployeePanel.xaml
///
public partial class JobEmployeePanel : UserControl, IPanel, 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(x => x.ID).InList(ids));
}
public void Heartbeat(TimeSpan time)
{
}
public void Refresh()
{
Qualifications.Refresh(false, true);
Employees.Refresh(false, true);
}
public Dictionary Selected()
{
return new Dictionary();
}
public void Setup()
{
Employees.Refresh(true, false);
Qualifications.Refresh(true, false);
}
public void Shutdown(CancelEventArgs? cancel)
{
}
public Dictionary DataEnvironment()
{
return new Dictionary();
}
}
}