1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for EmployeePanel.xaml
- /// </summary>
- public partial class EmployeePanel : UserControl, IPanel<Employee>
- {
- public EmployeePanel()
- {
- InitializeComponent();
- }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent OnUpdateDataModel;
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]> { { 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<Employee>(new Filter<Employee>(x => x.ID).InList(ids));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public Dictionary<Type, CoreTable> DataEnvironment()
- {
- var env = new Dictionary<Type, CoreTable>();
- env[typeof(Job)] = Employees.Data;
- return env;
- }
- }
- }
|