STN Asset Movements and Berthings.

This commit is contained in:
Andy Howard
2019-08-15 18:40:02 +01:00
parent 3e25524057
commit a9047daf8a
75 changed files with 1050 additions and 498 deletions
+12 -4
View File
@@ -64,10 +64,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
{
get
{
if (SaxApplication.MinDeviceDimension > 2000) return "18px";
if (SaxApplication.MinDeviceDimension > 1600) return "16px";
if (SaxApplication.MinDeviceDimension > 1200) return "14px";
return "12px";
if (SaxApplication.MinDeviceDimension > 2000) return "14pt";
if (SaxApplication.MinDeviceDimension > 1600) return "13pt";
if (SaxApplication.MinDeviceDimension > 1200) return "12pt";
if (SaxApplication.MinDeviceDimension > 1000) return "11pt";
return "10pt";
}
}
public static double FontSizeRatio
@@ -99,11 +100,18 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
public static float ItemListHeaderBorderRadius = 6.0f;
public static Color ItemListHeaderBorderColor = ApplicationBarBackgroundColor;
public static Color ItemListHeaderBackgroundColor = Color.FromHex("#F0F0F0");
// Forms.
public static double FormGridRowSpacing { get; } = 4.0;
public static double FormGridColumnSpacing { get; } = 4.0;
// Controls.
public static Color ControlBackgroundColor { get; } = Color.FromHex("#F8F8F8");
public static Color ControlBorderColor { get; } = Color.FromHex("#E0E0E0");
public static double ControlBorderWidth { get; } = 0.5;
public static Thickness LabelMargin { get; } = new Thickness(4.0, 8.0, 0, 0);
// Tab controls.
public static Color TabControlHeaderBackgroundColor { get; } = Color.Transparent;
public static Color TabControlCaptionBackgroundColor { get; } = Color.FromHex("#E0E0E0");
public static Color TabControlBodyBackgroundColor { get; } = Color.FromHex("#F8F8F8");
// Associated items panel.
public static Color AssociatedItemsCaptionBackgroundColor { get; } = Color.FromHex("#becee4");
public static Color AssociatedItemsCaptionTextColor { get; } = Color.FromHex("#f8f8f8");
@@ -1,4 +1,5 @@
using Sarand.Core.Mobile.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
using System;
using System.Collections.Generic;
using System.Text;
@@ -7,7 +8,7 @@ using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
{
//=======================================================================
public class SlmComponents : SaxComponents
public class SlmComponents : SlmPanel
{
//-------------------------------------------------------------------
// Definitions.
@@ -23,6 +24,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
public bool Changed { get; protected set; } = false;
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
@@ -1,5 +1,7 @@
using Sarand.Core.Base;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using System;
using System.Collections.Generic;
@@ -7,7 +9,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public abstract class SlmControlView : SlmContentView
@@ -20,11 +22,9 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Components.
private SlmContentView outerView = new SlmContentView();
private SlmContentView embeddedView = new SlmContentView();
private readonly SlmLabel labelReadOnly = new SlmLabel();
// Styling.
private Thickness borderThickness = new Thickness();
private Color borderColor = Color.Transparent;
private bool readOnly = false;
//-------------------------------------------------------------------
// Construction.
@@ -40,8 +40,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
BorderWidth = SlmMobile.ControlBorderWidth;
// Read-only label configuration.
labelReadOnly.BackgroundColor = Color.Transparent;
labelReadOnly.Margin = new Thickness(SlmMobile.LabelMargin.Left, SlmMobile.LabelMargin.Top);
ReadOnlyLabel.BackgroundColor = Color.Transparent;
ReadOnlyLabel.Margin = new Thickness(SlmMobile.LabelMargin.Left, SlmMobile.LabelMargin.Top);
SetControlActivity();
}
@@ -51,6 +51,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Label.
public SlmLabel Label { get; } = new SlmLabel() { Text = "" };
public String LabelText { get { return Label.Text; } set { if (Label.Text.Equals(value)) return; Label.Text = value; } }
/// <summary>Control used for read-only display.</summary>
protected SlmLabel ReadOnlyLabel { get; } = new SlmLabel() { Text = "" };
// Styling.
public Thickness BorderThickness
{
@@ -62,21 +64,16 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
set { BorderThickness = new Thickness(value); }
}
public Color BorderColor { get; set; }
public bool ReadOnly
{
get { return readOnly; }
set { if (readOnly == value) return; readOnly = value; SetControlActivity(); }
}
protected String ReadOnlyText
{
get{ return labelReadOnly.Text; }
set { if (labelReadOnly.Text.Equals(value)) return; labelReadOnly.Text = value; }
get{ return ReadOnlyLabel.Text; }
set { if (ReadOnlyLabel.Text.Equals(value)) return; ReadOnlyLabel.Text = value; }
}
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
//-------------------------------------------------------------------
/// <summary>Control configuration that can b changed dynamically.</summary>
/// <summary>Control configuration that can be changed dynamically.</summary>
protected override void ConfigureComponents ()
{
// Outer view acts as border.
@@ -93,11 +90,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
protected override void SetControlActivity ()
{
base.SetControlActivity();
SetControlsReadOnly();
}
protected override void SetControlsReadOnly ()
{
if (readOnly) Content = labelReadOnly;
base.SetControlsReadOnly();
if (ReadOnly) Content = ReadOnlyLabel;
}
//-------------------------------------------------------------------
@@ -118,21 +115,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// V i e w E v e n t s
//-------------------------------------------------------------------
protected override void OnParentSet ()
{
base.OnParentSet();
}
//-------------------------------------------------------------------
protected override void OnPropertyChanging ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanging(propertyName);
}
protected override void OnPropertyChanged ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
//Logger.Debug(GetType().Name + ".OnPropertyChanged Name=" + propertyName);
if (propertyName.EqualsCI("Padding"))
if (propertyName.EqualsCI(PaddingProperty.PropertyName))
{
if (!embeddedView.Padding.Equals(Padding))
{
@@ -141,25 +129,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
Padding = new Thickness();
}
}
else if (propertyName.EqualsCI("BackgroundColor"))
else if (propertyName.EqualsCI(BackgroundColorProperty.PropertyName))
{
embeddedView.BackgroundColor = BackgroundColor;
}
}
//-------------------------------------------------------------------
protected override void OnChildAdded (Element child)
{
base.OnChildAdded(child);
}
protected override void OnChildRemoved (Element child)
{
base.OnChildRemoved(child);
}
//-------------------------------------------------------------------
protected override void OnSizeAllocated (double width, double height)
{
base.OnSizeAllocated(width, height);
}
//-------------------------------------------------------------------
}
@@ -1,13 +1,12 @@
using Sarand.Core.Base;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmDatePickerView : SlmControlView
@@ -48,7 +47,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
//-------------------------------------------------------------------
/// <summary>Control configuration that can b changed dynamically.</summary>
/// <summary>Control configuration that can be changed dynamically.</summary>
protected override void ConfigureComponents ()
{
base.ConfigureComponents();
@@ -60,7 +59,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
protected override void SetControlActivity ()
{
base.SetControlActivity();
SetControlsReadOnly();
DatePicker.IsEnabled = IsEnabled;
}
protected override void SetControlsReadOnly ()
{
@@ -71,11 +70,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// V i e w E v e n t s
//-------------------------------------------------------------------
protected override void OnParentSet ()
{
base.OnParentSet();
}
//-------------------------------------------------------------------
protected override void OnPropertyChanging ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanging(propertyName);
@@ -83,16 +77,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
protected override void OnPropertyChanged ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
//Logger.Debug(GetType().Name + ".OnPropertyChanged Name=" + propertyName);
}
//-------------------------------------------------------------------
protected override void OnChildAdded (Element child)
{
base.OnChildAdded(child);
}
protected override void OnChildRemoved (Element child)
{
base.OnChildRemoved(child);
}
//-------------------------------------------------------------------
protected override void OnSizeAllocated (double width, double height)
@@ -0,0 +1,97 @@
using Sarand.Core.Base;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmDateTimePickerView : SlmControlView
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmDateTimePickerView (SlmDateTimePicker suppliedPicker = null)
{
// Control configuration.
if (suppliedPicker != null) DateTimePicker = suppliedPicker;
DateTimePicker.BackgroundColor = Color.Transparent;
// Control events.
DateTimePicker.BackgroundColor = Color.Transparent;
DateTimePicker.DateSelected += DateTimePicker_DateSelected;
DateTimePicker.Focused += DateTimePicker_Focused;
DateTimePicker.Unfocused += DateTimePicker_Unfocused;
ConfigureComponents();
SetControlActivity();
}
//-------------------------------------------------------------------
// Properties.
protected SlmDateTimePicker DateTimePicker { get; } = new SlmDateTimePicker();
public DateTime DateTime
{
get { return DateTimePicker.DateTime; }
set { if (DateTimePicker.DateTime.CompareTo(value) == 0) return; DateTimePicker.DateTime = value; }
}
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
//-------------------------------------------------------------------
/// <summary>Control configuration that can be changed dynamically.</summary>
protected override void ConfigureComponents ()
{
base.ConfigureComponents();
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
protected override void SetControlActivity ()
{
base.SetControlActivity();
DateTimePicker.IsEnabled = IsEnabled;
}
protected override void SetControlsReadOnly ()
{
base.SetControlsReadOnly();
if (!ReadOnly) Content = DateTimePicker;
}
//-------------------------------------------------------------------
// V i e w E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
public event EventHandler<DateChangedEventArgs> DateSelected;
private void DateTimePicker_DateSelected (object sender, DateChangedEventArgs e)
{
ReadOnlyText = DateTimePicker.FormattedDateTime;
if (ReadOnly) return;
if (DateSelected != null) DateSelected.Invoke(sender, e);
}
//-------------------------------------------------------------------
private void DateTimePicker_Focused (object sender, FocusEventArgs e)
{
Control_Focused(sender, e);
}
private void DateTimePicker_Unfocused (object sender, FocusEventArgs e)
{
Control_Unfocused(sender, e);
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -1,13 +1,12 @@
using Sarand.Core.Base;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmEditorView : SlmControlView
@@ -17,20 +16,21 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Data members.
private readonly SlmEditor entry = new SlmEditor();
private readonly SlmEditor editorControl = new SlmEditor();
//-------------------------------------------------------------------
// Construction.
public SlmEditorView ()
{
// Control configuration.
entry.BackgroundColor = Color.Transparent;
editorControl.BackgroundColor = Color.Transparent;
EditorVerticalOptions = LayoutOptions.FillAndExpand;
// Editor events.
entry.Focused += Editor_Focused;
entry.Unfocused += Editor_Unfocused;
entry.TextChanged += Editor_TextChanged;
entry.Completed += Editor_Completed;
editorControl.Focused += Editor_Focused;
editorControl.Unfocused += Editor_Unfocused;
editorControl.TextChanged += Editor_TextChanged;
editorControl.Completed += Editor_Completed;
ConfigureComponents();
SetControlActivity();
@@ -40,18 +40,37 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Properties.
public int MaxLength
{
get { return entry.MaxLength; }
set { entry.MaxLength = value; }
get { return editorControl.MaxLength; }
set { editorControl.MaxLength = value; }
}
public Keyboard Keyboard
{
get { return entry.Keyboard; }
set { entry.Keyboard = value; }
get { return editorControl.Keyboard; }
set { editorControl.Keyboard = value; }
}
public String Text
{
get { return entry.Text; }
set { value = StringUtil.EmptyOnNull(value); if (entry.Text != null && entry.Text.Equals(value)) return; entry.Text = value; }
get { return editorControl.Text; }
set { value = StringUtil.EmptyOnNull(value); if (editorControl.Text != null && editorControl.Text.Equals(value)) return; editorControl.Text = value; }
}
// Editor configuration.
public LayoutOptions EditorVerticalOptions
{
get { return editorControl.VerticalOptions; }
set
{
editorControl.VerticalOptions = value;
ReadOnlyLabel.VerticalOptions = value;
}
}
public LayoutOptions EditorHorizontalOptions
{
get { return editorControl.HorizontalOptions; }
set
{
editorControl.HorizontalOptions = value;
ReadOnlyLabel.HorizontalOptions = value;
}
}
//-------------------------------------------------------------------
@@ -74,7 +93,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
protected override void SetControlsReadOnly ()
{
base.SetControlsReadOnly();
if (!ReadOnly) Content = entry;
if (!ReadOnly) Content = editorControl;
}
//-------------------------------------------------------------------
@@ -94,7 +113,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
public event EventHandler<TextChangedEventArgs> TextChanged;
private void Editor_TextChanged (object sender, TextChangedEventArgs e)
{
ReadOnlyText = entry.Text;
ReadOnlyText = editorControl.Text;
if (ReadOnly) return;
if (TextChanged != null) TextChanged.Invoke(sender, e);
}
@@ -1,13 +1,13 @@
using Sarand.Core.Base;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmEntryView : SlmControlView
@@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmLabelView : SlmControlView
@@ -38,7 +38,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
//-------------------------------------------------------------------
/// <summary>Control configuration that can b changed dynamically.</summary>
/// <summary>Control configuration that can be changed dynamically.</summary>
protected override void ConfigureComponents ()
{
ReadOnly = true;
@@ -1,13 +1,15 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmPickerView : SlmControlView
@@ -48,22 +50,67 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
get { return picker.SelectedIndex; }
set { if (picker.SelectedIndex == value) return; picker.SelectedIndex = value; }
}
//public object SelectedItem { get { return picker.SelectedItem; } set { picker.SelectedItem = value; } }
public SlmPicker.SlmPickerItem SelectedPickerItem { get { return picker.SelectedPickerItem; } }
public object SelectedItem
public SysId SelectedItemId
{
get { return picker.SelectedItem; }
set { picker.SelectedItem = value; }
get { return picker.SelectedItemId; }
set { picker.SelectedItemId = value; }
}
public String SelectedItemCode
{
get { return picker.SelectedItemCode; }
set { picker.SelectedItemCode = value; }
}
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
//-------------------------------------------------------------------
/// <summary>Control configuration that can b changed dynamically.</summary>
/// <summary>Control configuration that can be changed dynamically.</summary>
protected override void ConfigureComponents ()
{
base.ConfigureComponents();
}
//-------------------------------------------------------------------
// P i c k e r D a t a
//-------------------------------------------------------------------
/// <summary>
/// Does the list contain an item with the same Id.
/// <para>NB Invalid Id values are matched.</para>
/// </summary>
public bool ContainsId (SysId id)
{
return picker.ContainsItemId(id);
}
/// <summary>
/// Does the list contain an item with the same code.
/// <para>NB Codes are case-insensitive.</para>
/// </summary>
public bool ContainsCode (string code)
{
return picker.ContainsItemCode(code);
}
//-------------------------------------------------------------------
/// <summary>
/// Add an item identified by a SysId value.
/// <para>NB Fails if an item already exists with the same id.</para>
/// </summary>
public bool AddItem (SysId id, String caption)
{
picker.AddItem(id, caption);
return true;
}
/// <summary>
/// Add an item identified by a code value.
/// <para>NB Fails if an item already exists with the same case-insensitive code.</para>
/// </summary>
public bool AddItem (String code, String caption)
{
picker.AddItem(code, caption);
return true;
}
//-------------------------------------------------------------------
// C o n t r o l A c t i v i t y
//-------------------------------------------------------------------
@@ -1,19 +1,17 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.CodeTypes;
using Sarand.Core.Tasks;
using Sarand.LogisticsMgr.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.CodeTypes;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmPickerView_CodeType : SlmPickerView
@@ -29,16 +27,15 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
get { return (Picker as SlmPicker_CodeType).CodeType; }
set { (Picker as SlmPicker_CodeType).CodeType = value; }
}
public bool ContainsCode (String code)
{
return Picker.ContainsItemCode(code);
}
public String SelectedCode
{
get { return (Picker as SlmPicker_CodeType).SelectedCode; }
set { (Picker as SlmPicker_CodeType).SelectedCode = value; }
}
//-------------------------------------------------------------------
// Utilities.
//-------------------------------------------------------------------
}
//=======================================================================
@@ -4,7 +4,7 @@ using Sarand.Core.Tasks;
using Sarand.LogisticsMgr.Core.App;
using Sarand.LogisticsMgr.Core.Bus;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using System;
using System.Collections.Generic;
@@ -12,7 +12,7 @@ using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmPickerView_Companies : SlmPickerView
@@ -1,19 +1,13 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.CodeTypes;
using Sarand.Core.Tasks;
using Sarand.LogisticsMgr.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.CodeTypes;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmPickerView_SiteDefinitions : SlmPickerView
@@ -1,19 +1,13 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.CodeTypes;
using Sarand.Core.Tasks;
using Sarand.LogisticsMgr.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.CodeTypes;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
{
//=======================================================================
public class SlmPickerView_SystemCodes : SlmPickerView
@@ -60,10 +54,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
public void PopulateSystemCodes ()
{
Items.Clear();
if (systemCodes.Count > 1)
AddItem("", "");
foreach (TypeCodeDesc systemCode in systemCodes)
{
AddItem(systemCode.Code, systemCode.Desc);
}
if (systemCodes.Count == 1)
SelectedItemCode = systemCodes[0].Code;
}
//-------------------------------------------------------------------
@@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmDatePicker : SaxDatePicker
@@ -30,7 +30,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Properties.
//-------------------------------------------------------------------
// P i c k e r E v e n t s
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
@@ -0,0 +1,39 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmDateTimePicker : SaxDateTimePicker
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmDateTimePicker ()
{
// Font sizing.
FontSize = FontSize * SlmMobile.FontSizeRatio;
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmEditor : SaxEditor
@@ -27,6 +27,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmEntry : SaxEntry
@@ -27,6 +27,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
@@ -0,0 +1,33 @@
using Sarand.Core.Mobile.Forms.Controls;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmImageButton : SaxImageButton
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmImageButton ()
{
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmLabel : SaxLabel
@@ -30,6 +30,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
@@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmPicker : SaxPicker
@@ -30,7 +30,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Properties.
//-------------------------------------------------------------------
// P i c k e r E v e n t s
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
@@ -0,0 +1,34 @@
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.Core.Mobile.Forms.Views;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmTabControl : SaxTabControl
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmTabControl ()
{
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,39 @@
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.App;
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
{
//=======================================================================
public class SlmTimePicker : SaxTimePicker
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmTimePicker ()
{
// Font sizing.
FontSize = FontSize * SlmMobile.FontSizeRatio;
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// C o n t r o l E v e n t s
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts
{
//=======================================================================
public class SlmStackLayout : SaxStackLayout
@@ -9,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
{
//=======================================================================
public class SlmContentPage : SaxContentPage
@@ -1,6 +1,9 @@
using Sarand.Core.Mobile.Forms.Controls;
using Sarand.LogisticsMgr.Core.WebService;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using System;
using System.Collections.Generic;
@@ -9,7 +12,7 @@ using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
{
//=======================================================================
public abstract class SlmFormPage : SlmContentPage
@@ -143,20 +146,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
buttonClose.Clicked += ButtonClose_Clicked;
}
//-------------------------------------------------------------------
/// <summary>
/// Add label and control to form grid.
/// <para>NB Control takes up 2 rows by default to allow for control pairs (control + button etc).</para>
/// </summary>
protected static void AddControlViewToGrid (SlmGrid grid, SlmControlView controlView)
{
int rowIdx = grid.RowDefinitions.Count;
grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
grid.Children.Add(controlView.Label, 0, rowIdx);
grid.Children.Add(controlView, 1, rowIdx);
Grid.SetColumnSpan(controlView, 2);
}
//-------------------------------------------------------------------
// C o n f i g u r e F o r m
//-------------------------------------------------------------------
@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
{
//=======================================================================
public class SlmMainPanel : SlmPanel
@@ -29,7 +29,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
{
this.config = new Config();
}
protected SlmMainPanel (Config config)
protected SlmMainPanel (Config config) : base(config)
{
this.config = config;
}
@@ -1,4 +1,5 @@
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using System;
using System.Collections.Generic;
@@ -8,7 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
{
//=======================================================================
public class SlmPanel : SlmContentView
@@ -17,6 +18,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
// Definitions.
public class Config
{
public Boolean ReadOnly { get; set; }
}
//-------------------------------------------------------------------
@@ -57,41 +59,16 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
protected override void SetControlActivity ()
{
base.SetControlActivity();
}
protected override void SetControlsReadOnly ()
{
base.SetControlsReadOnly();
}
//-------------------------------------------------------------------
// P a n e l E v e n t s
//-------------------------------------------------------------------
protected override void OnParentSet ()
{
base.OnParentSet();
}
//-------------------------------------------------------------------
protected override void OnPropertyChanging ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanging(propertyName);
}
protected override void OnPropertyChanged ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
}
//-------------------------------------------------------------------
protected override void OnChildAdded (Element child)
{
base.OnChildAdded(child);
}
protected override void OnChildRemoved (Element child)
{
base.OnChildRemoved(child);
}
//-------------------------------------------------------------------
protected override void OnSizeAllocated (double width, double height)
{
base.OnSizeAllocated(width, height);
}
//-------------------------------------------------------------------
}
@@ -1,9 +1,9 @@
using Sarand.Core.App;
using Sarand.Core.Mobile.Utils;
using Sarand.LogisticsMgr.Core.WebService;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts;
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
using System;
using System.Collections.Generic;
using System.Text;
@@ -23,10 +23,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
//-------------------------------------------------------------------
// Data members.
private Config config;
private SlmAccountMgr_Mobile accountMgr;
private SlmBerthingMgr_Mobile berthingMgr;
private SlmAssetMgr_Mobile assetMgr;
private SlmWebServiceClient webServiceClient;
// Layout.
private SlmFrame viewPanel = new SlmFrame();
private SlmStackLayout stackLayout = new SlmStackLayout() { Orientation = StackOrientation.Vertical };
@@ -118,18 +114,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
get { return labelCaption.Text; }
set { if (labelCaption.Text.Equals(value)) return; labelCaption.Text = value; }
}
// Session.
protected SlmUserContext_Mobile UserContext { get { return SlmGlobals_Mobile.SessionProfile.UserContext_Mobile; } }
protected SlmSessionContext_Mobile SessionContext { get { return SlmGlobals_Mobile.SessionProfile.SessionContext_Mobile; } }
// Layout.
protected SlmPanel SummaryPanel { get { return panelSummary; } }
protected SlmPanel DetailsPanel { get { return panelDetails; } }
protected String ErrorStateMessage { get; set; }
// Managers.
protected SlmAccountMgr_Mobile AccountMgr { get { if (accountMgr == null) accountMgr = new SlmAccountMgr_Mobile(SessionContext); return accountMgr; } }
protected SlmBerthingMgr_Mobile BerthingMgr { get { if (berthingMgr == null) berthingMgr = new SlmBerthingMgr_Mobile(SessionContext); return berthingMgr; } }
protected SlmAssetMgr_Mobile AssetMgr { get { if (assetMgr == null) assetMgr = new SlmAssetMgr_Mobile(SessionContext); return assetMgr; } }
public SlmWebServiceClient WebServiceClient { get { if (webServiceClient == null) webServiceClient = new SlmWebServiceClient(); return webServiceClient; } }
// NB Session properties, managers and WebService are defined in SlmContentView.
//-------------------------------------------------------------------
// I t e m s T o g g l e
@@ -0,0 +1,36 @@
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
{
//=======================================================================
public class SlmPanel_ItemProperties : SlmContentView
{
//-------------------------------------------------------------------
// Definitions.
public class Config
{
public bool ReadOnly { get; set; }
}
//-------------------------------------------------------------------
// Data members.
private Config config;
//-------------------------------------------------------------------
// Construction.
public SlmPanel_ItemProperties (Config config)
{
this.config = config;
}
//-------------------------------------------------------------------
// Properties.
public bool AddMode { get; protected set; }
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -0,0 +1,29 @@
using Sarand.Core.Mobile.Forms.Panels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
{
//=======================================================================
public class SlmPanel_PropertySummary : SaxPanel_PropertySummary
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Construction.
public SlmPanel_PropertySummary ()
{
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -1,4 +1,5 @@
using Sarand.Core.Mobile.Forms.Views;
using Sarand.LogisticsMgr.Core.WebService;
using Sarand.LogisticsMgr.Mobile.Core.App;
using Sarand.LogisticsMgr.Mobile.Core.Mgr;
using System;
@@ -9,7 +10,7 @@ using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmContentView : SaxContentView
@@ -22,6 +23,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
private SlmAccountMgr_Mobile accountMgr = null;
private SlmBerthingMgr_Mobile berthingMgr = null;
private SlmAssetMgr_Mobile assetMgr = null;
private SlmWebServiceClient webServiceClient;
//-------------------------------------------------------------------
// Construction.
@@ -31,11 +33,14 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
// Session.
protected SlmUserContext_Mobile UserContext { get { return SlmGlobals_Mobile.SessionProfile.UserContext_Mobile; } }
protected SlmSessionContext_Mobile SessionContext { get { return SlmGlobals_Mobile.SessionProfile.SessionContext_Mobile; } }
// Managers.
protected SlmAccountMgr_Mobile AccountMgr { get { if (accountMgr == null) accountMgr = new SlmAccountMgr_Mobile(SessionContext); return accountMgr; } }
protected SlmBerthingMgr_Mobile BerthingMgr { get { if (berthingMgr == null) berthingMgr = new SlmBerthingMgr_Mobile(SessionContext); return berthingMgr; } }
protected SlmAssetMgr_Mobile AssetMgr { get { if (assetMgr == null) assetMgr = new SlmAssetMgr_Mobile(SessionContext); return assetMgr; } }
public SlmWebServiceClient WebServiceClient { get { if (webServiceClient == null) webServiceClient = new SlmWebServiceClient(); return webServiceClient; } }
//-------------------------------------------------------------------
// C o n f i g u r e C o m p o n e n t s
@@ -49,41 +54,16 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
protected override void SetControlActivity ()
{
base.SetControlActivity();
}
protected override void SetControlsReadOnly ()
{
base.SetControlsReadOnly();
}
//-------------------------------------------------------------------
// V i e w E v e n t s
//-------------------------------------------------------------------
protected override void OnParentSet ()
{
base.OnParentSet();
}
//-------------------------------------------------------------------
protected override void OnPropertyChanging ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanging(propertyName);
}
protected override void OnPropertyChanged ([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
}
//-------------------------------------------------------------------
protected override void OnChildAdded (Element child)
{
base.OnChildAdded(child);
}
protected override void OnChildRemoved (Element child)
{
base.OnChildRemoved(child);
}
//-------------------------------------------------------------------
protected override void OnSizeAllocated (double width, double height)
{
base.OnSizeAllocated(width, height);
}
//-------------------------------------------------------------------
}
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmFrame : SaxFrame
@@ -1,11 +1,12 @@
using Sarand.Core.Mobile.Forms.Templates;
using Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmGrid : SaxGrid
@@ -25,6 +26,21 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
/// <summary>
/// Add label and control to form grid.
/// <para>NB Control takes up 2 rows by default to allow for control pairs (control + button etc).</para>
/// </summary>
public void AddControlViewToGrid (SlmControlView controlView, ushort controlColumnSpan = 2)
{
int rowIdx = RowDefinitions.Count;
RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
Children.Add(controlView.Label, 0, rowIdx);
Children.Add(controlView, 1, rowIdx);
if (controlColumnSpan > 0)
SetColumnSpan(controlView, 2);
}
//-------------------------------------------------------------------
// G r i d E v e n t s
//-------------------------------------------------------------------
@@ -6,7 +6,7 @@ using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmScrollView : ScrollView
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmView : SaxView
@@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Views
{
//=======================================================================
public class SlmWebView : SaxWebView