Bulk - Berthing Tasks.
This commit is contained in:
@@ -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.3" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto" android:versionCode="6" android:icon="@drawable/icon_solent_stevedores">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2.4" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto" android:versionCode="7" 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" />
|
||||
|
||||
@@ -24,5 +24,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Mobile\Forms\Layouts\Base\" />
|
||||
<Folder Include="Mobile\Forms\Panels\Utils\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+101
-8
@@ -1,4 +1,6 @@
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.Core.Bus;
|
||||
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;
|
||||
@@ -31,6 +33,14 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
// Berthing.
|
||||
public SlmPickerView PickerAgent { get; } = new SlmPickerView() { LabelText = "Agent", ReadOnly = true };
|
||||
public SlmPickerView PickerCustomer { get; } = new SlmPickerView() { LabelText = "Customer", ReadOnly = true };
|
||||
// Dates.
|
||||
public SlmDateTimePickerView DateTimePickerExpected { get; } = new SlmDateTimePickerView() { LabelText = "Expected" };
|
||||
public SlmDateTimePickerView DateTimePickerArrived { get; } = new SlmDateTimePickerView() { LabelText = "Arrived" };
|
||||
public SlmDateTimePickerView DateTimePickerCompleted { get; } = new SlmDateTimePickerView() { LabelText = "Completed" };
|
||||
public SlmDateTimePickerView DateTimePickerDeparted { get; } = new SlmDateTimePickerView() { LabelText = "Departed" };
|
||||
// Location.
|
||||
public SlmEntryView EntryBerth { get; } = new SlmEntryView() { LabelText = "Berth" };
|
||||
public SlmEntryView EntryBollard { get; } = new SlmEntryView() { LabelText = "Bollard" };
|
||||
// Notes.
|
||||
public SlmEditorView EditorNotes { get; } = new SlmEditorView() { LabelText = "Notes" };
|
||||
|
||||
@@ -42,10 +52,22 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Control events.
|
||||
// Vessel and companies.
|
||||
PickerVessel.SelectedIndexChanged += PickerVessel_SelectedIndexChanged;
|
||||
PickerAgent.SelectedIndexChanged += PickerAgent_SelectedIndexChanged;
|
||||
PickerCustomer.SelectedIndexChanged += PickerCustomer_SelectedIndexChanged;
|
||||
// Dates.
|
||||
DateTimePickerExpected.DateTimeChanged += DateTimePickerExpected_DateTimeChanged;
|
||||
DateTimePickerArrived.DateTimeChanged += DateTimePickerArrived_DateTimeChanged;
|
||||
DateTimePickerCompleted.DateTimeChanged += DateTimePickerCompleted_DateTimeChanged;
|
||||
DateTimePickerDeparted.DateTimeChanged += DateTimePickerDeparted_DateTimeChanged;
|
||||
// Location.
|
||||
EntryBerth.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.Berthing_Berth);
|
||||
EntryBerth.TextChanged += EntryBerth_TextChanged;
|
||||
EntryBollard.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.Berthing_Bollard);
|
||||
EntryBollard.TextChanged += EntryBollard_TextChanged;
|
||||
// Common properties.
|
||||
EditorNotes.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.Berthing_Notes);
|
||||
EditorNotes.TextChanged += EditorNotes_TextChanged;
|
||||
EditorNotes.Completed += EditorNotes_Completed;
|
||||
|
||||
@@ -61,23 +83,60 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
}
|
||||
public void PopulateToControls (SlmBerthing.Data data)
|
||||
{
|
||||
// Vessel.
|
||||
// Vessel and companies.
|
||||
PickerVessel.SelectedItemId = data.VesselId;
|
||||
// Companies.
|
||||
PickerAgent.SelectedItemId = data.CompanyIdAgent;
|
||||
PickerCustomer.SelectedItemId = data.CompanyIdCustomer;
|
||||
// Dates.
|
||||
DateTimePickerExpected.DateTime = data.Expected;
|
||||
DateTimePickerArrived.DateTime = data.Arrived;
|
||||
DateTimePickerCompleted.DateTime = data.Completed;
|
||||
DateTimePickerDeparted.DateTime = data.Departed;
|
||||
// Location.
|
||||
EntryBerth.Text = data.Berth;
|
||||
EntryBollard.Text = data.Bollard;
|
||||
// Common properties.
|
||||
EditorNotes.Text = data.Notes;
|
||||
Changed = false;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public bool IsDataValid (SlmAssetMovement.Data data)
|
||||
public bool IsDataValid (SlmBerthing.Data data)
|
||||
{
|
||||
if (!SysId.IsValid(data.VesselId))
|
||||
{
|
||||
DisplayAlert("Berthing", "Vessel must be selected.", "OK");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateFromControls (SlmAssetMovement.Data data)
|
||||
public void PopulateFromControls (SlmBerthing.Data data)
|
||||
{
|
||||
if (ReadOnly) return;
|
||||
// Vessel and companies.
|
||||
if (PickerVessel.IsVisible && !PickerVessel.ReadOnly)
|
||||
data.VesselId = PickerVessel.SelectedItemId;
|
||||
if (PickerAgent.IsVisible && !PickerAgent.ReadOnly)
|
||||
data.CompanyIdAgent= PickerAgent.SelectedItemId;
|
||||
if (PickerCustomer.IsVisible && !PickerCustomer.ReadOnly)
|
||||
data.CompanyIdCustomer = PickerCustomer.SelectedItemId;
|
||||
// Dates.
|
||||
if (DateTimePickerExpected.IsVisible && !DateTimePickerExpected.ReadOnly)
|
||||
data.Expected = DateTimePickerExpected.DateTime;
|
||||
if (DateTimePickerArrived.IsVisible && !DateTimePickerArrived.ReadOnly)
|
||||
data.Arrived = DateTimePickerArrived.DateTime;
|
||||
if (DateTimePickerCompleted.IsVisible && !DateTimePickerCompleted.ReadOnly)
|
||||
data.Completed = DateTimePickerCompleted.DateTime;
|
||||
if (DateTimePickerDeparted.IsVisible && !DateTimePickerDeparted.ReadOnly)
|
||||
data.Departed = DateTimePickerDeparted.DateTime;
|
||||
// Location.
|
||||
if (EntryBerth.IsVisible && !EntryBerth.ReadOnly)
|
||||
data.Berth = EntryBerth.Text;
|
||||
if (EntryBollard.IsVisible && !EntryBollard.ReadOnly)
|
||||
data.Bollard = EntryBollard.Text;
|
||||
// Common properties.
|
||||
if (EditorNotes.IsVisible && !EditorNotes.ReadOnly)
|
||||
data.Notes = EditorNotes.Text;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -89,9 +148,19 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
// Vessel and companies.
|
||||
PickerVessel.ReadOnly = true;
|
||||
PickerAgent.ReadOnly = ReadOnly;
|
||||
PickerCustomer.ReadOnly = ReadOnly;
|
||||
// Dates.
|
||||
DateTimePickerExpected.ReadOnly = ReadOnly;
|
||||
DateTimePickerArrived.ReadOnly = ReadOnly;
|
||||
DateTimePickerCompleted.ReadOnly = ReadOnly;
|
||||
DateTimePickerDeparted.ReadOnly = ReadOnly;
|
||||
// Location.
|
||||
EntryBerth.ReadOnly = ReadOnly;
|
||||
EntryBollard.ReadOnly = ReadOnly;
|
||||
// Common properties.
|
||||
EditorNotes.ReadOnly = ReadOnly;
|
||||
}
|
||||
|
||||
@@ -102,17 +171,41 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void PickerAgent_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void PickerCustomer_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void DateTimePickerExpected_DateTimeChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
private void DateTimePickerArrived_DateTimeChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
private void DateTimePickerCompleted_DateTimeChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
private void DateTimePickerDeparted_DateTimeChanged (object sender, EventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void EntryBerth_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
private void EntryBollard_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
Changed = true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void EditorNotes_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
+24
-20
@@ -32,9 +32,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
// Properties.
|
||||
// Controls.
|
||||
public SlmPickerView_SystemCodes PickerTaskType { get; } = new SlmPickerView_SystemCodes(Slm.SystemCode.BerthingTaskType) { LabelText = "Task type" };
|
||||
public SlmDateTimePickerView DatePickerStarted { get; } = new SlmDateTimePickerView() { LabelText = "Started" };
|
||||
public SlmDateTimePickerView DatePickerCompleted { get; } = new SlmDateTimePickerView() { LabelText = "Completed" };
|
||||
public SlmEditorView EntryRemarks { get; } = new SlmEditorView() { LabelText = "Remarks" };
|
||||
public SlmDateTimePickerView DateTimePickerStarted { get; } = new SlmDateTimePickerView() { LabelText = "Started" };
|
||||
public SlmDateTimePickerView DateTimePickerCompleted { get; } = new SlmDateTimePickerView() { LabelText = "Completed" };
|
||||
public SlmEditorView EditorRemarks { get; } = new SlmEditorView() { LabelText = "Remarks" };
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
@@ -45,15 +45,15 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Started.
|
||||
DatePickerStarted.DateTime = DateUtil.RoundTime(DateTime.Now, 15, DateUtil.RoundingDirection.Nearest);
|
||||
DateTimePickerStarted.DateTime = DateUtil.RoundTime(DateTime.Now, 15, DateUtil.RoundingDirection.Nearest);
|
||||
|
||||
// Completed.
|
||||
DatePickerCompleted.DateTime = DateUtil.RoundTime(DateTime.Now, 15, DateUtil.RoundingDirection.Nearest);
|
||||
DateTimePickerCompleted.DateTime = DateTimePickerStarted.DateTime;
|
||||
|
||||
// Remarks.
|
||||
EntryRemarks.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.BerthingTask_Remarks);
|
||||
EntryRemarks.TextChanged += EntryRemarks_TextChanged;
|
||||
EntryRemarks.Completed += EntryRemarks_Completed;
|
||||
EditorRemarks.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.BerthingTask_Remarks);
|
||||
EditorRemarks.TextChanged += EntryRemarks_TextChanged;
|
||||
EditorRemarks.Completed += EntryRemarks_Completed;
|
||||
|
||||
Changed = false;
|
||||
}
|
||||
@@ -64,9 +64,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
public void PopulateToControls (SlmBerthingTask.Data data)
|
||||
{
|
||||
PickerTaskType.SelectedCode = berthingTaskTypes.GetCodeForType((int)data.BerthingTaskType);
|
||||
DatePickerStarted.DateTime = data.Started;
|
||||
DatePickerCompleted.DateTime = data.Completed;
|
||||
EntryRemarks.Text = data.Remarks;
|
||||
DateTimePickerStarted.DateTime = data.Started;
|
||||
DateTimePickerCompleted.DateTime = data.Completed;
|
||||
EditorRemarks.Text = data.Remarks;
|
||||
Changed = false;
|
||||
}
|
||||
public bool IsDataValid (SlmBerthingTask.Data data)
|
||||
@@ -89,12 +89,16 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
{
|
||||
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;
|
||||
if (DateTimePickerStarted.Parent != null && DateTimePickerStarted.IsVisible && !DateTimePickerStarted.ReadOnly)
|
||||
{
|
||||
data.Started = DateTimePickerStarted.DateTime;
|
||||
if (DateTimePickerCompleted.Parent == null)
|
||||
data.Completed = DateTimePickerStarted.DateTime;
|
||||
}
|
||||
if (DateTimePickerCompleted.Parent != null && DateTimePickerCompleted.IsVisible && !DateTimePickerCompleted.ReadOnly)
|
||||
data.Completed = DateTimePickerCompleted.DateTime;
|
||||
if (EditorRemarks.Parent != null && EditorRemarks.IsVisible && !EditorRemarks.ReadOnly)
|
||||
data.Remarks = EditorRemarks.Text;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -107,9 +111,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components.Bulk
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
PickerTaskType.ReadOnly = ReadOnly;
|
||||
DatePickerStarted.ReadOnly = ReadOnly;
|
||||
DatePickerCompleted.ReadOnly = ReadOnly;
|
||||
EntryRemarks.ReadOnly = ReadOnly;
|
||||
DateTimePickerStarted.ReadOnly = ReadOnly;
|
||||
DateTimePickerCompleted.ReadOnly = ReadOnly;
|
||||
EditorRemarks.ReadOnly = ReadOnly;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+19
-16
@@ -1,9 +1,11 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.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 System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
@@ -58,8 +60,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
// Application info.
|
||||
settings.Add("App name", AppInfo.Name);
|
||||
settings.Add("Package name", AppInfo.PackageName);
|
||||
settings.Add("Version", AppInfo.VersionString);
|
||||
settings.Add("Build", AppInfo.BuildString);
|
||||
settings.Add("Build", AppInfo.BuildString + " [" + AppInfo.VersionString + "]");
|
||||
|
||||
// Main display info.
|
||||
DisplayInfo mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
|
||||
@@ -74,12 +75,12 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
|
||||
// Device info.
|
||||
settings.Add("Model", DeviceInfo.Model);
|
||||
settings.Add("Manufacturer", DeviceInfo.Manufacturer);
|
||||
settings.Add("Device name", DeviceInfo.Name);
|
||||
if (!StringUtil.IsEmpty(DeviceInfo.Manufacturer) && !DeviceInfo.Manufacturer.EqualsCI("unknown"))
|
||||
settings.Add("Manufacturer", DeviceInfo.Manufacturer);
|
||||
string computerName = SacsSystem.ComputerName;
|
||||
settings.Add("Device name", DeviceInfo.Name + (!StringUtil.IsEmpty(computerName) && computerName.EqualsCI(DeviceInfo.Name) ? " [" + computerName + "]" : ""));
|
||||
settings.Add("Device version", DeviceInfo.VersionString);
|
||||
settings.Add("Platform", DeviceInfo.Platform.ToString());
|
||||
settings.Add("Idiom", DeviceInfo.Idiom.ToString());
|
||||
settings.Add("DeviceType", DeviceInfo.DeviceType.ToString());
|
||||
settings.Add("Platform", DeviceInfo.Platform.ToString() + " - " + DeviceInfo.Idiom.ToString() + (DeviceInfo.DeviceType > 0 ? " [" + DeviceInfo.DeviceType.ToString() + "]" : ""));
|
||||
|
||||
// Version tracking.
|
||||
if (VersionTracking.IsFirstLaunchEver)
|
||||
@@ -88,14 +89,16 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
settings.Add("First launch current", VersionTracking.IsFirstLaunchForCurrentVersion.ToString());
|
||||
if (VersionTracking.IsFirstLaunchForCurrentBuild)
|
||||
settings.Add("First launch build", VersionTracking.IsFirstLaunchForCurrentBuild.ToString());
|
||||
settings.Add("Current version", VersionTracking.CurrentVersion);
|
||||
settings.Add("Current build", VersionTracking.CurrentBuild);
|
||||
settings.Add("Previous version", VersionTracking.PreviousVersion);
|
||||
settings.Add("Previous build", VersionTracking.PreviousBuild);
|
||||
settings.Add("First version", VersionTracking.FirstInstalledVersion);
|
||||
settings.Add("First build", VersionTracking.FirstInstalledBuild);
|
||||
settings.Add("Version history", VersionTracking.VersionHistory.Concat(", "));
|
||||
settings.Add("Build history", VersionTracking.BuildHistory.Concat(", "));
|
||||
if (!StringUtil.IsEmpty(VersionTracking.CurrentBuild))
|
||||
settings.Add("Current build", VersionTracking.CurrentBuild + (!StringUtil.IsEmpty(VersionTracking.CurrentVersion) ? " [" + VersionTracking.CurrentVersion + "]" : ""));
|
||||
if (!StringUtil.IsEmpty(VersionTracking.PreviousBuild))
|
||||
settings.Add("Previous build", VersionTracking.PreviousBuild + (!StringUtil.IsEmpty(VersionTracking.PreviousVersion) ? " [" + VersionTracking.PreviousVersion + "]" : ""));
|
||||
if (!StringUtil.IsEmpty(VersionTracking.FirstInstalledBuild))
|
||||
settings.Add("First build", VersionTracking.FirstInstalledBuild + (!StringUtil.IsEmpty(VersionTracking.FirstInstalledVersion) ? " [" + VersionTracking.FirstInstalledVersion + "]" : ""));
|
||||
if (VersionTracking.VersionHistory.Count() > 0)
|
||||
settings.Add("Version history", VersionTracking.VersionHistory.Concat(", "));
|
||||
if (VersionTracking.BuildHistory.Count() > 0)
|
||||
settings.Add("Build history", VersionTracking.BuildHistory.Concat(", "));
|
||||
|
||||
// Populate settings.
|
||||
int gridRowIdx = -1;
|
||||
|
||||
+13
-13
@@ -231,9 +231,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
if (serviceResponse.Messages.Count > 0)
|
||||
{
|
||||
foreach (SlmWebServiceMessage message in serviceResponse.Messages)
|
||||
msg += SacsSystem.GetMessageLevelCode(message.Level) + " " + message.Message + "\n";
|
||||
msg += SacsSystem.GetMessageLevelCode(message.Level) + " " + message.FormattedMessage + "\n";
|
||||
}
|
||||
if (serviceResponse != null && serviceResponse.StatusCode == SlmWebServiceDfn.StatusSuccess)
|
||||
if (serviceResponse.StatusCode == SlmWebServiceDfn.StatusSuccess)
|
||||
{
|
||||
if (!StringUtil.IsEmpty(msg))
|
||||
{
|
||||
@@ -254,13 +254,13 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
}
|
||||
private async Task<SlmWebServiceClient.StoreItemResponseData> StoreAssetRepairAsync (SlmAssetRepair.Data assetRepair)
|
||||
{
|
||||
// Construct Asset Repair item.
|
||||
// Construct Asset Repair request data.
|
||||
XElement itemElement = new XElement(SlmWebServiceDfn.ElementName.Item);
|
||||
if (SysId.IsValid(assetRepair.Id))
|
||||
itemElement.AppendElement("Id", SysId.ToString(assetRepair.Id));
|
||||
itemElement.AppendElement("AssetMovementId", SysId.ToString(assetRepairData.AssetMovementId));
|
||||
itemElement.AppendElement("RepairInspector", assetRepair.RepairInspector);
|
||||
itemElement.AppendElement("AuthoriseType", assetRepair.AuthoriseType.ToString());
|
||||
itemElement.AppendElement(nameof(SlmAssetRepair.Id), SysId.ToString(assetRepair.Id));
|
||||
itemElement.AppendElement(nameof(SlmAssetRepair.AssetMovementId), SysId.ToString(assetRepairData.AssetMovementId));
|
||||
itemElement.AppendElement(nameof(SlmAssetRepair.RepairInspector), assetRepair.RepairInspector);
|
||||
itemElement.AppendElement(nameof(SlmAssetRepair.AuthoriseType), assetRepair.AuthoriseType.ToString());
|
||||
|
||||
// Repair Jobs.
|
||||
List<SlmAssetRepairJob.Data> jobs = repairJobsPanel.RepairJobs;
|
||||
@@ -271,12 +271,12 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Assets
|
||||
{
|
||||
XElement jobElement = jobsElement.AppendElement("Job");
|
||||
if (SysId.IsValid(repairJob.Id))
|
||||
jobElement.AppendElement("Id", SysId.ToString(repairJob.Id));
|
||||
jobElement.AppendElement("LocationCode", repairJob.LocationCode);
|
||||
jobElement.AppendElement("ComponentCode", repairJob.ComponentCode);
|
||||
jobElement.AppendElement("DamageCode", repairJob.DamageCode);
|
||||
jobElement.AppendElement("RepairCode", repairJob.RepairCode);
|
||||
jobElement.AppendElement("Quantity", repairJob.Quantity.ToString());
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.Id), SysId.ToString(repairJob.Id));
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.LocationCode), repairJob.LocationCode);
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.ComponentCode), repairJob.ComponentCode);
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.DamageCode), repairJob.DamageCode);
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.RepairCode), repairJob.RepairCode);
|
||||
jobElement.AppendElement(nameof(SlmAssetRepairJob.Quantity), repairJob.Quantity.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+163
-14
@@ -1,7 +1,9 @@
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Mobile.Forms.Panels;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
@@ -17,6 +19,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
@@ -38,6 +41,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
private SlmStackLayout panelLayout = new SlmStackLayout() { Orientation = StackOrientation.Vertical };
|
||||
private SlmPanel_PropertySummary panelPropertySummary = new SlmPanel_PropertySummary();
|
||||
private SlmTabControl tabbedView = new SlmTabControl();
|
||||
private SlmPanel_Berthing tabPanelBerthing = null;
|
||||
private SlmPanel_Bulk_BerthingTasks tabPanelBerthingTasks = null;
|
||||
// Data to view/update.
|
||||
private SlmBerthing BerthingToUpdate;
|
||||
private SlmVessel Berthing_Vessel;
|
||||
@@ -174,7 +179,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Asset Repair form.
|
||||
// Berthing form.
|
||||
FormBodyView.Content = panelLayout;
|
||||
|
||||
// Summary Preopeties panel.
|
||||
@@ -204,20 +209,24 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
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);
|
||||
SlmPanel_Berthing.Config configPanelBerthing = new SlmPanel_Berthing.Config();
|
||||
configPanelBerthing.BerthingToUpdate = BerthingToUpdate;
|
||||
configPanelBerthing.Berthing_Vessel = Berthing_Vessel;
|
||||
configPanelBerthing.Berthing_Company_Agent = Berthing_Company_Agent;
|
||||
configPanelBerthing.Berthing_Company_Customer = Berthing_Company_Customer;
|
||||
configPanelBerthing.ReadOnly = true;
|
||||
tabPanelBerthing = new SlmPanel_Berthing(configPanelBerthing);
|
||||
tabPanelBerthing.Padding = SlmMobile.TabControlBodyPadding;
|
||||
tabPanelBerthing.BackgroundColor = SlmMobile.TabControlBodyBackgroundColor;
|
||||
tabbedView.AddPanel("Berthing", tabPanelBerthing);
|
||||
|
||||
// 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);
|
||||
SlmPanel_Bulk_BerthingTasks.Config panelBerthingTasksConfig = new SlmPanel_Bulk_BerthingTasks.Config();
|
||||
panelBerthingTasksConfig.BerthingForm = this;
|
||||
tabPanelBerthingTasks = new SlmPanel_Bulk_BerthingTasks(panelBerthingTasksConfig);
|
||||
tabPanelBerthingTasks.Padding = SlmMobile.TabControlBodyPadding;
|
||||
tabPanelBerthingTasks.BackgroundColor = SlmMobile.TabControlBodyBackgroundColor;
|
||||
tabbedView.AddPanel("Tasks", tabPanelBerthingTasks);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -236,7 +245,147 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool SaveFormData ()
|
||||
{
|
||||
return true;
|
||||
// Validate form properties.
|
||||
SlmBerthing.Data berthingData = null;
|
||||
if (tabPanelBerthing != null)
|
||||
{
|
||||
berthingData = BerthingToUpdate?.GetData() ?? new SlmBerthing.Data();
|
||||
tabPanelBerthing.PopulateFromControls(berthingData);
|
||||
if (!tabPanelBerthing.IsDataValid(berthingData))
|
||||
return false;
|
||||
}
|
||||
if (BerthingToUpdate == null)
|
||||
{
|
||||
DisplayAlert("Berthings cannot be created here.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Berthing exists - vlidate properties against previous values.
|
||||
if (BerthingToUpdate.VesselId != berthingData.VesselId)
|
||||
{
|
||||
DisplayAlert("Vessel cannot be changed here.");
|
||||
return false;
|
||||
}
|
||||
if (BerthingToUpdate.CompanyIdAgent != berthingData.CompanyIdAgent)
|
||||
{
|
||||
DisplayAlert("Vessel cannot be changed here.");
|
||||
return false;
|
||||
}
|
||||
if (BerthingToUpdate.CompanyIdCustomer != berthingData.CompanyIdCustomer)
|
||||
{
|
||||
DisplayAlert("Vessel cannot be changed here.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate Berthing Tasks.
|
||||
List<SlmBerthingTask.Data> berthingTasks = null;
|
||||
if (tabPanelBerthingTasks != null)
|
||||
{
|
||||
berthingTasks = tabPanelBerthingTasks.BerthingTasks;
|
||||
}
|
||||
|
||||
// Display 'Please wait' while data is sent to server.
|
||||
SlmPanel_Progress.Config configPanelProgress = new SlmPanel_Progress.Config();
|
||||
SlmPanel_Progress panelProgress = new SlmPanel_Progress(configPanelProgress);
|
||||
panelProgress.ProgressMessage = "Sending data to server.\n\nPlease wait...";
|
||||
SetAdditionalPanel(panelProgress);
|
||||
|
||||
|
||||
// Store the Berthing.
|
||||
bool formDataSaved = false;
|
||||
if (AddMode)
|
||||
{
|
||||
formDataSaved = StoreBerthing(berthingData, berthingTasks);
|
||||
}
|
||||
else
|
||||
{
|
||||
BerthingToUpdate.SetData(berthingData);
|
||||
formDataSaved = StoreBerthing(BerthingToUpdate.GetData(), berthingTasks);
|
||||
}
|
||||
ClearAdditionalPanel();
|
||||
return formDataSaved;
|
||||
}
|
||||
private bool StoreBerthing (SlmBerthing.Data berthingData, List<SlmBerthingTask.Data> berthingTasks)
|
||||
{
|
||||
try
|
||||
{
|
||||
Task<SlmWebServiceClient.StoreItemResponseData> storeTask = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
return await StoreBerthingAsync(berthingData, berthingTasks);
|
||||
}
|
||||
catch (Exception exc) { Logger.Error(GetType().Name + ".StoreBerthing " + exc.GetLogMessage()); }
|
||||
return null;
|
||||
});
|
||||
if (!storeTask.IsCompleted) storeTask.Wait();
|
||||
SlmWebServiceClient.StoreItemResponseData serviceResponse = storeTask.Result;
|
||||
if (serviceResponse == null)
|
||||
{
|
||||
DisplayAlert("Failed to store Berthing.");
|
||||
return false;
|
||||
}
|
||||
String msg = "";
|
||||
if (serviceResponse.Messages.Count > 0)
|
||||
{
|
||||
foreach (SlmWebServiceMessage message in serviceResponse.Messages)
|
||||
msg += SacsSystem.GetMessageLevelCode(message.Level) + " " + message.FormattedMessage + "\n";
|
||||
}
|
||||
if (serviceResponse.StatusCode == SlmWebServiceDfn.StatusSuccess)
|
||||
{
|
||||
if (!StringUtil.IsEmpty(msg))
|
||||
{
|
||||
msg = "Messages returned when storing Berthing:\n" + msg;
|
||||
DisplayAlert(msg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
msg = "Failed to store Berthing.\n" + msg;
|
||||
DisplayAlert(msg);
|
||||
return false;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Error(GetType().Name + ".SaveFormData " + exc.GetType().Name + ": " + exc.Message);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private async Task<SlmWebServiceClient.StoreItemResponseData> StoreBerthingAsync (SlmBerthing.Data berthingData, List<SlmBerthingTask.Data> berthingTasks)
|
||||
{
|
||||
// Construct Berthing request data.
|
||||
XElement itemElement = new XElement(SlmWebServiceDfn.ElementName.Item);
|
||||
if (SysId.IsValid(berthingData.Id))
|
||||
itemElement.AppendElement(nameof(SlmBerthing.Id), SysId.ToString(berthingData.Id));
|
||||
// Berthing properties cannot be changed as yet.
|
||||
//itemElement.AppendElement(nameof(SlmBerthing.VesselId), SysId.ToString(berthingData.VesselId));
|
||||
//itemElement.AppendElement(nameof(SlmBerthing.CompanyIdAgent), SysId.ToString(berthingData.CompanyIdAgent));
|
||||
//itemElement.AppendElement(nameof(SlmBerthing.CompanyIdCustomer), SysId.ToString(berthingData.CompanyIdCustomer));
|
||||
//itemElement.AppendElement(nameof(SlmBerthing.Notes), berthingData.Notes);
|
||||
|
||||
// Berthing Tasks.
|
||||
if (berthingTasks.Count > 0)
|
||||
{
|
||||
XElement berthingTasksElement = itemElement.AppendElement("BerthingTasks");
|
||||
foreach (SlmBerthingTask.Data berthingTask in berthingTasks)
|
||||
{
|
||||
XElement berthingTaskElement = berthingTasksElement.AppendElement("BerthingTask");
|
||||
if (SysId.IsValid(berthingTask.Id))
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.Id), SysId.ToString(berthingTask.Id));
|
||||
if (SysId.IsValid(berthingTask.BerthingId))
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.BerthingId), SysId.ToString(berthingTask.BerthingId));
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.BerthingTaskType), ((int)berthingTask.BerthingTaskType).ToString());
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.Started), DateUtil.FormatXmlDateTime(berthingTask.Started));
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.Completed), DateUtil.FormatXmlDateTime(berthingTask.Completed));
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.Remarks), berthingTask.Remarks);
|
||||
berthingTaskElement.AppendElement(nameof(SlmBerthingTask.Notes), berthingTask.Notes);
|
||||
}
|
||||
}
|
||||
|
||||
// Store Asset Repair via Web Service.
|
||||
SacsTaskData taskData = new SacsTaskData(null);
|
||||
return await BerthingMgr.StoreAssetRepair_Mobile(itemElement, taskData);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool QueryCancelForm ()
|
||||
|
||||
+4
-2
@@ -65,9 +65,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
|
||||
// Controls.
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.PickerTaskType);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.DatePickerStarted);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.DateTimePickerStarted);
|
||||
//gridProperties.AddControlViewToGrid(berthingTaskComponents.DatePickerCompleted);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.EntryRemarks);
|
||||
gridProperties.AddControlViewToGrid(berthingTaskComponents.EditorRemarks);
|
||||
|
||||
if (AddMode)
|
||||
{
|
||||
@@ -99,6 +99,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Forms.Bulk
|
||||
protected override bool SaveFormData ()
|
||||
{
|
||||
SlmBerthingTask.Data berthingTaskData = (AddMode ? new SlmBerthingTask.Data() : config.BerthingTaskToUpdate.Clone());
|
||||
if (AddMode)
|
||||
berthingTaskData.BerthingId = config.BerthingId;
|
||||
berthingTaskComponents.PopulateFromControls(berthingTaskData);
|
||||
if (!berthingTaskComponents.IsDataValid(berthingTaskData))
|
||||
return false;
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@ 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;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates
|
||||
private ImageButton buttonMenu = new ImageButton();
|
||||
private SlmContentView applicationBarBorderBottom = new SlmContentView();
|
||||
// Page body.
|
||||
private AbsoluteLayout absoluteLayout = new AbsoluteLayout();
|
||||
private SlmAbsoluteLayout absoluteLayout = new SlmAbsoluteLayout();
|
||||
private SlmScrollView pageBodyScroll = new SlmScrollView();
|
||||
private SlmContentView pageBodyStatic = new SlmContentView();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Properties grid.
|
||||
BackgroundColor = SlmMobile.PageBackgroundColor;
|
||||
Content = gridProperties;
|
||||
gridProperties.RowSpacing = SlmMobile.FormGridRowSpacing;
|
||||
gridProperties.ColumnSpacing = SlmMobile.FormGridColumnSpacing;
|
||||
@@ -66,6 +67,16 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.PickerAgent);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.PickerCustomer);
|
||||
|
||||
// Dates.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.DateTimePickerExpected);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.DateTimePickerArrived);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.DateTimePickerCompleted);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.DateTimePickerDeparted);
|
||||
|
||||
// Location.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.EntryBerth);
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.EntryBollard);
|
||||
|
||||
// Notes.
|
||||
gridProperties.AddControlViewToGrid(berthingComponents.EditorNotes);
|
||||
|
||||
@@ -83,6 +94,44 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
berthingComponents.PopulateToControls(config.BerthingToUpdate?.GetData() ?? new SlmBerthing.Data());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P o p u l a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateToControls (SlmVessel.Data data)
|
||||
{
|
||||
berthingComponents.PopulateToControls(data);
|
||||
}
|
||||
public void PopulateToControls (SlmBerthing.Data data)
|
||||
{
|
||||
berthingComponents.PopulateToControls(data);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public bool IsDataValid (SlmBerthing.Data data)
|
||||
{
|
||||
return berthingComponents.IsDataValid(data);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateFromControls (SlmBerthing.Data data)
|
||||
{
|
||||
berthingComponents.PopulateFromControls(data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
berthingComponents.IsEnabled = IsEnabled;
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
berthingComponents.ReadOnly = ReadOnly;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
+17
-10
@@ -68,7 +68,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
// Main layout - vertical stack.
|
||||
VerticalOptions = LayoutOptions.Fill;
|
||||
BackgroundColor = SlmMobile.PageBackgroundColor;
|
||||
panelLayout.VerticalOptions = LayoutOptions.Fill;
|
||||
panelLayout.Spacing = 2.0;
|
||||
Content = panelLayout;
|
||||
|
||||
// Messages panel.
|
||||
@@ -167,16 +169,19 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
List<String> html = new List<string>();
|
||||
html.Add("<html><head>" + GetBerthingTaskListStyles().Concat("\n") + GetBerthingTaskListScripts().Concat("\n") + "</head><body>");
|
||||
int berthingTaskCount = 0;
|
||||
foreach (SlmBerthingTask.Data item in berthingTaskDataList)
|
||||
{
|
||||
html.Add("<div id='BthTsk-" + SysId.ToString(item.Id) + "' class='item' ondblclick='slm.openBerthingTask(" + SysId.ToString(item.Id) + ")'>");
|
||||
berthingTaskCount++;
|
||||
html.Add("<div id='BthTskIdx-" + (berthingTaskCount-1).ToString() + "' class='item' ondblclick='slm.openBerthingTask(" + (berthingTaskCount - 1).ToString() + ")'>");
|
||||
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(" </tr>");
|
||||
html.Add(" <tr>");
|
||||
html.Add(" <td class='label'>Remarks</td><td class='value' colspan='3'>" + item.Remarks.ReplaceAll("\n", "<br/>") + "</td>");
|
||||
List<String> remarkLines = new List<string>(item.Remarks.Split('\n'));
|
||||
html.Add(" <td class='label'>Remarks</td><td class='value' colspan='3'>" + remarkLines.ExtractValues(3).Concat("<br/>") + "</td>");
|
||||
html.Add(" </tr>");
|
||||
if (SacsSystem.DebugMode)
|
||||
{
|
||||
@@ -196,6 +201,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
List<string> styles = new List<string>(SlmMainPanel_ItemList.GetItemListBaseStyles());
|
||||
styles.AddRange(new String[]
|
||||
{
|
||||
"<style>",
|
||||
"body{margin:0;border-width:0;}",
|
||||
"</style>",
|
||||
});
|
||||
return styles;
|
||||
}
|
||||
@@ -205,10 +213,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
scripts.AddRange(new String[]
|
||||
{
|
||||
"<script>",
|
||||
"slm.openBerthingTask=function(id)",
|
||||
"slm.openBerthingTask=function(idx)",
|
||||
"{",
|
||||
//" alert('slm.openBerthing Id: '+id)",
|
||||
" document.location=\"" + SaxWebView.AppActionPrefix + berthingTaskUpdatePrefix + "\"+id;",
|
||||
//" alert('slm.openBerthing Idx: '+idx)",
|
||||
" document.location=\"" + SaxWebView.AppActionPrefix + berthingTaskUpdatePrefix + "\"+idx;",
|
||||
"}",
|
||||
"$(function()",
|
||||
"{",
|
||||
@@ -247,14 +255,14 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
if (SacsSystem.DebugMode) Logger.Debug(fn + " AppAction: " + eventArgs.AppAction);
|
||||
if (eventArgs.AppAction.StartsWithCI(berthingTaskUpdatePrefix))
|
||||
{
|
||||
SysId berthingTaskId = new SysId(StringUtil.ToInt(eventArgs.AppAction.Right(eventArgs.AppAction.Length - berthingTaskUpdatePrefix.Length)));
|
||||
if (!SysId.IsValid(berthingTaskId))
|
||||
int berthingTaskIdx = StringUtil.ToInt(eventArgs.AppAction.Right(eventArgs.AppAction.Length - berthingTaskUpdatePrefix.Length));
|
||||
if (berthingTaskIdx < 0 || berthingTaskIdx >= BerthingTasks.Count)
|
||||
{
|
||||
DisplayAlert(MessageCaption, "Invalid berthing task selected.", "OK");
|
||||
return;
|
||||
}
|
||||
SlmBerthingTask.Data berthingTaskData = berthingTaskDataList.Find(item => item.Id.Equals(berthingTaskId));
|
||||
if (!SysId.IsValid(berthingTaskId))
|
||||
SlmBerthingTask.Data berthingTaskData = berthingTaskDataList[berthingTaskIdx];
|
||||
if (berthingTaskData == null)
|
||||
{
|
||||
DisplayAlert(MessageCaption, "Failed to retrieve berthing task.", "OK");
|
||||
return;
|
||||
@@ -268,7 +276,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Bulk
|
||||
{
|
||||
if (!berthingTaskForm.Cancelled)
|
||||
{
|
||||
berthingTaskDataList.Add(berthingTaskData);
|
||||
RefreshPanels();
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -370,7 +370,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main.Bulk
|
||||
// Data will be retrieved and validated by the page.
|
||||
SlmFormPage_Bulk_Berthing.Config pageConfig = new SlmFormPage_Bulk_Berthing.Config();
|
||||
pageConfig.BerthingIdToUpdate = berthingId;
|
||||
pageConfig.ReadOnly = true;
|
||||
pageConfig.ReadOnly = false;
|
||||
if (pageConfig.ReadOnly) pageConfig.NavigationMode = SlmFormPage.NavigationMode.Close;
|
||||
SlmFormPage_Bulk_Berthing assetRepairForm = new SlmFormPage_Bulk_Berthing (pageConfig);
|
||||
//assetRepairForm.Disappearing += (sender2, e2) => { };
|
||||
|
||||
+30
-20
@@ -1,4 +1,6 @@
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.Core.Mobile.Utils;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Views;
|
||||
@@ -23,9 +25,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
//-------------------------------------------------------------------
|
||||
// Data members
|
||||
private Config config;
|
||||
private Image imageLogo = new Image();
|
||||
private readonly List<SaxButton> favouriteActionButtons = new List<SaxButton>();
|
||||
// Configuration grid.
|
||||
private SlmGrid gridConfig = new SlmGrid();
|
||||
private SlmGrid gridHome = new SlmGrid();
|
||||
private SlmComponents_Config configComponents;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -48,27 +51,34 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
protected void InitialiseComponents ()
|
||||
{
|
||||
// Configuration grid.
|
||||
Content = gridConfig;
|
||||
gridConfig.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridConfig.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
// Config options.
|
||||
int gridRowIdx = -1;
|
||||
Content = gridHome;
|
||||
gridHome.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridHome.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
|
||||
// Logo.
|
||||
int gridRowIdx = gridHome.RowDefinitions.Count;
|
||||
gridHome.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
imageLogo.Source = SacsImageUtils.GetImageFromByteArray(SlmResourceConsole.GetImageResource(SlmResourceConsole.ImageResource.Logo_Solent_Stevedores_78_png));
|
||||
imageLogo.Margin = new Thickness(0, 4, 0, 4);
|
||||
gridHome.Children.Add(imageLogo, 0, gridRowIdx);
|
||||
Grid.SetColumnSpan(imageLogo, 2);
|
||||
|
||||
// Site.
|
||||
gridRowIdx++;
|
||||
gridConfig.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridConfig.Children.Add(configComponents.LabelSite, 0, gridRowIdx);
|
||||
gridConfig.Children.Add(configComponents.PickerSite, 1, gridRowIdx);
|
||||
gridRowIdx = gridHome.RowDefinitions.Count;
|
||||
gridHome.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridHome.Children.Add(configComponents.LabelSite, 0, gridRowIdx);
|
||||
gridHome.Children.Add(configComponents.PickerSite, 1, gridRowIdx);
|
||||
// User.
|
||||
gridRowIdx++;
|
||||
gridConfig.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridConfig.Children.Add(configComponents.LabelUser, 0, gridRowIdx);
|
||||
gridConfig.Children.Add(configComponents.EntryUser, 1, gridRowIdx);
|
||||
gridRowIdx = gridHome.RowDefinitions.Count;
|
||||
gridHome.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridHome.Children.Add(configComponents.LabelUser, 0, gridRowIdx);
|
||||
gridHome.Children.Add(configComponents.EntryUser, 1, gridRowIdx);
|
||||
Grid.SetColumnSpan(configComponents.EntryUser, 2);
|
||||
// Email.
|
||||
gridRowIdx++;
|
||||
gridConfig.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridConfig.Children.Add(configComponents.LabelEmail, 0, gridRowIdx);
|
||||
gridConfig.Children.Add(configComponents.EntryEmail, 1, gridRowIdx);
|
||||
gridRowIdx = gridHome.RowDefinitions.Count;
|
||||
gridHome.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridHome.Children.Add(configComponents.LabelEmail, 0, gridRowIdx);
|
||||
gridHome.Children.Add(configComponents.EntryEmail, 1, gridRowIdx);
|
||||
Grid.SetColumnSpan(configComponents.EntryEmail, 2);
|
||||
|
||||
// ToDo 'Favourite' buttons.
|
||||
@@ -87,8 +97,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
*/
|
||||
foreach (SaxButton favouriteActionButton in favouriteActionButtons)
|
||||
{
|
||||
gridRowIdx++;
|
||||
gridConfig.Children.Add(favouriteActionButton, 0, gridRowIdx);
|
||||
gridRowIdx = gridHome.RowDefinitions.Count;
|
||||
gridHome.Children.Add(favouriteActionButton, 0, gridRowIdx);
|
||||
Grid.SetColumnSpan(favouriteActionButton, 2);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -64,23 +64,23 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
componentGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
componentGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
componentGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
int gridRowIdx = -1;
|
||||
|
||||
// Logo.
|
||||
gridRowIdx++;
|
||||
int gridRowIdx = componentGrid.RowDefinitions.Count;
|
||||
componentGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
imageLogo.Source = SacsImageUtils.GetImageFromByteArray(SlmResourceConsole.GetImageResource(SlmResourceConsole.ImageResource.Logo_Solent_Stevedores_78_png));
|
||||
imageLogo.Margin = new Thickness(0, 4, 0, 4);
|
||||
componentGrid.Children.Add(imageLogo, 0, gridRowIdx);
|
||||
Grid.SetColumnSpan(imageLogo, 2);
|
||||
|
||||
// Site.
|
||||
gridRowIdx++;
|
||||
gridRowIdx = componentGrid.RowDefinitions.Count;
|
||||
componentGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
componentGrid.Children.Add(loginComponents.LabelSite, 0, gridRowIdx);
|
||||
componentGrid.Children.Add(loginComponents.PickerSite, 1, gridRowIdx);
|
||||
|
||||
// Email.
|
||||
gridRowIdx++;
|
||||
gridRowIdx = componentGrid.RowDefinitions.Count;
|
||||
componentGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
componentGrid.Children.Add(loginComponents.LabelEmail, 0, gridRowIdx);
|
||||
componentGrid.Children.Add(loginComponents.EntryEmail, 1, gridRowIdx);
|
||||
@@ -88,14 +88,14 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Main
|
||||
if (SacsSystem.DebugMode && StringUtil.IsEmpty(loginComponents.EntryEmail.Text)) loginComponents.EntryEmail.Text = "andy@sarand.com";
|
||||
|
||||
// Password.
|
||||
gridRowIdx++;
|
||||
gridRowIdx = componentGrid.RowDefinitions.Count;
|
||||
componentGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
componentGrid.Children.Add(loginComponents.LabelPassword, 0, gridRowIdx);
|
||||
componentGrid.Children.Add(loginComponents.EntryPassword, 1, gridRowIdx);
|
||||
Grid.SetColumnSpan(loginComponents.EntryPassword, 2);
|
||||
|
||||
// Login action button.
|
||||
gridRowIdx++;
|
||||
gridRowIdx = componentGrid.RowDefinitions.Count;
|
||||
componentGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
buttonLogin.VerticalOptions = LayoutOptions.Start;
|
||||
buttonLogin.Padding = new Thickness(4, 4);
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
public static Color ItemListHeaderBorderColor = ApplicationBarBackgroundColor;
|
||||
public static Color ItemListHeaderBackgroundColor = Color.FromHex("#F0F0F0");
|
||||
// Forms.
|
||||
public static Color FormBackgroundColor { get; } = Color.FromHex("#e9f6fb");
|
||||
public static double FormGridRowSpacing { get; } = 4.0;
|
||||
public static double FormGridColumnSpacing { get; } = 4.0;
|
||||
// Controls.
|
||||
@@ -112,6 +113,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
public static Color TabControlHeaderBackgroundColor { get; } = Color.Transparent;
|
||||
public static Color TabControlCaptionBackgroundColor { get; } = Color.FromHex("#E0E0E0");
|
||||
public static Color TabControlBodyBackgroundColor { get; } = Color.FromHex("#F8F8F8");
|
||||
public static Thickness TabControlBodyPadding { get; } = new Thickness(4.0);
|
||||
// Associated items panel.
|
||||
public static Color AssociatedItemsCaptionBackgroundColor { get; } = Color.FromHex("#becee4");
|
||||
public static Color AssociatedItemsCaptionTextColor { get; } = Color.FromHex("#f8f8f8");
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
{
|
||||
@@ -139,6 +140,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
configRequest.DataType = dataType;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.Host = StringUtil.EmptyOnNull(DeviceInfo.Name).Left(64);
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -28,6 +29,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
|
||||
// Control events.
|
||||
DateTimePicker.BackgroundColor = Color.Transparent;
|
||||
DateTimePicker.DateSelected += DateTimePicker_DateSelected;
|
||||
DateTimePicker.TimeChanged += DateTimePicker_TimeChanged;
|
||||
DateTimePicker.Focused += DateTimePicker_Focused;
|
||||
DateTimePicker.Unfocused += DateTimePicker_Unfocused;
|
||||
|
||||
@@ -74,12 +76,23 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.ControlViews
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public event EventHandler<EventArgs> DateTimeChanged;
|
||||
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);
|
||||
if (DateTimeChanged != null) DateTimeChanged.Invoke(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public event EventHandler<SaxTimePicker.TimeChangedEventArgs> TimeChanged;
|
||||
private void DateTimePicker_TimeChanged (object sender, SaxTimePicker.TimeChangedEventArgs e)
|
||||
{
|
||||
ReadOnlyText = DateTimePicker.FormattedDateTime;
|
||||
if (ReadOnly) return;
|
||||
if (TimeChanged != null) TimeChanged.Invoke(sender, e);
|
||||
if (DateTimeChanged != null) DateTimeChanged.Invoke(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void DateTimePicker_Focused (object sender, FocusEventArgs e)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using Sarand.Core.Mobile.Forms.Layouts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Layouts
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmAbsoluteLayout : SaxAbsoluteLayout
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmAbsoluteLayout ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -37,6 +37,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
private SlmBerthingMgr_Mobile berthingMgr;
|
||||
private SlmAssetMgr_Mobile assetMgr;
|
||||
private SlmWebServiceClient webServiceClient;
|
||||
// Form layout - to allow popup content over main layout.
|
||||
private SlmAbsoluteLayout formLayout = new SlmAbsoluteLayout();
|
||||
// Main grid.
|
||||
private SlmGrid gridPage = new SlmGrid();
|
||||
// Caption bar.
|
||||
@@ -98,25 +100,34 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
BackgroundColor = SlmMobile.PageBaseColor;
|
||||
this.SizeChanged += OnSizeChanged;
|
||||
|
||||
// Base layout.
|
||||
Content = gridPage;
|
||||
BackgroundColor = SlmMobile.PageBackgroundColor;
|
||||
// NB Form layout is 'Absolute' to allow overlays, eg. to display progress info.
|
||||
Content = formLayout;
|
||||
//formLayout.BackgroundColor = Color.LightGreen;
|
||||
formLayout.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
formLayout.VerticalOptions = LayoutOptions.FillAndExpand;
|
||||
|
||||
// Form grid.
|
||||
formLayout.Children.Add(gridPage, new Rectangle(0,0,1,1), AbsoluteLayoutFlags.All);
|
||||
gridPage.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
gridPage.VerticalOptions = LayoutOptions.FillAndExpand;
|
||||
gridPage.Margin = new Thickness(0);
|
||||
gridPage.Padding = new Thickness(0);
|
||||
gridPage.RowSpacing = 4;
|
||||
gridPage.ColumnSpacing = 0;
|
||||
gridPage.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
gridPage.BackgroundColor = SlmMobile.PageBackgroundColor;
|
||||
//gridPage.BackgroundColor = Color.LightCoral;
|
||||
|
||||
// Page grid has 3 rows: Caption, body, footer (navgation controls).
|
||||
int pageGridRow = -1;
|
||||
|
||||
// Caption bar.
|
||||
pageGridRow++;
|
||||
int pageGridRow = gridPage.RowDefinitions.Count;
|
||||
gridPage.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridPage.Children.Add(viewCaptionBar, 0, pageGridRow);
|
||||
viewCaptionBar.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
viewCaptionBar.Padding = new Thickness(SlmMobile.PageCaptionPaddingHorizontal, SlmMobile.PageCaptionPaddingVertical);
|
||||
viewCaptionBar.BackgroundColor = SlmMobile.ApplicationBarBackgroundColor;
|
||||
viewCaptionBar.Children.Add(labelCaption);
|
||||
@@ -127,7 +138,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
labelCaption.HorizontalTextAlignment = TextAlignment.Center;
|
||||
|
||||
// Page body.
|
||||
pageGridRow++;
|
||||
pageGridRow = gridPage.RowDefinitions.Count;
|
||||
gridPage.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Star });
|
||||
gridPage.Children.Add(scrollViewBody, 0, pageGridRow);
|
||||
scrollViewBody.Padding = new Thickness(SlmMobile.PageBodyPaddingHorizontalMin, SlmMobile.PageBodyPaddingVerticalMin);
|
||||
@@ -135,7 +146,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
scrollViewBody.Content = contentViewBody;
|
||||
|
||||
// Navigation bar.
|
||||
pageGridRow++;
|
||||
pageGridRow = gridPage.RowDefinitions.Count;
|
||||
gridPage.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridPage.Children.Add(viewNavigation, 0, pageGridRow);
|
||||
viewNavigation.Content = gridNavigation;
|
||||
@@ -184,6 +195,21 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l s
|
||||
//-------------------------------------------------------------------
|
||||
protected void SetAdditionalPanel (ContentView panel)
|
||||
{
|
||||
ClearAdditionalPanel();
|
||||
formLayout.Children.Add(panel, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
|
||||
}
|
||||
protected void ClearAdditionalPanel ()
|
||||
{
|
||||
// Remove all but the first child on the form layout - this is the form itself.
|
||||
while (formLayout.Children.Count > 1)
|
||||
formLayout.Children.RemoveAt(1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
@@ -232,7 +258,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Pages
|
||||
CloseForm();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Confirm that form is valid and details saved before closig the form page.</summary>
|
||||
/// <summary>Confirm that form is valid and details saved before closing the form page.</summary>
|
||||
protected void ButtonOk_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
bool saveFormData = SaveFormData();
|
||||
|
||||
@@ -27,9 +27,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel ()
|
||||
public SlmPanel () :this(new Config())
|
||||
{
|
||||
this.config = new Config();
|
||||
}
|
||||
protected SlmPanel (Config config)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using Sarand.Core.Mobile.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPanel_Progress : SaxPanel_Progress
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SaxPanel_Progress.Config
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel_Progress (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
|
||||
// Styling.
|
||||
ProgressMessageFontSize = ProgressMessageDefaultFontSize * SlmMobile.FontSizeRatio;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -351,14 +351,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetAddressRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Address;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Address, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -288,14 +288,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetCompanyRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Company;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Company, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -604,14 +604,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetAssetMovementRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.AssetMovement;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.AssetMovement, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -358,14 +358,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetAssetRepairRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.AssetRepair;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.AssetRepair, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -229,14 +229,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetContainerRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Container;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Container, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -282,14 +282,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetBerthingCostRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.BerthingCost;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.BerthingCost, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -298,14 +298,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetBerthingResourceRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.BerthingResource;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.BerthingResource, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -245,14 +245,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetBerthingTaskRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.BerthingTask;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.BerthingTask, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -77,6 +77,18 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public async Task<SlmWebServiceClient.StoreItemResponseData> StoreAssetRepair_Mobile (XElement itemElement, SacsTaskData taskData)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
// Construct Web Service request.
|
||||
SlmWebServiceRequest.Config configRequest = GetBerthingRequestConfig(SlmWebServiceRequest.RequestType.Store, taskData.Debug);
|
||||
|
||||
// Execute web service request
|
||||
return await webServiceClient.StoreItem(configRequest, itemElement, taskData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Berthing.
|
||||
public override bool InsertBerthing (SlmBerthing berthing, DbUpdateInfo dbUpdateInfo)
|
||||
@@ -305,14 +317,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetBerthingRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Berthing;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Berthing, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -403,14 +403,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetCruiseBerthingRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.CruiseBerthing;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.CruiseBerthing, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -288,14 +288,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetDischargeHoldRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.DischargeHold;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.DischargeHold, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -308,14 +308,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetDischargeRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Discharge;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Discharge, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -267,14 +267,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetVesselRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Vessel;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Vessel, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -295,14 +295,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetChecklistItemRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.ChecklistItem;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.ChecklistItem, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -267,14 +267,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetChecklistRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Checklist;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Checklist, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -301,14 +301,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetItemChecklistItemRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.ItemChecklistItem;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.ItemChecklistItem, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -285,14 +285,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetItemChecklistRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.ItemChecklist;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.ItemChecklist, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -308,14 +308,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetCommodityRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Commodity;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Commodity, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -284,14 +284,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetCommodityLocationRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.CommodityLocation;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.CommodityLocation, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -293,14 +293,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStockLevelRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StockLevel;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StockLevel, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -274,14 +274,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStockLoadingRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StockLoading;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StockLoading, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -281,14 +281,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStockLocationRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StockLocation;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StockLocation, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -311,14 +311,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStockMovementRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StockMovement;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StockMovement, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -268,14 +268,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetDataItemValueRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.DataItemValue;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.DataItemValue, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -5,16 +5,21 @@ using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.Mgr;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
{
|
||||
//=======================================================================
|
||||
public interface ISlmItemMgr_Mobile
|
||||
{
|
||||
SlmSiteDefinition SiteDefinition { get; }
|
||||
String UserCode { get; }
|
||||
String EmailAddress { get; }
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -52,6 +57,23 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
item.SetUpdateStamp(itemData.GetDateTimeValue("UpdateOn"), itemData.GetIdValue("UpdateBy"), itemData.GetValue("UpdateHost"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public static SlmWebServiceRequest.Config GetRequestConfig (this ISlmItemMgr_Mobile mgr, SlmWebServiceRequest.DataType dataType, SlmWebServiceRequest.RequestType requestType, bool debug)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = dataType;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = mgr.SiteDefinition;
|
||||
configRequest.Context.Host = StringUtil.EmptyOnNull(DeviceInfo.Name).Left(64);
|
||||
configRequest.Context.User = mgr.UserCode;
|
||||
configRequest.Context.Email = mgr.EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
configRequest.SoapEnvelope = SacsSystem.DebugMode ? (SlmMobile.Random.Next(2) == 1) : false;
|
||||
if (configRequest.SoapEnvelope)
|
||||
configRequest.SoapPrefix = new List<String>() { "", "SOAP", "soap", "S", "s" }[SlmMobile.Random.Next(5)];
|
||||
return configRequest;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Convert columns to list of sort columns for population of XML request.</summary>
|
||||
public static List<String> GetSortColumns_Mobile<TColumn> (this ISlmItemMgr_Mobile mgr, SacsHierarchyItem.Params prmCompany) where TColumn : struct, IConvertible
|
||||
|
||||
@@ -269,14 +269,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffAllocationRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffAllocation;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffAllocation, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -287,14 +287,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffJobRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffJob;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffJob, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -267,14 +267,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffMemberAvailabilityRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffMemberAvailability;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffMemberAvailability, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -266,14 +266,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffMemberSkillRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffMemberSkill;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffMemberSkill, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -321,14 +321,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffMemberRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffMember;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffMember, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -266,14 +266,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffTaskSkillRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffTaskSkill;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffTaskSkill, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -292,14 +292,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetStaffTaskRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.StaffTask;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.StaffTask, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -322,14 +322,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetRequirementRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Requirement;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Requirement, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -295,14 +295,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
private SlmWebServiceRequest.Config GetTransactionRequestConfig (SlmWebServiceRequest.RequestType requestType, bool debug = false)
|
||||
{
|
||||
SlmWebServiceRequest.Config configRequest = new SlmWebServiceRequest.Config();
|
||||
configRequest.DataType = SlmWebServiceRequest.DataType.Transaction;
|
||||
configRequest.RequestType = requestType;
|
||||
configRequest.Context.SiteDefinition = SiteDefinition;
|
||||
configRequest.Context.User = UserCode;
|
||||
configRequest.Context.Email = EmailAddress;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
return this.GetRequestConfig(SlmWebServiceRequest.DataType.Transaction, requestType, debug);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user