using System; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using Comal.Classes; using InABox.Core; namespace PRSDesktop { public partial class JobSummaryPanel : UserControl, IJobControl, IPanel { public JobSummaryPanel() { InitializeComponent(); } public Guid ParentID { get => Summary.ParentID; set => Summary.ParentID = value; } public JobPanelSettings Settings { get; set; } public bool IsReady { get; set; } public event DataModelUpdateEvent OnUpdateDataModel; public void CreateToolbarButtons(IPanelHost host) { } public string SectionName => "Job Summary"; public DataModel DataModel(Selection selection) { // This won't work - it needs to incldue all the fields, because AutoTables like this don't have an ID :-( var ids = Summary.ExtractValues(x => x.ID, selection).ToArray(); return new AutoDataModel(new Filter(x => x.ID).InList(ids)); } public void Heartbeat(TimeSpan time) { } public void Refresh() { Summary.Refresh(false, true); } public Dictionary Selected() { return new Dictionary(); } public void Setup() { Summary.Refresh(true, false); } public void Shutdown() { } private void ReservedStock_OnChecked(object sender, RoutedEventArgs e) { Summary.IncludeReserves = ReservedStock.IsChecked == true; Summary.Refresh(false, true); } } }