12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Controls;
- using InABox.Core;
- using InABox.DynamicGrid;
- using InABox.Wpf;
- namespace PRSDesktop;
- public partial class PostCodePanel : UserControl, IPanel<Country>
- {
- public PostCodePanel()
- {
- InitializeComponent();
- }
- private void CountryGrid_OnOnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- StateGrid.CountryId = CountryGrid.SelectedRows.FirstOrDefault()?.Get<Country, Guid>(x => x.ID) ?? Guid.Empty;
- StateGrid.Refresh(false,true);
-
- LocalityGrid.StateId = Guid.Empty;
- LocalityGrid.Refresh(false,true);
- }
-
- private void StateGrid_OnOnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- LocalityGrid.StateId = StateGrid.SelectedRows.FirstOrDefault()?.Get<State, Guid>(x => x.ID) ?? Guid.Empty;
- LocalityGrid.Refresh(false,true);
- }
- public void Setup()
- {
- LocalityTree.Refresh(true,false);
- CountryGrid.Refresh(true,false);
- StateGrid.Refresh(true,false);
- LocalityGrid.Refresh(true,false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
-
- }
- public void Refresh()
- {
- LocalityTree.Refresh(false,true);
- CountryGrid.Refresh(false,true);
- StateGrid.Refresh(false,true);
- LocalityGrid.Refresh(false,true);
- }
- public string SectionName { get; }
-
- public DataModel DataModel(Selection selection)
- {
- return new AutoDataModel<Locality>(null);
- }
- public event DataModelUpdateEvent? OnUpdateDataModel;
-
- public bool IsReady { get; set; }
-
- public void CreateToolbarButtons(IPanelHost host)
- {
-
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Heartbeat(TimeSpan time)
- {
-
- }
- }
|