12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using System.ComponentModel;
- namespace PRSDesktop
- {
- public partial class JobSummaryPanel : UserControl, IJobControl, IPanel<JobMaterial>
- {
- public JobSummaryPanel()
- {
- InitializeComponent();
- }
- public Job Job
- {
- get => Summary.Job;
- set => Summary.Job = 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(CancelEventArgs? cancel)
- {
- }
-
- private void ReservedStock_OnChecked(object sender, RoutedEventArgs e)
- {
- Summary.IncludeReserves = ReservedStock.IsChecked == true;
- Summary.Refresh(false, true);
- }
- }
- }
|