STN Asset Movements and Berthings.
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Mobile\Droid\App\MainActivity.cs" />
|
||||
<Compile Include="Mobile\Droid\Forms\Views\SlmWebViewRenderer.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Sarand.Core.Base;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(WebView), typeof(Sarand.LogisticsMgr.Mobile.Droid.Forms.Views.SlmWebViewRenderer))]
|
||||
namespace Sarand.LogisticsMgr.Mobile.Droid.Forms.Views
|
||||
{
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Rerplacement Web View Renderer to enable/override default behaviour.
|
||||
/// <para>1. Enable scrcolling within Scroll View etc.</para>
|
||||
/// <para>Ref. https://forums.xamarin.com/discussion/54365/android-enabling-scrolling-for-a-webview-inside-a-scrollview</para>
|
||||
/// </summary>
|
||||
public class SlmWebViewRenderer : WebViewRenderer
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmWebViewRenderer (Context context) : base(context)
|
||||
{
|
||||
Logger.Trace(GetType().Name + " CTR");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
protected override void OnElementChanged (ElementChangedEventArgs<WebView> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
Control.Touch -= Control_Touch;
|
||||
}
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
Control.Touch += Control_Touch;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
void Control_Touch (object sender, Android.Views.View.TouchEventArgs e)
|
||||
{
|
||||
// Executing this will prevent the Scrolling to be intercepted by parent views.
|
||||
switch (e.Event.Action)
|
||||
{
|
||||
case MotionEventActions.Down:
|
||||
Control.Parent.RequestDisallowInterceptTouchEvent(true);
|
||||
break;
|
||||
case MotionEventActions.Up:
|
||||
Control.Parent.RequestDisallowInterceptTouchEvent(false);
|
||||
break;
|
||||
}
|
||||
// Calling this will allow the scrolling event to be executed in the WebView.
|
||||
Control.OnTouchEvent(e.Event);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2.1" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto" android:versionCode="4" android:icon="@drawable/icon_solent_stevedores">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2.2" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto" android:versionCode="5" android:icon="@drawable/icon_solent_stevedores">
|
||||
<uses-sdk android:minSdkVersion="27" android:targetSdkVersion="27" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>1.2.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.344457" />
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" />
|
||||
|
||||
@@ -2,37 +2,38 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>LogisticsMgrMobile</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.LogisticsMgrMobile</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>LogisticsMgrMobile</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>LogisticsMgrMobile</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.LogisticsMgrMobile</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>LogisticsMgrMobile</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -89,6 +89,9 @@
|
||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
|
||||
<AppExtensionDebugBundleId />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
@@ -149,7 +152,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>1.2.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.344457" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LogisticsMgrMobile.iOS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyCopyright("Copyright © Sarand 2014-2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.344457" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -99,7 +99,8 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.Southampton, "STN [IP4 int]", "http://10.1.4.13:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.Southampton, "STN [IP6 int]", "http://[fe80:f4c9:7720:45d8:f1b0]:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.Southampton, "STN - dev [403-IP6]", "http://[2a00:23c4:1b29:cc00:f14f:66b9:c098:242d]:34567/SaLogMgr"));
|
||||
if (false/*allowLgp*/)
|
||||
bool allowLgp = false;
|
||||
if (allowLgp)
|
||||
{
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP", "http://SS-APP-LG1:34568/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP [IP4 int]", "http://10.1.20.12:34568/SaLogMgr"));
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Main;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets;
|
||||
|
||||
+5
-3
@@ -1,11 +1,9 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Utils;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -89,11 +87,15 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Assets
|
||||
public void PopulateToControls (SlmContainer.Data data)
|
||||
{
|
||||
EntryAssetCode.Text = data.Code;
|
||||
if (!StringUtil.IsEmpty(data.SizeCode) && !PickerAssetSize.ContainsCode(data.SizeCode))
|
||||
PickerAssetSize.AddItem(data.SizeCode, data.SizeCode);
|
||||
PickerAssetSize.SelectedCode= data.SizeCode;
|
||||
Changed = false;
|
||||
}
|
||||
public void PopulateToControls (SlmAssetMovement.Data data)
|
||||
{
|
||||
if (!StringUtil.IsEmpty(data.AssetSizeCode) && !PickerAssetSize.ContainsCode(data.AssetSizeCode))
|
||||
PickerAssetSize.AddItem(data.AssetSizeCode, data.AssetSizeCode);
|
||||
PickerAssetSize.SelectedCode = data.AssetSizeCode;
|
||||
PickerMovementType.SelectedCode = movementTypes.GetCodeForType((int)data.MovementType);
|
||||
EntryReference.Text = data.MovementRef;
|
||||
|
||||
+1
-2
@@ -2,10 +2,9 @@
|
||||
using Sarand.Core.Mobile.Forms.Utils;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
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.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+1
-2
@@ -2,9 +2,8 @@
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+9
-5
@@ -1,10 +1,7 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -28,6 +25,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
// Controls.
|
||||
// Vessel.
|
||||
public SlmPickerView PickerVessel { get; } = new SlmPickerView() { LabelText = "Vessel", ReadOnly = true };
|
||||
// Berthing.
|
||||
@@ -63,6 +61,12 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
}
|
||||
public void PopulateToControls (SlmBerthing.Data data)
|
||||
{
|
||||
// Vessel.
|
||||
PickerVessel.SelectedItemId = data.VesselId;
|
||||
// Companies.
|
||||
PickerAgent.SelectedItemId = data.CompanyIdAgent;
|
||||
PickerCustomer.SelectedItemId = data.CompanyIdCustomer;
|
||||
// Common properties.
|
||||
EditorNotes.Text = data.Notes;
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
+34
-11
@@ -1,9 +1,10 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -21,7 +22,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmComponents_BerthingTask()
|
||||
public SlmComponents_BerthingTask ()
|
||||
{
|
||||
berthingTaskTypes = SlmSystem.GetCodesOfType(Slm.SystemCode.BerthingTaskType);
|
||||
InitialiseComponents();
|
||||
@@ -31,8 +32,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
// Properties.
|
||||
// Controls.
|
||||
public SlmPickerView_SystemCodes PickerTaskType { get; } = new SlmPickerView_SystemCodes(Slm.SystemCode.BerthingTaskType) { LabelText = "Task type" };
|
||||
public SlmDatePickerView DatePickerStarted { get; } = new SlmDatePickerView() { LabelText = "Started" };
|
||||
public SlmDatePickerView DatePickerCompleted { get; } = new SlmDatePickerView() { LabelText = "Completed" };
|
||||
public SlmDateTimePickerView DatePickerStarted { get; } = new SlmDateTimePickerView() { LabelText = "Started" };
|
||||
public SlmDateTimePickerView DatePickerCompleted { get; } = new SlmDateTimePickerView() { LabelText = "Completed" };
|
||||
public SlmEditorView EntryRemarks { get; } = new SlmEditorView() { LabelText = "Remarks" };
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -43,7 +44,13 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Filename.
|
||||
// Started.
|
||||
DatePickerStarted.DateTime = DateUtil.RoundTime(DateTime.Now, 15, DateUtil.RoundingDirection.Nearest);
|
||||
|
||||
// Completed.
|
||||
DatePickerCompleted.DateTime = DateUtil.RoundTime(DateTime.Now, 15, DateUtil.RoundingDirection.Nearest);
|
||||
|
||||
// Remarks.
|
||||
EntryRemarks.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.BerthingTask_Remarks);
|
||||
EntryRemarks.TextChanged += EntryRemarks_TextChanged;
|
||||
EntryRemarks.Completed += EntryRemarks_Completed;
|
||||
@@ -57,21 +64,37 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
public void PopulateToControls (SlmBerthingTask.Data data)
|
||||
{
|
||||
PickerTaskType.SelectedCode = berthingTaskTypes.GetCodeForType((int)data.BerthingTaskType);
|
||||
DatePickerStarted.Date = data.Started;
|
||||
DatePickerCompleted.Date = data.Completed;
|
||||
DatePickerStarted.DateTime = data.Started;
|
||||
DatePickerCompleted.DateTime = data.Completed;
|
||||
EntryRemarks.Text = data.Remarks;
|
||||
Changed = false;
|
||||
}
|
||||
public bool IsDataValid (SlmBerthingTask.Data data)
|
||||
{
|
||||
if ((int)data.BerthingTaskType < 1)
|
||||
{
|
||||
DisplayAlert("Berthing Task", "Task type must be selected.", "OK");
|
||||
//EntryRemarks.Focus();
|
||||
return false;
|
||||
}
|
||||
if (StringUtil.IsEmpty(data.Remarks))
|
||||
{
|
||||
DisplayAlert("Berthing Task", "Remarks must be entered.", "OK");
|
||||
//EntryRemarks.Focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void PopulateFromControls (SlmBerthingTask.Data data)
|
||||
{
|
||||
data.BerthingTaskType = (Slm.BerthingTaskType)berthingTaskTypes.GetTypeForCode(PickerTaskType.SelectedCode);
|
||||
data.Started = DatePickerStarted.Date;
|
||||
data.Completed = DatePickerCompleted.Date;
|
||||
data.Remarks = EntryRemarks.Text;
|
||||
if (PickerTaskType.Parent != null && PickerTaskType.IsVisible && !PickerTaskType.ReadOnly)
|
||||
data.BerthingTaskType = (Slm.BerthingTaskType)berthingTaskTypes.GetTypeForCode(PickerTaskType.SelectedCode);
|
||||
if (DatePickerStarted.Parent != null && DatePickerStarted.IsVisible && !DatePickerStarted.ReadOnly)
|
||||
data.Started = DatePickerStarted.DateTime;
|
||||
if (DatePickerCompleted.Parent != null && DatePickerCompleted.IsVisible && !DatePickerCompleted.ReadOnly)
|
||||
data.Completed = DatePickerCompleted.DateTime;
|
||||
if (EntryRemarks.Parent != null && EntryRemarks.IsVisible && !EntryRemarks.ReadOnly)
|
||||
data.Remarks = EntryRemarks.Text;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+1
-2
@@ -1,9 +1,8 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+1
-2
@@ -1,9 +1,8 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
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.Forms.ControlViews;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+2
-3
@@ -1,11 +1,10 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Net;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Data;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
using Sarand.Core.Base;
|
||||
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.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
+26
-21
@@ -4,7 +4,10 @@ using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -148,46 +151,48 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Asset.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryAssetCode);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.PickerAssetSize);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryAssetCode);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.PickerAssetSize);
|
||||
|
||||
// Movement.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.PickerMovementType);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryReference);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.DatePickerMovementDate);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.PickerMovementType);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryReference);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.DatePickerMovementDate);
|
||||
|
||||
// Customer.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryCustomer);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryCustomerReference);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryCustomer);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryCustomerReference);
|
||||
|
||||
// Location.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryLocationStart);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryLocationCurrent);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryLocationFinish);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryLocationStart);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryLocationCurrent);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryLocationFinish);
|
||||
|
||||
// Haulier & Registration.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryHaulierInitial);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryRegistrationInitial);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryHaulierFinal);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryRegistrationFinal);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryHaulierInitial);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryRegistrationInitial);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryHaulierFinal);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryRegistrationFinal);
|
||||
|
||||
// Numbers.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryPinNumber);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntrySealNumber);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryPinNumber);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntrySealNumber);
|
||||
|
||||
// Status.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EntryStatus);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.DatePickerInProgressDate);
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.DatePickerCompletedDate);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EntryStatus);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.DatePickerInProgressDate);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.DatePickerCompletedDate);
|
||||
|
||||
// Notes.
|
||||
AddControlViewToGrid(gridProperties, assetMovementComponents.EditorNotes);
|
||||
gridProperties.AddControlViewToGrid(assetMovementComponents.EditorNotes);
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Populate properties to components.
|
||||
|
||||
+10
-6
@@ -6,7 +6,9 @@ using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets;
|
||||
using System;
|
||||
@@ -66,18 +68,20 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
int rowIdx = -1;
|
||||
|
||||
// Shipping line company.
|
||||
AddControlViewToGrid(gridProperties, assetRepairComponents.PickerCompany);
|
||||
gridProperties.AddControlViewToGrid(assetRepairComponents.PickerCompany);
|
||||
assetRepairComponents.PickerCompany.Populated += PickerCompany_Populated;
|
||||
assetRepairComponents.PickerCompany.SelectedIndexChanged += PickerCompany_SelectedIndexChanged;
|
||||
|
||||
// Asset code.
|
||||
AddControlViewToGrid(gridProperties, assetRepairComponents.EntryAssetCode);
|
||||
gridProperties.AddControlViewToGrid(assetRepairComponents.EntryAssetCode);
|
||||
assetRepairComponents.EntryAssetCode.TextChanged += EntryAssetCode_TextChanged;
|
||||
assetRepairComponents.EntryAssetCode.Completed += EntryAssetCode_Completed;
|
||||
|
||||
@@ -97,13 +101,13 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
assetSearchResultsWebView.AssetMovementSelected += AssetSearchResultsWebView_AssetMovementSelected;
|
||||
|
||||
// Asset Size.
|
||||
AddControlViewToGrid(gridProperties, assetRepairComponents.PickerAssetSize);
|
||||
gridProperties.AddControlViewToGrid(assetRepairComponents.PickerAssetSize);
|
||||
|
||||
// Repair Narrative.
|
||||
AddControlViewToGrid(gridProperties, assetRepairComponents.EntryRepairNarrative);
|
||||
gridProperties.AddControlViewToGrid(assetRepairComponents.EntryRepairNarrative);
|
||||
|
||||
// Repair Inspector.
|
||||
AddControlViewToGrid(gridProperties, assetRepairComponents.EntryRepairInspector);
|
||||
gridProperties.AddControlViewToGrid(assetRepairComponents.EntryRepairInspector);
|
||||
|
||||
// Jobs panel.
|
||||
SlmPanel_AssetRepair_Jobs.Config jobsPanelConfig = new SlmPanel_AssetRepair_Jobs.Config();
|
||||
|
||||
+7
-9
@@ -1,12 +1,9 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -59,14 +56,15 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
int rowIdx = -1;
|
||||
|
||||
// Filename.
|
||||
AddControlViewToGrid(gridProperties, repairImageComponents.EntryFilename);
|
||||
gridProperties.AddControlViewToGrid(repairImageComponents.EntryFilename);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+6
-6
@@ -1,12 +1,10 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -63,6 +61,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
@@ -102,7 +102,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
Grid.SetColumnSpan(repairJobComponents.PickerRepair, 2);
|
||||
|
||||
// Quantity.
|
||||
AddControlViewToGrid(gridProperties, repairJobComponents.EntryQuantity);
|
||||
gridProperties.AddControlViewToGrid(repairJobComponents.EntryQuantity);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+47
-36
@@ -4,8 +4,13 @@ using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk;
|
||||
using System;
|
||||
@@ -29,9 +34,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Config config;
|
||||
private SlmGrid gridProperties = new SlmGrid();
|
||||
private SlmComponents_Berthing berthingComponents = new SlmComponents_Berthing();
|
||||
private SlmPanel_Bulk_BerthingTasks berthingTasksPanel;
|
||||
// Components.
|
||||
private SlmStackLayout panelLayout = new SlmStackLayout() { Orientation = StackOrientation.Vertical };
|
||||
private SlmPanel_PropertySummary panelPropertySummary = new SlmPanel_PropertySummary();
|
||||
private SlmTabControl tabbedView = new SlmTabControl();
|
||||
// Data to view/update.
|
||||
private SlmBerthing BerthingToUpdate;
|
||||
private SlmVessel Berthing_Vessel;
|
||||
@@ -45,10 +51,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
this.config = config;
|
||||
Title = "Bulk - Berthing";
|
||||
AddMode = !SysId.IsValid(config.BerthingIdToUpdate);
|
||||
if (config.ReadOnly)
|
||||
{
|
||||
berthingComponents.ReadOnly = true;
|
||||
}
|
||||
PrepareFormData();
|
||||
}
|
||||
|
||||
@@ -78,7 +80,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (SacsSystem.DebugMode) Logger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
|
||||
CloseFormWithAlert(nameof(exc)+" on form initialisation.\n\n"+exc.Message);
|
||||
CloseFormWithAlert(nameof(exc) + " on form initialisation.\n\n" + exc.Message);
|
||||
}
|
||||
}, taskDataPrepareData.CancellationToken)
|
||||
.ContinueWith(task =>
|
||||
@@ -173,41 +175,50 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Asset Repair form.
|
||||
gridProperties.BackgroundColor = Color.Transparent;
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
FormBodyView.Content = panelLayout;
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Vessel.
|
||||
AddControlViewToGrid(gridProperties, berthingComponents.PickerVessel);
|
||||
// Summary Preopeties panel.
|
||||
panelPropertySummary.BorderColor = SlmMobile.ItemListHeaderBorderColor;
|
||||
panelPropertySummary.PanelBackgroundColor = SlmMobile.ItemListHeaderBackgroundColor;
|
||||
panelPropertySummary.FontSize = panelPropertySummary.DefaultFontSize * SlmMobile.FontSizeRatio;
|
||||
panelPropertySummary.ClearProperties();
|
||||
panelPropertySummary.AddProperty("Vessel", Berthing_Vessel?.Name ?? "");
|
||||
panelPropertySummary.AddProperty("Agent", Berthing_Company_Agent?.Name ?? "");
|
||||
panelPropertySummary.AddProperty("Customer", Berthing_Company_Customer?.Name ?? "");
|
||||
panelLayout.Children.Add(panelPropertySummary);
|
||||
|
||||
// Companies.
|
||||
AddControlViewToGrid(gridProperties, berthingComponents.PickerAgent);
|
||||
AddControlViewToGrid(gridProperties, berthingComponents.PickerCustomer);
|
||||
// Tabbed panel.
|
||||
tabbedView.HeaderFontSize = tabbedView.DefaultHeaderFontSize * SlmMobile.FontSizeRatio;
|
||||
tabbedView.HeaderBackgroundColor = SlmMobile.TabControlHeaderBackgroundColor;
|
||||
tabbedView.CaptionBackgroundColor = SlmMobile.TabControlCaptionBackgroundColor;
|
||||
tabbedView.BodyBackgroundColor = SlmMobile.TabControlBodyBackgroundColor;
|
||||
panelLayout.Children.Add(tabbedView);
|
||||
|
||||
// Notes.
|
||||
AddControlViewToGrid(gridProperties, berthingComponents.EditorNotes);
|
||||
|
||||
// Tasks panel.
|
||||
SlmPanel_Bulk_BerthingTasks.Config berthingTasksPanelConfig = new SlmPanel_Bulk_BerthingTasks.Config();
|
||||
berthingTasksPanelConfig.BerthingForm = this;
|
||||
berthingTasksPanel = new SlmPanel_Bulk_BerthingTasks(berthingTasksPanelConfig);
|
||||
int rowIdx = gridProperties.RowDefinitions.Count;
|
||||
gridProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridProperties.Children.Add(berthingTasksPanel, 0, rowIdx);
|
||||
Grid.SetColumnSpan(berthingTasksPanel, 3);
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Populate properties to components.
|
||||
berthingComponents.PopulateToControls(Berthing_Vessel?.GetData() ?? new SlmVessel.Data());
|
||||
berthingComponents.PopulateToControls(BerthingToUpdate?.GetData() ?? new SlmBerthing.Data());
|
||||
// Initialise tabbed panels.
|
||||
InitTabs();
|
||||
|
||||
// Complete page configuration.
|
||||
SetControlActivity();
|
||||
Changed = false;
|
||||
}
|
||||
private void InitTabs ()
|
||||
{
|
||||
// Berthing panel.
|
||||
SlmPanel_Berthing.Config configBerthing = new SlmPanel_Berthing.Config();
|
||||
configBerthing.BerthingToUpdate = BerthingToUpdate;
|
||||
configBerthing.Berthing_Vessel = Berthing_Vessel;
|
||||
configBerthing.Berthing_Company_Agent = Berthing_Company_Agent;
|
||||
configBerthing.Berthing_Company_Customer = Berthing_Company_Customer;
|
||||
configBerthing.ReadOnly = true;
|
||||
SlmPanel_Berthing panelBerthing = new SlmPanel_Berthing(configBerthing);
|
||||
tabbedView.AddPanel("Berthing", panelBerthing);
|
||||
|
||||
// Tasks panel.
|
||||
SlmPanel_Bulk_BerthingTasks.Config berthingTasksPanelConfig = new SlmPanel_Bulk_BerthingTasks.Config();
|
||||
berthingTasksPanelConfig.BerthingForm = this;
|
||||
SlmPanel_Bulk_BerthingTasks berthingTasksPanel = new SlmPanel_Bulk_BerthingTasks(berthingTasksPanelConfig);
|
||||
tabbedView.AddPanel("Tasks", berthingTasksPanel);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
|
||||
+10
-8
@@ -1,8 +1,8 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -56,16 +56,18 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
|
||||
// Controls.
|
||||
AddControlViewToGrid(gridProperties, berthingTaskComponents.PickerTaskType);
|
||||
AddControlViewToGrid(gridProperties, berthingTaskComponents.DatePickerStarted);
|
||||
AddControlViewToGrid(gridProperties, berthingTaskComponents.DatePickerCompleted);
|
||||
AddControlViewToGrid(gridProperties, berthingTaskComponents.EntryRemarks);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.PickerTaskType);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.DatePickerStarted);
|
||||
//gridProperties.AddControlViewToGrid(berthingTaskComponents.DatePickerCompleted);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.EntryRemarks);
|
||||
|
||||
if (AddMode)
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,7 +1,5 @@
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,6 +11,8 @@ using System.Text;
|
||||
using Xamarin.Forms;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.Core.Mobile.Utils;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates
|
||||
{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Mobile.Utils;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPanel_Berthing : SlmPanel_ItemProperties
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmPanel_ItemProperties.Config
|
||||
{
|
||||
// Data to view/update.
|
||||
public SlmBerthing BerthingToUpdate;
|
||||
public SlmVessel Berthing_Vessel;
|
||||
public SlmCompany Berthing_Company_Agent;
|
||||
public SlmCompany Berthing_Company_Customer;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config;
|
||||
// Components.
|
||||
private SlmGrid gridProperties = new SlmGrid();
|
||||
private SlmComponents_Berthing berthingComponents = new SlmComponents_Berthing();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel_Berthing (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
AddMode = config.BerthingToUpdate != null && !SysId.IsValid(config.BerthingToUpdate.Id);
|
||||
if (config.ReadOnly)
|
||||
{
|
||||
berthingComponents.ReadOnly = true;
|
||||
}
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Properties grid.
|
||||
Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Vessel.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.PickerVessel);
|
||||
|
||||
// Companies.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.PickerAgent);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.PickerCustomer);
|
||||
|
||||
// Notes.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.EditorNotes);
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Populate vessel and companies to pickers if not already present.
|
||||
if (config.Berthing_Vessel != null && !berthingComponents.PickerVessel.ContainsId(config.Berthing_Vessel.Id))
|
||||
berthingComponents.PickerVessel.AddItem(config.Berthing_Vessel.Id, config.Berthing_Vessel.Name);
|
||||
if (config.Berthing_Company_Agent != null && !berthingComponents.PickerAgent.ContainsId(config.Berthing_Company_Agent.Id))
|
||||
berthingComponents.PickerAgent.AddItem(config.Berthing_Company_Agent.Id, config.Berthing_Company_Agent.Name);
|
||||
if (config.Berthing_Company_Customer != null && !berthingComponents.PickerCustomer.ContainsId(config.Berthing_Company_Customer.Id))
|
||||
berthingComponents.PickerCustomer.AddItem(config.Berthing_Company_Customer.Id, config.Berthing_Company_Customer.Name);
|
||||
|
||||
// Populate properties to components.
|
||||
berthingComponents.PopulateToControls(config.Berthing_Vessel?.GetData() ?? new SlmVessel.Data());
|
||||
berthingComponents.PopulateToControls(config.BerthingToUpdate?.GetData() ?? new SlmBerthing.Data());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+49
-47
@@ -2,15 +2,20 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.Core.Mobile.Forms.Panels;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
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.Forms.Layouts;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Main;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -20,11 +25,11 @@ using Xamarin.Forms;
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPanel_Bulk_BerthingTasks : SlmPanel_AssociatedItems
|
||||
public class SlmPanel_Bulk_BerthingTasks : SlmPanel
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmPanel_AssociatedItems.Config
|
||||
public new class Config : SlmPanel.Config
|
||||
{
|
||||
public SlmFormPage_Bulk_Berthing BerthingForm { get; set; }
|
||||
}
|
||||
@@ -34,8 +39,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
private Config config;
|
||||
private readonly List<TypeCodeDesc> berthingTaskTypes;
|
||||
private List<SlmBerthingTask.Data> berthingTaskDataList = new List<SlmBerthingTask.Data>();
|
||||
private SlmLabel labelSummary = new SlmLabel();
|
||||
//private SlmGrid gridDetails = new SlmGrid();
|
||||
// Components.
|
||||
private SlmStackLayout panelLayout = new SlmStackLayout() { Orientation = StackOrientation.Vertical };
|
||||
private SaxPanel_ItemListSummary panelSummary = new SaxPanel_ItemListSummary();
|
||||
private SlmWebView webViewDetails = new SlmWebView();
|
||||
private String berthingTaskUpdatePrefix = "BthTskUpdate_";
|
||||
|
||||
@@ -52,6 +58,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public String MessageCaption { get; } = "Berthing Tasks";
|
||||
public List<SlmBerthingTask.Data> BerthingTasks { get { return new List<SlmBerthingTask.Data>(berthingTaskDataList); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -59,17 +66,23 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
Caption = "Berthing Tasks";
|
||||
// Main layout - vertical stack.
|
||||
VerticalOptions = LayoutOptions.Fill;
|
||||
panelLayout.VerticalOptions = LayoutOptions.Fill;
|
||||
Content = panelLayout;
|
||||
|
||||
// Summary panel.
|
||||
labelSummary.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
SummaryPanel.Content = labelSummary;
|
||||
// Messages panel.
|
||||
panelSummary.ShowAddButton = !config.ReadOnly;
|
||||
panelSummary.AddClicked += PanelSummary_AddClicked;
|
||||
panelSummary.MessageFontSize = panelSummary.DefaultMessageFontSize * SlmMobile.FontSizeRatio;
|
||||
panelLayout.Children.Add(panelSummary);
|
||||
|
||||
// Details panel.
|
||||
webViewDetails.HorizontalOptions = LayoutOptions.StartAndExpand;
|
||||
webViewDetails.VerticalOptions = LayoutOptions.StartAndExpand;
|
||||
// Berthing Task list component.
|
||||
webViewDetails.HorizontalOptions = LayoutOptions.Fill;
|
||||
webViewDetails.VerticalOptions = LayoutOptions.FillAndExpand;
|
||||
webViewDetails.AppNavigating += WebViewDetails_AppNavigating;
|
||||
DetailsPanel.Content = webViewDetails;
|
||||
webViewDetails.MinimumHeightRequest = 120;
|
||||
panelLayout.Children.Add(webViewDetails);
|
||||
|
||||
RefreshPanels();
|
||||
}
|
||||
@@ -91,7 +104,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (SacsSystem.DebugMode) Logger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
|
||||
ErrorStateMessage = nameof(exc) + " on population - " + exc.Message;
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
panelSummary.SetMessage(nameof(exc) + " on population - " + exc.Message, SaMessageLevel.Exception);
|
||||
});
|
||||
}
|
||||
}, taskDataPrepareData.CancellationToken)
|
||||
.ContinueWith(task =>
|
||||
@@ -138,32 +154,29 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshSummaryPanel ()
|
||||
{
|
||||
panelSummary.ClearMessage();
|
||||
if (berthingTaskDataList.Count == 0)
|
||||
labelSummary.Text = "No tasks defined";
|
||||
panelSummary.SetMessage(new SacsMessage("No tasks defined"));
|
||||
else if (berthingTaskDataList.Count == 1)
|
||||
labelSummary.Text = "1 task defined";
|
||||
panelSummary.SetMessage(new SacsMessage("1 task defined"));
|
||||
else
|
||||
labelSummary.Text = berthingTaskDataList.Count + " tasks defined";
|
||||
panelSummary.SetMessage(new SacsMessage(berthingTaskDataList.Count + " tasks defined"));
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshDetailsPanel ()
|
||||
{
|
||||
List<String> html = new List<string>();
|
||||
html.Add("<html><head>" + GetItemListStyles().Concat("\n") + GetItemListScripts().Concat("\n") + "</head><body>");
|
||||
html.Add("<html><head>" + GetBerthingTaskListStyles().Concat("\n") + GetBerthingTaskListScripts().Concat("\n") + "</head><body>");
|
||||
foreach (SlmBerthingTask.Data item in berthingTaskDataList)
|
||||
{
|
||||
html.Add("<div id='BthTsk-" + SysId.ToString(item.Id) + "' class='item' ondblclick='slm.openBerthingTask(" + SysId.ToString(item.Id) + ")'>");
|
||||
html.Add("<table class='fullwidth'>");
|
||||
html.Add(" <tr>");
|
||||
html.Add(" <td class='label'>Started</td><td class='value'>" + DateUtil.Format(item.Started, "ddd d-MMM-yyyy HH:mm") + "</td>");
|
||||
html.Add(" <td class='label'>Type</td><td class='value'>" + berthingTaskTypes.GetDescForType((int)item.BerthingTaskType) + "</td>");
|
||||
html.Add(" <td class='label'>Status</td><td class='value'>" + SacsSystem.GetStatusDesc(item.Status) + "</td>");
|
||||
html.Add(" </tr>");
|
||||
html.Add(" <tr>");
|
||||
html.Add(" <td class='label'>Started</td><td class='value'>" + DateUtil.Format(item.Started, "ddd d-MMM-yyyy") + "</td>");
|
||||
html.Add(" <td class='label'>Completed</td><td class='value'>" + DateUtil.Format(item.Completed, "ddd d-MMM-yyyy") + "</td>");
|
||||
html.Add(" </tr>");
|
||||
html.Add(" <tr>");
|
||||
html.Add(" <td class='label'>Arrived</td><td class='value' colspan='3'>" + item.Remarks.ReplaceAll("\n","<br/>") + "</td>");
|
||||
html.Add(" <td class='label'>Remarks</td><td class='value' colspan='3'>" + item.Remarks.ReplaceAll("\n", "<br/>") + "</td>");
|
||||
html.Add(" </tr>");
|
||||
if (SacsSystem.DebugMode)
|
||||
{
|
||||
@@ -178,29 +191,19 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
html.Add("</body></html>");
|
||||
webViewDetails.Html = html.Concat("\n");
|
||||
}
|
||||
private List<String> GetItemListStyles ()
|
||||
private List<String> GetBerthingTaskListStyles ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> styles = new List<string>(SlmMainPanel_ItemList.GetItemListBaseStyles());
|
||||
styles.AddRange(new String[]
|
||||
{
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseCss) + "</style>",
|
||||
"<style>",
|
||||
"body{padding:4px;font-size:" + SlmMobile.HtmlFontSize + ";border:1px solid #808080;border-radius:8px;overflow-y:auto;}",
|
||||
"td{padding:2px;}",
|
||||
"tr.other th, tr.other td{background-color:#f0f0f0;}",
|
||||
"div.item{margin:0 0 4px 0;padding:4px;background-color:#f8f8f8;border:2px solid #808080;border-radius:8px;}",
|
||||
"</style>"
|
||||
};
|
||||
});
|
||||
return styles;
|
||||
}
|
||||
private List<String> GetItemListScripts ()
|
||||
private List<String> GetBerthingTaskListScripts ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> scripts = new List<string>(SlmMainPanel_ItemList.GetItemListBaseScripts());
|
||||
scripts.AddRange(new String[]
|
||||
{
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseJs) + "</script>",
|
||||
"<script>",
|
||||
"slm.openBerthingTask=function(id)",
|
||||
"{",
|
||||
@@ -212,13 +215,14 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
" ",
|
||||
"});",
|
||||
"</script>"
|
||||
};
|
||||
});
|
||||
return scripts;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override void ButtonAddItem_Clicked (object sender, EventArgs e)
|
||||
private void PanelSummary_AddClicked (object sender, EventArgs e)
|
||||
{
|
||||
SlmFormPage_Bulk_BerthingTask.Config formConfig = new SlmFormPage_Bulk_BerthingTask.Config(config.BerthingForm.BerthingId);
|
||||
SlmFormPage_Bulk_BerthingTask berthingTaskForm = new SlmFormPage_Bulk_BerthingTask(formConfig);
|
||||
@@ -231,7 +235,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
berthingTaskDataList.Add(berthingTaskData);
|
||||
RefreshPanels();
|
||||
DropDown();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -247,13 +250,13 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
SysId berthingTaskId = new SysId(StringUtil.ToInt(eventArgs.AppAction.Right(eventArgs.AppAction.Length - berthingTaskUpdatePrefix.Length)));
|
||||
if (!SysId.IsValid(berthingTaskId))
|
||||
{
|
||||
DisplayAlert(Caption, "Invalid berthing task selected.", "OK");
|
||||
DisplayAlert(MessageCaption, "Invalid berthing task selected.", "OK");
|
||||
return;
|
||||
}
|
||||
SlmBerthingTask.Data berthingTaskData = berthingTaskDataList.Find(item => item.Id.Equals(berthingTaskId));
|
||||
if (!SysId.IsValid(berthingTaskId))
|
||||
{
|
||||
DisplayAlert(Caption, "Failed to retrieve berthing task.", "OK");
|
||||
DisplayAlert(MessageCaption, "Failed to retrieve berthing task.", "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -267,7 +270,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
berthingTaskDataList.Add(berthingTaskData);
|
||||
RefreshPanels();
|
||||
DropDown();
|
||||
}
|
||||
};
|
||||
Application.Current.MainPage.Navigation.PushModalAsync(berthingTaskForm, false);
|
||||
|
||||
+33
-23
@@ -8,6 +8,7 @@ using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -197,6 +198,21 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
configRequest.Context.Debug = SacsSystem.DebugMode;
|
||||
// Filter.
|
||||
Dictionary<String, String> filter = AssetMgr.GetAssetMovementQueryFilter_Mobile(assetMovementParams);
|
||||
|
||||
//---------------------------------------------------
|
||||
// ToDo Temporary fix to list all containers if up to 100
|
||||
// so that entire train is listed rather than having to page through results.
|
||||
configRequest.RequestType = SlmWebServiceRequest.RequestType.Count;
|
||||
SlmWebServiceClient.ItemCountResponseData itemCountResponseData = await new SlmWebServiceClient().RequestItemCount(configRequest, filter, taskDataRefreshList_Local);
|
||||
if (itemCountResponseData.ItemCount <= 100)
|
||||
{
|
||||
// Clear paging and refresh filter.
|
||||
assetMovementParams.ResultsPaging.PageNo = 1;
|
||||
assetMovementParams.ResultsPaging.PageLength = (ushort)itemCountResponseData.ItemCount;
|
||||
filter = AssetMgr.GetAssetMovementQueryFilter_Mobile(assetMovementParams);
|
||||
}
|
||||
//---------------------------------------------------
|
||||
|
||||
// Columns.
|
||||
List<String> queryColumns = new List<String>()
|
||||
{
|
||||
@@ -220,6 +236,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
};
|
||||
// Request User profile.
|
||||
if (SacsSystem.DebugMode) Logger.Debug(fn + " Querying data - START");
|
||||
configRequest.RequestType = SlmWebServiceRequest.RequestType.QueryList;
|
||||
SlmWebServiceClient.QueryListResponseData responseData =
|
||||
await new SlmWebServiceClient().RequestQueryList(configRequest, filter, queryColumns, taskDataRefreshList_Local);
|
||||
if (SacsSystem.DebugMode) Logger.Debug(fn + " Querying data - END Items: " + (responseData?.Items.Count.ToString() ?? "None") + (taskDataRefreshList_Local.IsCancellationRequested ? " [Cancelled]" : ""));
|
||||
@@ -239,6 +256,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
taskDataRefreshList = null;
|
||||
});
|
||||
if (SacsSystem.DebugMode) Logger.Debug(fn + " Timer method complete.");
|
||||
// Kill timer with false response.
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@@ -248,10 +266,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
{
|
||||
// Refresh paging properties.
|
||||
if (responseData != null)
|
||||
HeaderPanel.SetPaging(responseData.PageNo, responseData.PageLength, responseData.Total);
|
||||
HeaderPanel.SetPaging(responseData.PageNo, responseData.PageLength, responseData.Total > 0 ? responseData.Total : responseData.Count);
|
||||
else HeaderPanel.SetPaging(0, 0, 0);
|
||||
// Construct item list HTML.
|
||||
string html = "<html><head>"+GetItemListStyles().Concat("\n")+GetItemListScripts().Concat("\n")+"</head><body>";
|
||||
string html = "<html><head>"+GetAssetMovementListStyles().Concat("\n")+GetAssetMovementListScripts().Concat("\n")+"</head><body>";
|
||||
if (message != null)
|
||||
{
|
||||
String messageClass = "inf";
|
||||
@@ -277,8 +295,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
{
|
||||
html += "<div id='AssMov-" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + "' class='item' ondblclick='slm.openAssetMovement(" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + ")'>";
|
||||
html += "<table class='fullwidth'>";
|
||||
html += " <tr><td style='width:10%'></td><td style='width:40%'></td><td style='width:10%'></td><td style='width:40%'></td></tr>";
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Container</td><td class='value bold'>" + item.GetValue(cols.Asset_Code.DataName) + "</td>";
|
||||
html += " <td class='label pt2'>Container</td><td class='value caption'>" + item.GetValue(cols.Asset_Code.DataName) + "</td>";
|
||||
html += " <td class='label'>Size</td><td class='value'>" + item.GetValue(cols.AssetSizeCode.DataName) + "</td>";
|
||||
html += " </tr>";
|
||||
html += " <tr>";
|
||||
@@ -309,29 +328,19 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
ItemListWebView.Html = html;
|
||||
//Logger.Debug("HTML: " + html);
|
||||
}
|
||||
private List<String> GetItemListStyles ()
|
||||
private List<String> GetAssetMovementListStyles ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> styles = new List<string>(GetItemListBaseStyles());
|
||||
styles.AddRange(new String[]
|
||||
{
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseCss) + "</style>",
|
||||
"<style>",
|
||||
"body{padding:4px;font-size:" + SlmMobile.HtmlFontSize + ";border:1px solid #808080;border-radius:8px;overflow-y:auto;}",
|
||||
"td{padding:2px;}",
|
||||
"tr.other th, tr.other td{background-color:#f0f0f0;}",
|
||||
"div.item{margin:0 0 4px 0;padding:4px;background-color:#f8f8f8;border:2px solid #808080;border-radius:8px;}",
|
||||
"</style>"
|
||||
};
|
||||
});
|
||||
return styles;
|
||||
}
|
||||
private List<String> GetItemListScripts ()
|
||||
private List<String> GetAssetMovementListScripts ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> scripts = new List<string>(GetItemListBaseScripts());
|
||||
scripts.AddRange(new String[]
|
||||
{
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseJs) + "</script>",
|
||||
"<script>",
|
||||
"slm.openAssetMovement=function(id)",
|
||||
"{",
|
||||
@@ -343,7 +352,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
" ",
|
||||
"});",
|
||||
"</script>"
|
||||
};
|
||||
});
|
||||
return scripts;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -368,7 +378,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Assets
|
||||
SlmFormPage_Assets_Movement.Config pageConfig = new SlmFormPage_Assets_Movement.Config();
|
||||
pageConfig.AssetMovementIdToUpdate = assetMovementId;
|
||||
pageConfig.ReadOnly = true;
|
||||
if (pageConfig.ReadOnly) pageConfig.NavigationMode = Core.Forms.Base.SlmFormPage.NavigationMode.Close;
|
||||
if (pageConfig.ReadOnly) pageConfig.NavigationMode = SlmFormPage.NavigationMode.Close;
|
||||
SlmFormPage_Assets_Movement assetRepairForm = new SlmFormPage_Assets_Movement (pageConfig);
|
||||
//assetRepairForm.Disappearing += (sender2, e2) => { };
|
||||
SlmGlobals_Mobile.Application.MainPage.Navigation.PushModalAsync(assetRepairForm, false);
|
||||
|
||||
+31
-33
@@ -9,6 +9,7 @@ using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Pages;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -239,6 +240,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
taskDataRefreshList = null;
|
||||
});
|
||||
if (SacsSystem.DebugMode) Logger.Debug(fn + " Timer method complete.");
|
||||
// Kill timer with false response.
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@@ -248,10 +250,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
{
|
||||
// Refresh paging properties.
|
||||
if (responseData != null)
|
||||
HeaderPanel.SetPaging(responseData.PageNo, responseData.PageLength, responseData.Total);
|
||||
HeaderPanel.SetPaging(responseData.PageNo, responseData.PageLength, responseData.Total > 0 ? responseData.Total : responseData.Count);
|
||||
else HeaderPanel.SetPaging(0, 0, 0);
|
||||
// Construct item list HTML.
|
||||
string html = "<html><head>"+GetItemListStyles().Concat("\n")+GetItemListScripts().Concat("\n")+"</head><body>";
|
||||
string html = "<html><head>"+GetBerthingListStyles().Concat("\n")+GetBerthingListScripts().Concat("\n")+"</head><body>";
|
||||
if (message != null)
|
||||
{
|
||||
String messageClass = "inf";
|
||||
@@ -277,9 +279,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
{
|
||||
html += "<div id='Bth-" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + "' class='item' ondblclick='slm.openBerthing(" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + ")'>";
|
||||
html += "<table class='fullwidth'>";
|
||||
html += " <tr><td style='width:10%'></td><td style='width:40%'></td><td style='width:10%'></td><td style='width:40%'></td></tr>";
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Vessel</td><td class='value bold'>" + item.GetValue(cols.VesselName.DataName) + "</td>";
|
||||
html += " <td class='label'></td><td class='value'>" + "</td>";
|
||||
html += " <td class='label pt2'>Vessel</td><td class='value caption' colspan='3'>" + item.GetValue(cols.VesselName.DataName) + "</td>";
|
||||
html += " </tr>";
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Customer</td><td class='value'>" + item.GetValue(cols.CustomerName.DataName) + "</td>";
|
||||
@@ -290,18 +292,23 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
html += " <td class='label'>Bollard</td><td class='value'>" + item.GetValue(cols.Bollard.DataName) + "</td>";
|
||||
html += " </tr>";
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Arrived</td><td class='value'>" + DateUtil.Format(item.GetDateTimeValue(cols.Arrived.DataName), "ddd d-MMM-yyyy") + "</td>";
|
||||
SaStatus berthingStatus = SacsSystem.GetStatusForCode(item.GetValue(cols.Status.DataName));
|
||||
html += " <td class='label'>Status</td><td class='value'>" + SacsSystem.GetStatusDesc(berthingStatus) + "</td>";
|
||||
html += " </tr>";
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Completed</td><td class='value'>" + DateUtil.Format(item.GetDateTimeValue(cols.Completed.DataName), "ddd d-MMM-yyyy") + "</td>";
|
||||
html += " <td class='label'>Departed</td><td class='value'>" + DateUtil.Format(item.GetDateTimeValue(cols.Departed.DataName), "ddd d-MMM-yyyy") + "</td>";
|
||||
html += " </tr>";
|
||||
// Expected/Arrived.
|
||||
DateTime expected = item.GetDateTimeValue(cols.Expected.DataName);
|
||||
DateTime arrived = item.GetDateTimeValue(cols.Arrived.DataName);
|
||||
if (DateUtil.IsValid(arrived))
|
||||
html += " <td class='label'>Arrived</td><td class='value'>" + DateUtil.Format(arrived, "ddd d-MMM-yyyy") + "</td>";
|
||||
else html += " <td class='label'>Expected</td><td class='value'>" + DateUtil.Format(expected, "ddd d-MMM-yyyy") + "</td>";
|
||||
if (SacsSystem.DebugMode)
|
||||
html += " <td class='label'>Id</td><td class='value'>" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + "</td>";
|
||||
html += " </tr>";
|
||||
// Completed/Departed.
|
||||
DateTime completed = item.GetDateTimeValue(cols.Completed.DataName);
|
||||
DateTime departed = item.GetDateTimeValue(cols.Departed.DataName);
|
||||
if (DateUtil.IsValid(completed))
|
||||
{
|
||||
html += " <tr>";
|
||||
html += " <td class='label'>Id</td><td class='value'>" + SysId.ToString(item.GetIdValue(cols.Id.DataName)) + "</td>";
|
||||
html += " <td class='label'>Completed</td><td class='value'>" + DateUtil.Format(completed, "ddd d-MMM-yyyy") + "</td>";
|
||||
html += " <td class='label'>Departed</td><td class='value'>" + DateUtil.Format(departed, "ddd d-MMM-yyyy") + "</td>";
|
||||
html += " </tr>";
|
||||
}
|
||||
html += "</table>";
|
||||
@@ -313,29 +320,19 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
ItemListWebView.Html = html;
|
||||
//Logger.Debug("HTML: " + html);
|
||||
}
|
||||
private List<String> GetItemListStyles ()
|
||||
private List<String> GetBerthingListStyles ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> styles = new List<string>(GetItemListBaseStyles());
|
||||
styles.AddRange(new String[]
|
||||
{
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseCss) + "</style>",
|
||||
"<style>",
|
||||
"body{padding:4px;font-size:" + SlmMobile.HtmlFontSize + ";border:1px solid #808080;border-radius:8px;overflow-y:auto;}",
|
||||
"td{padding:2px;}",
|
||||
"tr.other th, tr.other td{background-color:#f0f0f0;}",
|
||||
"div.item{margin:0 0 4px 0;padding:4px;background-color:#f8f8f8;border:2px solid #808080;border-radius:8px;}",
|
||||
"</style>"
|
||||
};
|
||||
});
|
||||
return styles;
|
||||
}
|
||||
private List<String> GetItemListScripts ()
|
||||
private List<String> GetBerthingListScripts ()
|
||||
{
|
||||
return new List<string>()
|
||||
List<string> scripts = new List<string>(GetItemListBaseScripts());
|
||||
scripts.AddRange(new String[]
|
||||
{
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseJs) + "</script>",
|
||||
"<script>",
|
||||
"slm.openBerthing=function(id)",
|
||||
"{",
|
||||
@@ -347,7 +344,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
" ",
|
||||
"});",
|
||||
"</script>"
|
||||
};
|
||||
});
|
||||
return scripts;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -372,7 +370,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
SlmFormPage_Bulk_Berthing.Config pageConfig = new SlmFormPage_Bulk_Berthing.Config();
|
||||
pageConfig.BerthingIdToUpdate = berthingId;
|
||||
pageConfig.ReadOnly = true;
|
||||
if (pageConfig.ReadOnly) pageConfig.NavigationMode = Core.Forms.Base.SlmFormPage.NavigationMode.Close;
|
||||
if (pageConfig.ReadOnly) pageConfig.NavigationMode = SlmFormPage.NavigationMode.Close;
|
||||
SlmFormPage_Bulk_Berthing assetRepairForm = new SlmFormPage_Bulk_Berthing (pageConfig);
|
||||
//assetRepairForm.Disappearing += (sender2, e2) => { };
|
||||
SlmGlobals_Mobile.Application.MainPage.Navigation.PushModalAsync(assetRepairForm, false);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
+30
-2
@@ -1,11 +1,11 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.Core.Mobile.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -97,6 +97,34 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
protected abstract void RefreshItemList (uint pageNo = 1);
|
||||
protected abstract void DisplayItemList (SlmWebServiceClient.QueryListResponseData responseData, SacsMessage message = null);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public static List<String> GetItemListBaseStyles ()
|
||||
{
|
||||
return new List<string>()
|
||||
{
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseCss) + "</style>",
|
||||
"<style>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseCss) + "</style>",
|
||||
"<style>",
|
||||
"body{padding:4px;font-size:" + SlmMobile.HtmlFontSize + ";border:1px solid #808080;border-radius:8px;}",
|
||||
"td{padding:0px;}",
|
||||
"tr.other th, tr.other td{background-color:#f0f0f0;}",
|
||||
"div.item{margin:0 0 4px 0;padding:4px;background-color:#f8f8f8;border:2px solid #808080;border-radius:7px;}",
|
||||
"div.item .caption{font-weight:bold;font-size:1.2em;}",
|
||||
"</style>"
|
||||
};
|
||||
}
|
||||
public static List<String> GetItemListBaseScripts ()
|
||||
{
|
||||
return new List<string>()
|
||||
{
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.JQueryUiJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SaBaseJs) + "</script>",
|
||||
"<script>" + SlmResourceConsole.GetTextResource(SlmResourceConsole.TextResource.SlmBaseJs) + "</script>",
|
||||
};
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l A c t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+2
-2
@@ -3,11 +3,11 @@ using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.Core.Mobile.Utils;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Sarand.Core.Mobile.Forms.Views;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
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.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -90,6 +90,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Views
|
||||
if (option.Command != null)
|
||||
{
|
||||
var tapGestureRecognizer = new TapGestureRecognizer();
|
||||
tapGestureRecognizer.Tapped += MeunOption_Tapped;
|
||||
tapGestureRecognizer.Tapped += (s, e) => { option.Command.Execute(null); InvokeMenuOptionClicked(); };
|
||||
optionLabel.GestureRecognizers.Add(tapGestureRecognizer);
|
||||
if (optionImage != null)
|
||||
@@ -98,6 +99,21 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Views
|
||||
}
|
||||
}
|
||||
|
||||
private void MeunOption_Tapped (object sender, EventArgs e)
|
||||
{
|
||||
// Want to highlight option that has been tapped to reassure the user that it is being actioned.
|
||||
// May need to add MenuOptionPanel across grid row to be able to idntify relevant label
|
||||
// rather than relying on the label itself being tapped.
|
||||
Element element = (sender as Element);
|
||||
Label label = (sender as Label);
|
||||
if (sender is Element)
|
||||
{
|
||||
var parent = element.Parent; // Grid.
|
||||
if (label != null)
|
||||
label.TextColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// M e n u E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user