using System; using System.Collections.Generic; using System.Linq; using System.Windows.Controls; using Comal.Classes; using InABox.Core; namespace PRSDesktop { /// /// Interaction logic for EmployeePanel.xaml /// public partial class EmployeePanel : UserControl, IPanel { public EmployeePanel() { InitializeComponent(); } public bool IsReady { get; set; } public event DataModelUpdateEvent OnUpdateDataModel; public Dictionary Selected() { return new Dictionary { { typeof(Employee).EntityName(), Employees.SelectedRows } }; } public void Setup() { Employees.Refresh(true, false); } public void Shutdown() { } public void CreateToolbarButtons(IPanelHost host) { } public void Refresh() { Employees.Refresh(false, true); } public string SectionName => "Employees"; public DataModel DataModel(Selection selection) { var ids = Employees.ExtractValues(x => x.ID, selection).ToArray(); return new AutoDataModel(new Filter(x => x.ID).InList(ids)); } public void Heartbeat(TimeSpan time) { } public Dictionary DataEnvironment() { var env = new Dictionary(); env[typeof(Job)] = Employees.Data; return env; } } }