| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using Comal.Classes;
- using InABox.Core;
- using InABox.Wpf;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for ItemsPanel.xaml
- /// </summary>
- public partial class ReadyToGoPanel : UserControl, IPanel<DeliveryItem>
- {
- public ReadyToGoPanel()
- {
- InitializeComponent();
- }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent? OnUpdateDataModel;
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>(); // { { typeof(DeliveryItem).EntityName(), Items.SelectedRows } };
- }
- public void Setup()
- {
- Items.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public void Refresh()
- {
- Items.Refresh(false, true);
- }
- public string SectionName => "Ready To Go";
- public DataModel DataModel(Selection selection)
- {
- var ids = Items.ExtractValues(x => x.ID, selection).ToArray();
- return new DeliveryItemDataModel(new Filter<DeliveryItem>(x => x.ID).InList(ids));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public Type DataType()
- {
- return typeof(DeliveryItem);
- }
- private void SearchBox_KeyUp(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Enter)
- {
- Items.Search = SearchBox.Text;
- Items.Refresh(false, true);
- }
- }
- private void ClearSearchButton_Click(object sender, RoutedEventArgs e)
- {
- Items.Search = "";
- Items.Refresh(false, true);
- }
- }
- }
|