123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 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<JobMaterial>
- {
- 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<JobMaterial>(new Filter<JobMaterial>(x => x.ID).InList(ids));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public void Refresh()
- {
- Summary.Refresh(false, true);
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- 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);
- }
- }
- }
|