|
@@ -4,21 +4,42 @@ using System.ComponentModel;
|
|
|
using System.Linq;
|
|
|
using System.Windows.Controls;
|
|
|
using Comal.Classes;
|
|
|
+using InABox.Configuration;
|
|
|
using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
using InABox.Wpf;
|
|
|
|
|
|
namespace PRSDesktop
|
|
|
{
|
|
|
+
|
|
|
+ public enum JobDesignsView
|
|
|
+ {
|
|
|
+ Unapproved,
|
|
|
+ Approved
|
|
|
+ }
|
|
|
+
|
|
|
+ public class JobDesignSettings : IUserConfigurationSettings
|
|
|
+ {
|
|
|
+ public JobDesignsView View { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Interaction logic for JobDesigns.xaml
|
|
|
/// </summary>
|
|
|
public partial class JobDesignPanel : UserControl, IPanel<Setout>, IMasterDetailControl<Job>
|
|
|
{
|
|
|
+
|
|
|
+ private JobDesignSettings _settings;
|
|
|
+
|
|
|
public JobDesignPanel()
|
|
|
{
|
|
|
+ _settings = new UserConfiguration<JobDesignSettings>().Load();
|
|
|
InitializeComponent();
|
|
|
+ DesignsTabControl.SelectedItem = _settings.View == JobDesignsView.Unapproved
|
|
|
+ ? UnapprovedTabItem
|
|
|
+ : ApprovedTabItem;
|
|
|
Designs.OnSelectItem += Designs_OnSelectItem;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public Job? Master
|
|
@@ -40,7 +61,7 @@ namespace PRSDesktop
|
|
|
}
|
|
|
|
|
|
public string SectionName => "Job Designs";
|
|
|
-
|
|
|
+
|
|
|
public DataModel DataModel(Selection selection)
|
|
|
{
|
|
|
var ids = Designs.ExtractValues(c => c.ID, selection).ToArray();
|
|
@@ -62,6 +83,7 @@ namespace PRSDesktop
|
|
|
|
|
|
public void Setup()
|
|
|
{
|
|
|
+ //DesignsTabControl.SelectedItem = ParentSettings
|
|
|
UnapprovedDesigns.Setup();
|
|
|
Designs.Refresh(true, false);
|
|
|
Documents.Refresh(true, false);
|
|
@@ -71,7 +93,11 @@ namespace PRSDesktop
|
|
|
private void DesignsTabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
{
|
|
|
if (e.Source == e.OriginalSource)
|
|
|
+ {
|
|
|
+ _settings.View = DesignsTabControl.SelectedItem == UnapprovedTabItem ? JobDesignsView.Unapproved : JobDesignsView.Approved;
|
|
|
+ new UserConfiguration<JobDesignSettings>().Save(_settings);
|
|
|
Refresh();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void Shutdown(CancelEventArgs? cancel)
|