1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using Comal.Classes;
- using InABox.Core;
- 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()
- {
- }
- 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);
- }
- }
- }
|