123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using System.ComponentModel;
- using InABox.Core;
- using InABox.Wpf;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for JobEmployeePanel.xaml
- /// </summary>
- public partial class JobEmployeePanel : UserControl, IPanel<JobEmployee>, IMasterDetailControl<Job>
- {
- public JobEmployeePanel()
- {
- InitializeComponent();
- Employees.OnChanged += (o,e) => Qualifications.Refresh(false, true);
- }
- public Job? Master
- {
- get => Employees.Master;
- set
- {
- Employees.Master = value;
- Qualifications.Master = value;
- }
- }
-
- 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[]>
- { { typeof(JobEmployee).EntityName(), Employees.SelectedRows } };
- }
- public void Setup()
- {
- Employees.Refresh(true, false);
- Qualifications.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- }
- }
|