|
|
@@ -5,6 +5,7 @@ using System.Drawing;
|
|
|
using System.Drawing.Imaging;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
+using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using com.healthmarketscience.jackcess.impl;
|
|
|
using Comal.Classes;
|
|
|
@@ -21,6 +22,8 @@ public class JobRequisitionPanelSettings : IUserConfigurationSettings, ISplitPan
|
|
|
{
|
|
|
public DynamicSplitPanelView ViewType { get; set; } = DynamicSplitPanelView.Combined;
|
|
|
|
|
|
+ public int TabIndex { get; set; }
|
|
|
+
|
|
|
public double AnchorWidth { get; set; } = 500;
|
|
|
}
|
|
|
|
|
|
@@ -41,8 +44,19 @@ public partial class JobRequisitionPanel : UserControl, IPanel<JobMaterial>, IMa
|
|
|
Settings = new UserConfiguration<JobRequisitionPanelSettings>().Load();
|
|
|
SplitPanel.AnchorWidth = Settings.AnchorWidth;
|
|
|
SplitPanel.View = Settings.ViewType;
|
|
|
+ SetDetailDisplay();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ private void SetDetailDisplay()
|
|
|
+ {
|
|
|
+ RequisitionsColumn.Width = Settings.ViewType == DynamicSplitPanelView.Combined
|
|
|
+ ? new GridLength(1, GridUnitType.Star)
|
|
|
+ : new GridLength(0, GridUnitType.Pixel);
|
|
|
+ SummaryColumn.Width = Settings.ViewType == DynamicSplitPanelView.Detail
|
|
|
+ ? new GridLength(1, GridUnitType.Star)
|
|
|
+ : new GridLength(0, GridUnitType.Pixel);
|
|
|
+ }
|
|
|
+
|
|
|
protected void SaveSettings()
|
|
|
{
|
|
|
Settings.AnchorWidth = SplitPanel.AnchorWidth;
|
|
|
@@ -54,7 +68,11 @@ public partial class JobRequisitionPanel : UserControl, IPanel<JobMaterial>, IMa
|
|
|
public Job? Master
|
|
|
{
|
|
|
get => Requisitions.Master;
|
|
|
- set => Requisitions.Master = value;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ Requisitions.Master = value;
|
|
|
+ Summary.JobID = value?.ID;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public bool IsReady { get; set; }
|
|
|
@@ -69,8 +87,8 @@ public partial class JobRequisitionPanel : UserControl, IPanel<JobMaterial>, IMa
|
|
|
public void Setup()
|
|
|
{
|
|
|
LoadSettings();
|
|
|
-
|
|
|
Requisitions.Refresh(true, false);
|
|
|
+ Summary.Refresh(true,false);
|
|
|
Items.Refresh(true, false);
|
|
|
}
|
|
|
|
|
|
@@ -80,16 +98,13 @@ public partial class JobRequisitionPanel : UserControl, IPanel<JobMaterial>, IMa
|
|
|
|
|
|
public void Refresh()
|
|
|
{
|
|
|
- if(Settings.ViewType == DynamicSplitPanelView.Detail)
|
|
|
- {
|
|
|
- Items.Master = null;
|
|
|
- Items.Job = Master;
|
|
|
- Items.Refresh(false, true);
|
|
|
- }
|
|
|
+ if (!IsReady)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (SplitPanel.View == DynamicSplitPanelView.Detail)
|
|
|
+ Summary.Refresh(false,true);
|
|
|
else
|
|
|
- {
|
|
|
Requisitions.Refresh(false, true);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public string SectionName => "Job Requisitions";
|
|
|
@@ -124,7 +139,9 @@ public partial class JobRequisitionPanel : UserControl, IPanel<JobMaterial>, IMa
|
|
|
SaveSettings();
|
|
|
if (changedView)
|
|
|
{
|
|
|
+ SetDetailDisplay();
|
|
|
Refresh();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|