App tidy.
This commit is contained in:
@@ -55,12 +55,12 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Mobile\Droid\App\MainActivity.cs" />
|
||||
@@ -104,6 +104,10 @@
|
||||
<Project>{5af5ac55-7a6e-434d-a7b9-be1924903f1c}</Project>
|
||||
<Name>SacsCoreBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\Common-C#\Workspace\SacsCoreMob\SacsCoreMob.csproj">
|
||||
<Project>{56ab4cf8-63a8-44ff-b325-16e13be82366}</Project>
|
||||
<Name>SacsCoreMob</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\LogisticsMgr-C#\Workspace\SaLogMgrCore\SaLogMgrCore.csproj">
|
||||
<Project>{74e66d28-ce0c-49eb-8c8b-9370b2faae49}</Project>
|
||||
<Name>SaLogMgrCore</Name>
|
||||
|
||||
@@ -6,28 +6,62 @@ using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
using Android.Content;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Droid
|
||||
{
|
||||
//=======================================================================
|
||||
[Activity(Label = "LogisticsMgrMobile", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Sarand.LogisticsMgr.Mobile.App.App application = null;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A c t i v i t y E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
protected override void OnCreate (Bundle savedInstanceState)
|
||||
{
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new Sarand.LogisticsMgr.Mobile.App.App(SlmMobile.Platform.Android));
|
||||
}
|
||||
// Unhandled exceptions.
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
|
||||
// Initialise the application.
|
||||
application = new Sarand.LogisticsMgr.Mobile.App.App(SlmMobile.Platform.Android);
|
||||
LoadApplication(application);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
// U n h a n d l e d E x c e p t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
private void CurrentDomain_UnhandledException (object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
if (application != null)
|
||||
application.OnUnhandledException(sender, e.ExceptionObject, e.IsTerminating);
|
||||
}
|
||||
private void TaskScheduler_UnobservedTaskException (object sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
if (application != null)
|
||||
application.UnobservedTaskException(sender, e);
|
||||
}
|
||||
private void AndroidEnvironment_UnhandledExceptionRaiser (object sender, RaiseThrowableEventArgs e)
|
||||
{
|
||||
if (application != null)
|
||||
application.UnhandledExceptionRaiser(sender, e.Exception, e.Handled);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1" package="LogisticsMgrMobile.LogisticsMgrMobile" android:installLocation="auto" android:versionCode="2">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<application android:label="LogisticsMgrMobile.Android"></application>
|
||||
</manifest>
|
||||
@@ -11,7 +11,7 @@ using Android.App;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LogisticsMgrMobile.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyCopyright("Copyright © Sarand 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
@@ -30,5 +30,7 @@ using Android.App;
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.AccessWifiState)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
||||
|
||||
+2040
-1922
File diff suppressed because it is too large
Load Diff
@@ -143,8 +143,11 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj">
|
||||
|
||||
@@ -148,7 +148,10 @@
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@@ -156,6 +159,10 @@
|
||||
<Project>{5af5ac55-7a6e-434d-a7b9-be1924903f1c}</Project>
|
||||
<Name>SacsCoreBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\Common-C#\Workspace\SacsCoreMob\SacsCoreMob.csproj">
|
||||
<Project>{56ab4cf8-63a8-44ff-b325-16e13be82366}</Project>
|
||||
<Name>SacsCoreMob</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\LogisticsMgr-C#\Workspace\SaLogMgrCore\SaLogMgrCore.csproj">
|
||||
<Project>{74e66d28-ce0c-49eb-8c8b-9370b2faae49}</Project>
|
||||
<Name>SaLogMgrCore</Name>
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.CodeTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
using static Sarand.LogisticsMgr.Mobile.Core.App.SlmSessionProfile_Mobile;
|
||||
@@ -69,6 +71,15 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
public static App GetInstance () { return app; }
|
||||
public SlmMobile.Platform MobilePlatform { get; private set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// W e b S e r v i c e
|
||||
//-------------------------------------------------------------------
|
||||
public override async Task<bool> IsWebServiceAlive (SlmSiteDefinition siteDefinition)
|
||||
{
|
||||
SlmWebServiceClient webServiceClient = new SlmWebServiceClient();
|
||||
return await webServiceClient.IsAlive(siteDefinition);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S i t e D e f i n i t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
@@ -85,11 +96,15 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP [IP4 int]", "http://10.1.20.12:34568/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP [IP4 ext]", "http://185.102.148.202:34568/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP [IP6 int]", "http://[0:0:0:0:0:ffff:a01:140c]:34568/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev", "http://Sarand106:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [IP4]", "http://192.168.1.118:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [IP6]", "http://[2a00:23c0:1b03:6b00:cc8f:77b4:a561:7801]:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev on site [IP4]", "http://10.1.22.70:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev on site [IP6]", "http://[fe80:8044:1300:8ea1:3f4%4]:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [106]", "http://Sarand106:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [106-IP4]", "http://192.168.1.118:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [106-IP6]", "http://[2a00:23c0:1b03:6b00:cc8f:77b4:a561:7801]:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [106-IP6-2]", "http://[fdaa:bbcc:ddee:0:cc8f:77b4:a561:7801]:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev on site [IP4]", "http://10.1.22.70:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev on site [IP6]", "http://[fe80:8044:1300:8ea1:3f4%4]:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [403]", "http://Sarand403:34567/SaLogMgr"));
|
||||
//sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [403-IP4]", "http://192.168.1.105:34567/SaLogMgr"));
|
||||
sites.Add(new SlmSiteDefinition_App(Slm.Site.LondonGateway, "LGP - dev [403-IP6]", "http://[2a00:23c0:1b03:6b00:f14f:66b9:c098:242d]:34567/SaLogMgr"));
|
||||
}
|
||||
return sites;
|
||||
}
|
||||
@@ -161,6 +176,41 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
// Handle when your app resumes
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// U n h a n d l e d E x c e p t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
public void OnUnhandledException (object sender, object exceptionObject, bool isTerminating)
|
||||
{
|
||||
String exceptionMessage = "[No message]";
|
||||
Exception exc = exceptionObject as Exception;
|
||||
while (exc != null && exc.InnerException != null)
|
||||
exc = exc.InnerException;
|
||||
if (exc != null)
|
||||
exceptionMessage = exc.Message;
|
||||
if (isTerminating)
|
||||
exceptionMessage += ". Terminating.";
|
||||
Logger.Error("UnhandledException " + exc.GetType().Name + ": " + exceptionMessage + ExceptionUtil.GetStackEntries(exc,8).Concat("","\n\t"));
|
||||
}
|
||||
public void UnobservedTaskException (object sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
Exception exc = e.Exception;
|
||||
while (exc.InnerException != null)
|
||||
exc = exc.InnerException;
|
||||
String exceptionMessage = exc.Message;
|
||||
if (e.Observed)
|
||||
exceptionMessage += ". Observed.";
|
||||
Logger.Error("UnobservedTaskException " + exc.GetType().Name + ": " + exceptionMessage + ExceptionUtil.GetStackEntries(exc, 8).Concat("", "\n\t"));
|
||||
}
|
||||
public void UnhandledExceptionRaiser (object sender, Exception exc, bool handled)
|
||||
{
|
||||
while (exc.InnerException != null)
|
||||
exc = exc.InnerException;
|
||||
String exceptionMessage = exc.Message;
|
||||
if (handled)
|
||||
exceptionMessage += ". Handled.";
|
||||
Logger.Error("UnhandledException " + exc.GetType().Name + ": " + exceptionMessage + ExceptionUtil.GetStackEntries(exc, 8).Concat("", "\n\t"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -10,7 +10,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.App
|
||||
@@ -50,7 +50,7 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
menu.MainViewNavigation = Navigation;
|
||||
menu.MainPage = this;
|
||||
|
||||
// Logo.
|
||||
imageLogo.Source = ImageUtils.GetImageFromByteArray(SlmResourceConsole.GetImageResource(SlmResourceConsole.ImageResource.Logo_Solent_Stevedores_78_png));
|
||||
@@ -101,6 +101,28 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
configComponents.RefreshProperties();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// W e b S e r v i c e
|
||||
//-------------------------------------------------------------------
|
||||
public async Task<bool> IsWebServiceActive ()
|
||||
{
|
||||
// Test connection to Web Service.
|
||||
if (!await App.GetInstance().IsWebServiceAlive(SlmGlobals_Mobile.SessionProfile.SiteDefinition))
|
||||
{
|
||||
await DisplayAlert("Unable to communicate with server at the moment.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify Code Console population.
|
||||
if (!SlmGlobals_Mobile.Application.CodeTypeConsole.Populated)
|
||||
{
|
||||
await DisplayAlert("Code types are not populated.\n\nCheck and resave configuration to refresh.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a g e E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
@@ -119,9 +141,9 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
base.OnDisappearing();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private async void ButtonCreateRepair_Clicked (object sender, EventArgs e)
|
||||
private void ButtonCreateRepair_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushModalAsync(new SlmPage_Assets_Repair());
|
||||
menu.ShowAssetRepairForm();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Config;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.App
|
||||
@@ -26,7 +28,8 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public INavigation MainViewNavigation { get; set; }
|
||||
public SlmMainPage MainPage { get; set; }
|
||||
public INavigation MainViewNavigation { get { return MainPage.Navigation; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// M e n u O p t i o n s
|
||||
@@ -43,6 +46,8 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
// Config.
|
||||
menuOptions.Add(new OptionData() { Caption = "Config", Heading = true });
|
||||
menuOptions.Add(new OptionData() { Caption = "Options", ClickedFn = OnConfig_OptionsClicked });
|
||||
menuOptions.Add(new OptionData() { Caption = "System", ClickedFn = OnConfig_SystemClicked});
|
||||
menuOptions.Add(new OptionData() { Caption = "Update", ClickedFn = OnConfig_UpdateClicked});
|
||||
}
|
||||
return menuOptions;
|
||||
}
|
||||
@@ -51,20 +56,52 @@ namespace Sarand.LogisticsMgr.Mobile.App
|
||||
//-------------------------------------------------------------------
|
||||
// A s s e t s
|
||||
//-------------------------------------------------------------------
|
||||
private async void OnAssets_CreateRepairClicked ()
|
||||
// Asset Repair.
|
||||
public bool AssetRepairFormActive { get; private set; }
|
||||
private void OnAssets_CreateRepairClicked ()
|
||||
{
|
||||
await MainViewNavigation.PushModalAsync(new SlmPage_Assets_Repair(), false);
|
||||
//await MainViewNavigation.PushAsync(new SlmPage_Assets_Repair());
|
||||
OnMenuOptionClicked();
|
||||
ShowAssetRepairForm();
|
||||
}
|
||||
public async void ShowAssetRepairForm ()
|
||||
{
|
||||
if (AssetRepairFormActive) return;
|
||||
AssetRepairFormActive = true;
|
||||
try
|
||||
{
|
||||
OnMenuOptionClicked();
|
||||
if (!await MainPage.IsWebServiceActive()) return;
|
||||
SlmPage_Assets_Repair.Config pageConfig = new SlmPage_Assets_Repair.Config();
|
||||
SlmPage_Assets_Repair assetRepairForm = new SlmPage_Assets_Repair (pageConfig);
|
||||
assetRepairForm.Disappearing += (sender2, e2) =>
|
||||
{
|
||||
AssetRepairFormActive = false;
|
||||
};
|
||||
await MainViewNavigation.PushModalAsync(assetRepairForm, false);
|
||||
}
|
||||
catch (Exception exc) { Logger.Warn("ShowAssetRepairForm " + exc.GetType().Name + ": " + exc.Message + ExceptionUtil.GetStackEntries(exc, 8).Concat("", "\n\t")); }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n f i g O p t i o n s
|
||||
// C o n f i g
|
||||
//-------------------------------------------------------------------
|
||||
private async void OnConfig_OptionsClicked ()
|
||||
{
|
||||
await MainViewNavigation.PushModalAsync(new SlmPage_Config_Options(), false);
|
||||
OnMenuOptionClicked();
|
||||
SlmPage_Config_Options.Config pageConfig = new SlmPage_Config_Options.Config();
|
||||
await MainViewNavigation.PushModalAsync(new SlmPage_Config_Options(pageConfig), false);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private async void OnConfig_SystemClicked ()
|
||||
{
|
||||
OnMenuOptionClicked();
|
||||
SlmPage_Config_System.Config pageConfig = new SlmPage_Config_System.Config();
|
||||
await MainViewNavigation.PushModalAsync(new SlmPage_Config_System(pageConfig), false);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private async void OnConfig_UpdateClicked ()
|
||||
{
|
||||
OnMenuOptionClicked();
|
||||
await Browser.OpenAsync("http://www.sarand.com/Android/LogisticsMgr.apk", BrowserLaunchMode.SystemPreferred);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+55
-26
@@ -1,4 +1,5 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Utils;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.App;
|
||||
@@ -23,32 +24,12 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
// Construction.
|
||||
public SlmComponents_AssetRepair ()
|
||||
{
|
||||
// Shipping line company.
|
||||
PickerCompany.SelectedIndexChanged += PickerCompany_SelectedIndexChanged;
|
||||
|
||||
// Asset code.
|
||||
EntryAssetCode.MaxLength = 12;
|
||||
EntryAssetCode.TextChanged += EntryAssetCode_TextChanged;
|
||||
EntryAssetCode.Completed += EntryAssetCode_Completed;
|
||||
|
||||
// Size.
|
||||
PickerAssetSize.SelectedIndexChanged += PickerAssetSize_SelectedIndexChanged; ;
|
||||
|
||||
// Repair Narrative.
|
||||
EntryRepairNarrative.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.AssetRepair_RepairNarrative);
|
||||
EntryRepairNarrative.TextChanged += EntryRepairNarrative_TextChanged;
|
||||
|
||||
// Repair Inspector.
|
||||
EntryRepairInspector.Text = SlmGlobals_Mobile.SessionProfile.User;
|
||||
EntryRepairInspector.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.AssetRepair_RepairInspector);
|
||||
EntryRepairInspector.TextChanged += EntryRepairInspector_TextChanged;
|
||||
|
||||
Changed = false;
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public String MessageTitle { get; set; } = "Asset Repair";
|
||||
// Shipping Line company.
|
||||
public SlmLabel LabelCompany { get; } = new SlmLabel() { Text = "Shipping line" };
|
||||
public SlmPickerView_Companies PickerCompany { get; } = new SlmPickerView_Companies() { CompanyType = Slm.CompanyType.ContainerLine };
|
||||
@@ -64,22 +45,74 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
// Repair Inspector.
|
||||
public SlmLabel LabelRepairInspector { get; } = new SlmLabel() { Text = "Inspector" };
|
||||
public SlmEntryView EntryRepairInspector { get; } = new SlmEntryView();
|
||||
// Repair Authorisation type.
|
||||
public Slm.AssetRepairAuthoriseType RepairAuthoriseType
|
||||
{
|
||||
get
|
||||
{
|
||||
SlmCompany company = PickerCompany.SelectedCompany;
|
||||
if (company != null)
|
||||
{
|
||||
SlmMaintenanceProfile maintenanceProfile = SlmMaintenanceProfile.FromXml(company.MaintenanceProfileData);
|
||||
// Default authorisation type?...
|
||||
}
|
||||
return Slm.AssetRepairAuthoriseType.Manual;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Shipping line company.
|
||||
PickerCompany.SelectedIndexChanged += PickerCompany_SelectedIndexChanged;
|
||||
|
||||
// Asset code.
|
||||
EntryAssetCode.MaxLength = 12;
|
||||
EntryAssetCode.TextChanged += EntryAssetCode_TextChanged;
|
||||
EntryAssetCode.Completed += EntryAssetCode_Completed;
|
||||
|
||||
// Size.
|
||||
PickerAssetSize.SelectedIndexChanged += PickerAssetSize_SelectedIndexChanged;
|
||||
|
||||
// Repair Narrative.
|
||||
EntryRepairNarrative.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.AssetRepair_RepairNarrative);
|
||||
EntryRepairNarrative.TextChanged += EntryRepairNarrative_TextChanged;
|
||||
|
||||
// Repair Inspector.
|
||||
EntryRepairInspector.Text = SlmGlobals_Mobile.SessionProfile.User;
|
||||
EntryRepairInspector.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.AssetRepair_RepairInspector);
|
||||
EntryRepairInspector.TextChanged += EntryRepairInspector_TextChanged;
|
||||
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P o p u l a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateToControls (SlmAssetRepair.Data data)
|
||||
{
|
||||
// NB To populate Company/Code/Size must query AssetMovement properties.
|
||||
EntryRepairInspector.Text = data.RepairInspector;
|
||||
Changed = false;
|
||||
}
|
||||
public bool IsDataValid (SlmAssetRepair.Data data)
|
||||
{
|
||||
if (StringUtil.IsEmpty(data.RepairInspector))
|
||||
{
|
||||
SaxFormsUtil.DisplayAlertSync(MessageTitle, "Inspector must be specified.", "OK");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void PopulateFromControls (SlmAssetRepair.Data data)
|
||||
{
|
||||
data.RepairInspector = EntryRepairInspector.Text;
|
||||
data.AuthoriseType = RepairAuthoriseType;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -98,10 +131,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
EntryRepairInspector.ReadOnly = ReadOnly;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// V i e w E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmComponents_AssetRepairImage : SlmComponents
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SlmSessionProfile_Mobile sessionProfile = SlmGlobals_Mobile.SessionProfile;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmComponents_AssetRepairImage()
|
||||
{
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
// Filename.
|
||||
public SlmLabel LabelFilename { get; } = new SlmLabel() { Text = "Filename" };
|
||||
public SlmEntryView EntryFilename { get; } = new SlmEntryView();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Filename.
|
||||
EntryFilename.Text = "1";
|
||||
EntryFilename.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryFilename.NumericOnly = true;
|
||||
EntryFilename.MaxLength = (int)SlmDbDfn.GetColTextLen(SlmDbDfn.ColumnIdx.AssetRepairImage_Filename);
|
||||
EntryFilename.TextChanged += EntryFilename_TextChanged;
|
||||
EntryFilename.Completed += EntryFilename_Completed;
|
||||
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P o p u l a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateToControls (SlmAssetRepairImage.Data data)
|
||||
{
|
||||
EntryFilename.Text = data.Filename;
|
||||
Changed = false;
|
||||
}
|
||||
public bool IsDataValid (SlmAssetRepairImage.Data data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public void PopulateFromControls (SlmAssetRepairImage.Data data)
|
||||
{
|
||||
data.Filename = EntryFilename.Text;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
SetControlsReadOnly();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
// Filename.
|
||||
private void EntryFilename_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
private void EntryFilename_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmComponents_AssetRepairJob : SlmComponents
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SlmSessionProfile_Mobile sessionProfile = SlmGlobals_Mobile.SessionProfile;
|
||||
private static readonly int codeEntryWidth = 48;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmComponents_AssetRepairJob()
|
||||
{
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
// Location code.
|
||||
public SlmLabel LabelLocation { get; } = new SlmLabel() { Text = "Location" };
|
||||
public SlmEntryView EntryLocation { get; } = new SlmEntryView();
|
||||
public SlmPickerView_Codes PickerLocation { get; } = new SlmPickerView_Codes() { CodeType = Slm.CodeType.AssetRepair_Location };
|
||||
// Component code.
|
||||
public SlmLabel LabelComponent { get; } = new SlmLabel() { Text = "Component" };
|
||||
public SlmEntryView EntryComponent { get; } = new SlmEntryView();
|
||||
public SlmPickerView_Codes PickerComponent { get; } = new SlmPickerView_Codes() { CodeType = Slm.CodeType.AssetRepair_Component };
|
||||
// Damage code.
|
||||
public SlmLabel LabelDamage { get; } = new SlmLabel() { Text = "Damage" };
|
||||
public SlmEntryView EntryDamage { get; } = new SlmEntryView();
|
||||
public SlmPickerView_Codes PickerDamage { get; } = new SlmPickerView_Codes() { CodeType = Slm.CodeType.AssetRepair_Damage };
|
||||
// Repair code.
|
||||
public SlmLabel LabelRepair { get; } = new SlmLabel() { Text = "Repair" };
|
||||
public SlmEntryView EntryRepair { get; } = new SlmEntryView();
|
||||
public SlmPickerView_Codes PickerRepair { get; } = new SlmPickerView_Codes() { CodeType = Slm.CodeType.AssetRepair_Repair };
|
||||
// Quantity.
|
||||
public SlmLabel LabelQuantity { get; } = new SlmLabel() { Text = "Quantity" };
|
||||
public SlmEntryView EntryQuantity { get; } = new SlmEntryView();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Location.
|
||||
EntryLocation.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryLocation.WidthRequest = codeEntryWidth;
|
||||
EntryLocation.TextCase = SaxEntry.TextCaseType.Upper;
|
||||
EntryLocation.MaxLength = 4;
|
||||
EntryLocation.TextChanged += EntryLocation_TextChanged;
|
||||
EntryLocation.Completed += EntryLocation_Completed;
|
||||
PickerLocation.SelectedIndexChanged += PickerLocation_SelectedIndexChanged;
|
||||
PickerLocation.Populated += PickerLocation_Populated;
|
||||
|
||||
// Component.
|
||||
EntryComponent.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryComponent.WidthRequest = codeEntryWidth;
|
||||
EntryComponent.TextCase = SaxEntry.TextCaseType.Upper;
|
||||
EntryComponent.MaxLength = 3;
|
||||
EntryComponent.TextChanged += EntryComponent_TextChanged;
|
||||
EntryComponent.Completed += EntryComponent_Completed;
|
||||
PickerComponent.SelectedIndexChanged += PickerComponent_SelectedIndexChanged;
|
||||
PickerComponent.Populated += PickerComponent_Populated;
|
||||
|
||||
// Damage.
|
||||
EntryDamage.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryDamage.WidthRequest = codeEntryWidth;
|
||||
EntryDamage.TextCase = SaxEntry.TextCaseType.Upper;
|
||||
EntryDamage.MaxLength = 2;
|
||||
EntryDamage.TextChanged += EntryDamage_TextChanged;
|
||||
EntryDamage.Completed += EntryDamage_Completed;
|
||||
PickerDamage.SelectedIndexChanged += PickerDamage_SelectedIndexChanged;
|
||||
PickerDamage.Populated += PickerDamage_Populated;
|
||||
|
||||
// Repair.
|
||||
EntryRepair.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryRepair.WidthRequest = codeEntryWidth;
|
||||
EntryRepair.TextCase = SaxEntry.TextCaseType.Upper;
|
||||
EntryRepair.MaxLength = 2;
|
||||
EntryRepair.TextChanged += EntryRepair_TextChanged;
|
||||
EntryRepair.Completed += EntryRepair_Completed;
|
||||
PickerRepair.SelectedIndexChanged += PickerRepair_SelectedIndexChanged;
|
||||
PickerRepair.Populated += PickerRepair_Populated;
|
||||
|
||||
// Quantity.
|
||||
EntryQuantity.Text = "1";
|
||||
EntryQuantity.HorizontalOptions = LayoutOptions.Start;
|
||||
EntryQuantity.WidthRequest = codeEntryWidth;
|
||||
EntryQuantity.NumericOnly = true;
|
||||
EntryQuantity.MaxLength = 2;
|
||||
EntryQuantity.TextChanged += EntryQuantity_TextChanged;
|
||||
EntryQuantity.Completed += EntryQuantity_Completed;
|
||||
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P o p u l a t i o n
|
||||
//-------------------------------------------------------------------
|
||||
public void PopulateToControls (SlmAssetRepairJob.Data data)
|
||||
{
|
||||
EntryLocation.Text = data.LocationCode;
|
||||
EntryComponent.Text = data.ComponentCode;
|
||||
EntryDamage.Text = data.DamageCode;
|
||||
EntryRepair.Text = data.RepairCode;
|
||||
EntryQuantity.Text = data.Quantity.ToString();
|
||||
Changed = false;
|
||||
}
|
||||
public bool IsDataValid (SlmAssetRepairJob.Data data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public void PopulateFromControls (SlmAssetRepairJob.Data data)
|
||||
{
|
||||
data.LocationCode = EntryLocation.Text;
|
||||
data.ComponentCode = EntryComponent.Text;
|
||||
data.DamageCode = EntryDamage.Text;
|
||||
data.RepairCode = EntryRepair.Text;
|
||||
data.Quantity= StringUtil.ToShort(EntryQuantity.Text);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
SetControlsReadOnly();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
// Location.
|
||||
private void EntryLocation_TextChanged (object sender, Xamarin.Forms.TextChangedEventArgs e)
|
||||
{
|
||||
if (PickerLocation.ContainsCode(e.NewTextValue))
|
||||
PickerLocation.SelectedCode = e.NewTextValue;
|
||||
}
|
||||
private void EntryLocation_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
private void PickerLocation_Populated (object sender, SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
if (PickerLocation.ContainsCode(EntryLocation.Text))
|
||||
PickerLocation.SelectedCode = EntryLocation.Text;
|
||||
}
|
||||
private void PickerLocation_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
EntryLocation.Text = PickerLocation.SelectedCode;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Component.
|
||||
private void EntryComponent_TextChanged (object sender, Xamarin.Forms.TextChangedEventArgs e)
|
||||
{
|
||||
if (PickerComponent.ContainsCode(e.NewTextValue))
|
||||
PickerComponent.SelectedCode = e.NewTextValue;
|
||||
}
|
||||
private void EntryComponent_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
private void PickerComponent_Populated (object sender, SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
if (PickerComponent.ContainsCode(EntryComponent.Text))
|
||||
PickerComponent.SelectedCode = EntryComponent.Text;
|
||||
}
|
||||
private void PickerComponent_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
EntryComponent.Text = PickerComponent.SelectedCode;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Damage.
|
||||
private void EntryDamage_TextChanged (object sender, Xamarin.Forms.TextChangedEventArgs e)
|
||||
{
|
||||
if (PickerDamage.ContainsCode(e.NewTextValue))
|
||||
PickerDamage.SelectedCode = e.NewTextValue;
|
||||
}
|
||||
private void EntryDamage_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
private void PickerDamage_Populated (object sender, SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
if (PickerDamage.ContainsCode(EntryDamage.Text))
|
||||
PickerDamage.SelectedCode = EntryDamage.Text;
|
||||
}
|
||||
private void PickerDamage_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
EntryDamage.Text = PickerDamage.SelectedCode;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Repair.
|
||||
private void EntryRepair_TextChanged (object sender, Xamarin.Forms.TextChangedEventArgs e)
|
||||
{
|
||||
if (PickerRepair.ContainsCode(e.NewTextValue))
|
||||
PickerRepair.SelectedCode = e.NewTextValue;
|
||||
}
|
||||
private void EntryRepair_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
private void PickerRepair_Populated (object sender, SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
if (PickerRepair.ContainsCode(EntryRepair.Text))
|
||||
PickerRepair.SelectedCode = EntryRepair.Text;
|
||||
}
|
||||
private void PickerRepair_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
EntryRepair.Text = PickerRepair.SelectedCode;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Quantity.
|
||||
private void EntryQuantity_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
private void EntryQuantity_Completed (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+28
-24
@@ -22,26 +22,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
// Construction.
|
||||
public SlmComponents_Config ()
|
||||
{
|
||||
// Site.
|
||||
for (int siteIdx = 0; siteIdx < sites.Count; siteIdx++)
|
||||
{
|
||||
SlmSiteDefinition siteDefinition = sites[siteIdx];
|
||||
PickerSite.Items.Add(siteDefinition.Caption);
|
||||
if (siteDefinition == sessionProfile.SiteDefinition)
|
||||
PickerSite.SelectedIndex = siteIdx;
|
||||
}
|
||||
|
||||
// User.
|
||||
EntryUser.Text = sessionProfile.User;
|
||||
EntryUser.TextChanged += EntryUser_TextChanged;
|
||||
EntryUser.Completed += EntryUser_Completed;
|
||||
|
||||
// Email.
|
||||
EntryEmail.Text = sessionProfile.Email;
|
||||
EntryEmail.TextChanged += EntryEmail_TextChanged;
|
||||
EntryEmail.Completed += EntryEmail_Completed;
|
||||
|
||||
Changed = false;
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -84,6 +65,33 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Site.
|
||||
for (int siteIdx = 0; siteIdx < sites.Count; siteIdx++)
|
||||
{
|
||||
SlmSiteDefinition siteDefinition = sites[siteIdx];
|
||||
PickerSite.Items.Add(siteDefinition.Caption);
|
||||
if (siteDefinition == sessionProfile.SiteDefinition)
|
||||
PickerSite.SelectedIndex = siteIdx;
|
||||
}
|
||||
|
||||
// User.
|
||||
EntryUser.Text = sessionProfile.User;
|
||||
EntryUser.TextChanged += EntryUser_TextChanged;
|
||||
EntryUser.Completed += EntryUser_Completed;
|
||||
|
||||
// Email.
|
||||
EntryEmail.Text = sessionProfile.Email;
|
||||
EntryEmail.TextChanged += EntryEmail_TextChanged;
|
||||
EntryEmail.Completed += EntryEmail_Completed;
|
||||
|
||||
Changed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
@@ -98,10 +106,6 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Components
|
||||
EntryEmail.ReadOnly = ReadOnly;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// V i e w E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
+153
-4
@@ -1,6 +1,8 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
@@ -13,6 +15,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
@@ -20,8 +23,23 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
//=======================================================================
|
||||
public class SlmPage_Assets_Repair : SlmFormPage
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmFormPage.Config
|
||||
{
|
||||
public SlmAssetRepair.Data AssetRepairToUpdate { get; set; }
|
||||
}
|
||||
private class AssetRepairData
|
||||
{
|
||||
public SysId AssetMovementId { get; set; }
|
||||
public Slm.AssetItemType AssetItemType { get; set; }
|
||||
public SysId AssetItemId { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Config config;
|
||||
private readonly AssetRepairData assetRepairData = new AssetRepairData();
|
||||
private SlmGrid gridRepairProperties = new SlmGrid();
|
||||
private SlmComponents_AssetRepair assetRepairComponents = new SlmComponents_AssetRepair();
|
||||
private SlmPanel_AssetMovement_SearchResults assetSearchResultsWebView = new SlmPanel_AssetMovement_SearchResults() { IsVisible = false, };
|
||||
@@ -30,8 +48,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPage_Assets_Repair ()
|
||||
public SlmPage_Assets_Repair (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
AddMode = (config.AssetRepairToUpdate == null);
|
||||
Title = "Container Estimate";
|
||||
InitialiseComponents();
|
||||
}
|
||||
@@ -58,6 +78,8 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
gridRepairProperties.Children.Add(assetRepairComponents.LabelCompany, 0, rowIdx);
|
||||
gridRepairProperties.Children.Add(assetRepairComponents.PickerCompany, 1, rowIdx);
|
||||
Grid.SetColumnSpan(assetRepairComponents.PickerCompany, 2);
|
||||
assetRepairComponents.PickerCompany.Populated += PickerCompany_Populated;
|
||||
assetRepairComponents.PickerCompany.SelectedIndexChanged += PickerCompany_SelectedIndexChanged;
|
||||
|
||||
// Asset code.
|
||||
rowIdx = gridRepairProperties.RowDefinitions.Count;
|
||||
@@ -104,6 +126,20 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
gridRepairProperties.Children.Add(assetRepairComponents.LabelRepairInspector, 0, rowIdx);
|
||||
gridRepairProperties.Children.Add(assetRepairComponents.EntryRepairInspector, 1, rowIdx);
|
||||
Grid.SetColumnSpan(assetRepairComponents.EntryRepairInspector, 2);
|
||||
|
||||
// Jobs panel.
|
||||
repairJobsPanel.AssetRepairPage = this;
|
||||
rowIdx = gridRepairProperties.RowDefinitions.Count;
|
||||
gridRepairProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairProperties.Children.Add(repairJobsPanel, 0, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobsPanel, 3);
|
||||
|
||||
// Images panel.
|
||||
repairImagesPanel.AssetRepairPage = this;
|
||||
rowIdx = gridRepairProperties.RowDefinitions.Count;
|
||||
gridRepairProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairProperties.Children.Add(repairImagesPanel, 0, rowIdx);
|
||||
Grid.SetColumnSpan(repairImagesPanel, 3);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -130,6 +166,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
private void AssetSearchResultsWebView_AssetMovementSelected (object sender, SlmPanel_AssetMovement_SearchResults.AssetMovementSelectedEventArgs e)
|
||||
{
|
||||
SlmPanel_AssetMovement_SearchResults.AssetMovementData itemData = e.ItemData;
|
||||
assetRepairData.AssetMovementId = itemData.AssetMovementId;
|
||||
assetRepairData.AssetItemType = itemData.AssetItemType;
|
||||
assetRepairData.AssetItemId = itemData.AssetItemId;
|
||||
// Company.
|
||||
if (assetRepairComponents.PickerCompany.ContainsCompany(itemData.CompanyId))
|
||||
{
|
||||
@@ -137,8 +176,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
}
|
||||
// Asset code.
|
||||
assetRepairComponents.EntryAssetCode.Text = itemData.AssetCode;
|
||||
// Asset code.
|
||||
// Asset size code.
|
||||
assetRepairComponents.PickerAssetSize.SelectedCode = itemData.AssetSizeCode;
|
||||
// Hide search results.
|
||||
assetSearchResultsWebView.Hide();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -150,6 +191,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
base.SetControlActivity();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
@@ -160,14 +202,121 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool SaveFormData ()
|
||||
{
|
||||
DisplayAlert("Unable to save form data at the moment.");
|
||||
// Construct and validate Repair data.
|
||||
SlmAssetRepair.Data data = new SlmAssetRepair.Data();
|
||||
assetRepairComponents.PopulateFromControls(data);
|
||||
if (!assetRepairComponents.IsDataValid(data)) return false;
|
||||
|
||||
// Store the Asset Repair.
|
||||
bool formDataSaved = false;
|
||||
if (AddMode)
|
||||
{
|
||||
formDataSaved = StoreAssetRepair(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
assetRepairComponents.PopulateFromControls(config.AssetRepairToUpdate);
|
||||
//formDataSaved = StoreAssetRepair(config.AssetRepairToUpdate);
|
||||
DisplayAlert("Unable to save form data at the moment.");
|
||||
}
|
||||
return formDataSaved;
|
||||
}
|
||||
private bool StoreAssetRepair (SlmAssetRepair.Data assetRepair)
|
||||
{
|
||||
try
|
||||
{
|
||||
Task<SlmWebServiceClient.StoreItemResponseData> storeTask = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
return await StoreAssetRepairAsync(assetRepair);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Error(GetType().Name + ".StoreAssetRepair " + exc.GetType().Name + ": " + exc.Message + ExceptionUtil.GetStackEntries(exc, 8).Concat("", "z=\n\r"));
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if (!storeTask.IsCompleted) storeTask.Wait();
|
||||
SlmWebServiceClient.StoreItemResponseData serviceResponse = storeTask.Result;
|
||||
if (serviceResponse == null)
|
||||
{
|
||||
DisplayAlert("Failed to store Repair.");
|
||||
return false;
|
||||
}
|
||||
String msg = "";
|
||||
if (serviceResponse.Messages.Count > 0)
|
||||
{
|
||||
foreach (SlmWebServiceMessage message in serviceResponse.Messages)
|
||||
msg += SacsSystem.GetMessageLevelCode(message.Level) + " " + message.Message + "\n";
|
||||
}
|
||||
if (serviceResponse != null && serviceResponse.StatusCode == SlmWebServiceDfn.StatusSuccess)
|
||||
{
|
||||
if (!StringUtil.IsEmpty(msg))
|
||||
{
|
||||
msg = "Messages returned when storing Asset Repair:\n" + msg;
|
||||
DisplayAlert(msg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
msg = "Failed to store Asset repair.\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> StoreAssetRepairAsync (SlmAssetRepair.Data assetRepair)
|
||||
{
|
||||
// Construct Asset Repair item.
|
||||
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());
|
||||
|
||||
// Repair Jobs.
|
||||
List<SlmAssetRepairJob.Data> jobs = repairJobsPanel.RepairJobs;
|
||||
if (jobs.Count > 0)
|
||||
{
|
||||
XElement jobsElement = itemElement.AppendElement("Jobs");
|
||||
foreach (SlmAssetRepairJob.Data repairJob in jobs)
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
// Store Asset Repair via Web Service.
|
||||
SacsTaskData taskData = new SacsTaskData(null);
|
||||
return await AssetMgr.StoreAssetRepair_Mobile(itemElement, taskData);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool QueryCancelForm ()
|
||||
{
|
||||
if (!base.QueryCancelForm()) return false;
|
||||
return true;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Company.
|
||||
private void PickerCompany_Populated (object sender, Sarand.Core.Mobile.Forms.Controls.SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
}
|
||||
private void PickerCompany_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Asset code.
|
||||
private void EntryAssetCode_TextChanged (object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (StringUtil.IsEmpty(assetRepairComponents.EntryAssetCode.Text))
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Effects;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPage_Assets_RepairImage : SlmFormPage
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmFormPage.Config
|
||||
{
|
||||
public Config (SysId companyId)
|
||||
{
|
||||
CompanyId = companyId;
|
||||
}
|
||||
public SysId CompanyId { get; set; }
|
||||
public SlmAssetRepairImage.Data AssetRepairImageToUpdate { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Config config;
|
||||
private SlmAssetRepairImage.Data newRepairImageData = null;
|
||||
private SlmGrid gridRepairImageProperties = new SlmGrid();
|
||||
private SlmComponents_AssetRepairImage repairImageComponents = new SlmComponents_AssetRepairImage();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPage_Assets_RepairImage (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
AddMode = (config.AssetRepairImageToUpdate == null);
|
||||
Title = "Repair Image";
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public SlmAssetRepairImage.Data NewAssetRepairImageData { get { return newRepairImageData; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridRepairImageProperties;
|
||||
gridRepairImageProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridRepairImageProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridRepairImageProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridRepairImageProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
int rowIdx = -1;
|
||||
|
||||
// Filename.
|
||||
rowIdx = gridRepairImageProperties.RowDefinitions.Count;
|
||||
gridRepairImageProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairImageProperties.Children.Add(repairImageComponents.LabelFilename, 0, rowIdx);
|
||||
gridRepairImageProperties.Children.Add(repairImageComponents.EntryFilename, 1, rowIdx);
|
||||
Grid.SetColumnSpan(repairImageComponents.EntryFilename, 2);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n f i g u r e C o n t r o l s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
SetControlsReadOnly();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// N a v i g a t i o n E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool SaveFormData ()
|
||||
{
|
||||
SlmAssetRepairImage.Data repairImageData = (AddMode ? new SlmAssetRepairImage.Data() : config.AssetRepairImageToUpdate.Clone());
|
||||
repairImageComponents.PopulateFromControls(repairImageData);
|
||||
if (!repairImageComponents.IsDataValid(repairImageData))
|
||||
return false;
|
||||
if (AddMode)
|
||||
{
|
||||
newRepairImageData = repairImageData;
|
||||
}
|
||||
else
|
||||
{
|
||||
repairImageComponents.PopulateFromControls(config.AssetRepairImageToUpdate);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected override bool QueryCancelForm ()
|
||||
{
|
||||
if (repairImageComponents.Changed) Changed = true;
|
||||
if (!base.QueryCancelForm()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Effects;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPage_Assets_RepairJob : SlmFormPage
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmFormPage.Config
|
||||
{
|
||||
public Config (SysId companyId)
|
||||
{
|
||||
CompanyId = companyId;
|
||||
}
|
||||
public SysId CompanyId { get; set; }
|
||||
public SlmAssetRepairJob.Data AssetRepairJobToUpdate { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Config config;
|
||||
private SlmAssetRepairJob.Data newRepairJobData = null;
|
||||
private SlmGrid gridRepairJobProperties = new SlmGrid();
|
||||
private SlmComponents_AssetRepairJob repairJobComponents = new SlmComponents_AssetRepairJob();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPage_Assets_RepairJob (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
AddMode = (config.AssetRepairJobToUpdate == null);
|
||||
Title = "Repair Job";
|
||||
InitialiseComponents();
|
||||
|
||||
// Populate form.
|
||||
if (config.AssetRepairJobToUpdate != null)
|
||||
repairJobComponents.PopulateToControls(config.AssetRepairJobToUpdate);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public SlmAssetRepairJob.Data NewAssetRepairJobData { get { return newRepairJobData; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Asset Repair form.
|
||||
FormBodyView.Content = gridRepairJobProperties;
|
||||
gridRepairJobProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridRepairJobProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridRepairJobProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridRepairJobProperties.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
int rowIdx = -1;
|
||||
|
||||
// Location.
|
||||
rowIdx = gridRepairJobProperties.RowDefinitions.Count;
|
||||
gridRepairJobProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.LabelLocation, 0, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.EntryLocation, 1, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.PickerLocation, 2, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobComponents.PickerLocation, 2);
|
||||
|
||||
// Component.
|
||||
rowIdx = gridRepairJobProperties.RowDefinitions.Count;
|
||||
gridRepairJobProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.LabelComponent, 0, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.EntryComponent, 1, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.PickerComponent, 2, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobComponents.PickerComponent, 2);
|
||||
|
||||
// Damage.
|
||||
rowIdx = gridRepairJobProperties.RowDefinitions.Count;
|
||||
gridRepairJobProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.LabelDamage, 0, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.EntryDamage, 1, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.PickerDamage, 2, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobComponents.PickerDamage, 2);
|
||||
|
||||
// Repair.
|
||||
rowIdx = gridRepairJobProperties.RowDefinitions.Count;
|
||||
gridRepairJobProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.LabelRepair, 0, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.EntryRepair, 1, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.PickerRepair, 2, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobComponents.PickerRepair, 2);
|
||||
|
||||
// Quantity.
|
||||
rowIdx = gridRepairJobProperties.RowDefinitions.Count;
|
||||
gridRepairJobProperties.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.LabelQuantity, 0, rowIdx);
|
||||
gridRepairJobProperties.Children.Add(repairJobComponents.EntryQuantity, 1, rowIdx);
|
||||
Grid.SetColumnSpan(repairJobComponents.EntryQuantity, 2);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l A c t i v i t y
|
||||
//-------------------------------------------------------------------
|
||||
protected override void SetControlActivity ()
|
||||
{
|
||||
SetControlsReadOnly();
|
||||
}
|
||||
protected override void SetControlsReadOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// N a v i g a t i o n E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override bool SaveFormData ()
|
||||
{
|
||||
SlmAssetRepairJob.Data repairJobData = (AddMode ? new SlmAssetRepairJob.Data() : config.AssetRepairJobToUpdate.Clone());
|
||||
repairJobComponents.PopulateFromControls(repairJobData);
|
||||
if (!repairJobComponents.IsDataValid(repairJobData))
|
||||
return false;
|
||||
if (AddMode)
|
||||
{
|
||||
newRepairJobData = repairJobData;
|
||||
}
|
||||
else
|
||||
{
|
||||
repairJobComponents.PopulateFromControls(config.AssetRepairJobToUpdate);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected override bool QueryCancelForm ()
|
||||
{
|
||||
if (repairJobComponents.Changed) Changed = true;
|
||||
if (!base.QueryCancelForm()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+10
-1
@@ -10,6 +10,7 @@ using Sarand.LogisticsMgr.Mobile.Forms.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
@@ -17,8 +18,15 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
//=======================================================================
|
||||
public class SlmPage_Config_Options : SlmFormPage
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmFormPage.Config
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config = new Config();
|
||||
private SlmSessionProfile_Mobile sessionProfile = SlmGlobals_Mobile.SessionProfile;
|
||||
private SlmGrid optionsGrid = new SlmGrid();
|
||||
// Config components.
|
||||
@@ -30,8 +38,9 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPage_Config_Options ()
|
||||
public SlmPage_Config_Options (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
Title = "Options";
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Config
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmPage_Config_System : SlmFormPage
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public new class Config : SlmFormPage.Config
|
||||
{
|
||||
public Config ()
|
||||
{
|
||||
NavigationMode = NavigationMode.Close;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Config config = new Config();
|
||||
private SlmSessionProfile_Mobile sessionProfile = SlmGlobals_Mobile.SessionProfile;
|
||||
private SlmGrid settingsGrid = new SlmGrid();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPage_Config_System (Config config) : base(config)
|
||||
{
|
||||
this.config = config;
|
||||
Title = "System";
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
// Settings grid.
|
||||
FormBodyView.Content = settingsGrid;
|
||||
settingsGrid.BackgroundColor = SlmMobile.PageBackgroundColor;
|
||||
settingsGrid.Padding = new Thickness(4.0);
|
||||
settingsGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
settingsGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
|
||||
// Settings.
|
||||
List<StringPair> settings = new List<StringPair>();
|
||||
|
||||
// Application info.
|
||||
settings.Add("App name", AppInfo.Name);
|
||||
settings.Add("Package name", AppInfo.PackageName);
|
||||
settings.Add("Version", AppInfo.VersionString);
|
||||
settings.Add("Build", AppInfo.BuildString);
|
||||
|
||||
// Main display info.
|
||||
DisplayInfo mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
|
||||
settings.Add("Display", mainDisplayInfo.Width.ToString() + " x " + mainDisplayInfo.Height.ToString());
|
||||
settings.Add("Density", mainDisplayInfo.Density.ToString());
|
||||
settings.Add("Orientation", mainDisplayInfo.Orientation.ToString());
|
||||
if (mainDisplayInfo.Rotation != DisplayRotation.Rotation0)
|
||||
settings.Add("Rotation", mainDisplayInfo.Rotation.ToString());
|
||||
|
||||
// Application styling.
|
||||
settings.Add("Font size ratio", SlmMobile.FontSizeRatio.ToString());
|
||||
|
||||
// Device info.
|
||||
settings.Add("Model", DeviceInfo.Model);
|
||||
settings.Add("Manufacturer", DeviceInfo.Manufacturer);
|
||||
settings.Add("Device name", DeviceInfo.Name);
|
||||
settings.Add("Device version", DeviceInfo.VersionString);
|
||||
settings.Add("Platform", DeviceInfo.Platform.ToString());
|
||||
settings.Add("Idiom", DeviceInfo.Idiom.ToString());
|
||||
settings.Add("DeviceType", DeviceInfo.DeviceType.ToString());
|
||||
|
||||
// Version tracking.
|
||||
if (VersionTracking.IsFirstLaunchEver)
|
||||
settings.Add("First launch", VersionTracking.IsFirstLaunchEver.ToString());
|
||||
if (VersionTracking.IsFirstLaunchForCurrentVersion)
|
||||
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(", "));
|
||||
|
||||
// Populate settings.
|
||||
int optionIdx = -1;
|
||||
foreach (StringPair setting in settings)
|
||||
{
|
||||
optionIdx++;
|
||||
settingsGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
settingsGrid.Children.Add(new SlmLabel() { Text = setting.Item1, HorizontalOptions = LayoutOptions.Start }, 0, optionIdx);
|
||||
settingsGrid.Children.Add(new SlmLabel() { Text = setting.Item2, HorizontalOptions = LayoutOptions.StartAndExpand }, 1, optionIdx);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a g e E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+11
-2
@@ -108,6 +108,13 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates
|
||||
pageBodyStack.Padding = new Thickness(4);
|
||||
pageBodyScroll.Content = pageBodyStack;
|
||||
|
||||
// Hide menu when tapping on main page.
|
||||
var bodyTapGestureRecognizer = new TapGestureRecognizer();
|
||||
bodyTapGestureRecognizer.Tapped += (s, e) => { HideMenu(); };
|
||||
//pageBody.GestureRecognizers.Add(bodyTapGestureRecognizer);
|
||||
//pageBodyScroll.GestureRecognizers.Add(bodyTapGestureRecognizer);
|
||||
pageBodyStack.GestureRecognizers.Add(bodyTapGestureRecognizer);
|
||||
|
||||
// Events.
|
||||
}
|
||||
|
||||
@@ -137,8 +144,10 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Pages.Templates
|
||||
}
|
||||
private void ShowMenu ()
|
||||
{
|
||||
double menuWidth = Math.Min(160, Math.Min(Width, Height) * 0.66);
|
||||
double menuHeight = Math.Min(200, Math.Min(Width, Height) * 0.66);
|
||||
double menuWidth = Math.Min(180, Math.Min(Width, Height) * 0.66);
|
||||
double menuHeight = Math.Min(320, Math.Min(Width, Height) * 0.66);
|
||||
if (MenuView.MenuHeight > menuHeight && MenuView.MenuHeight < Height)
|
||||
menuHeight = MenuView.MenuHeight;
|
||||
Rectangle menuPosition = new Rectangle(pageBody.Width - menuWidth, 0, menuWidth, menuHeight);
|
||||
pageBody.Children.Add(MenuView, menuPosition, AbsoluteLayoutFlags.None);
|
||||
menuShown = true;
|
||||
|
||||
+8
-4
@@ -141,10 +141,14 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets
|
||||
// Compile search results info.
|
||||
String info = "<div>Matching assets found: " + assetMovementCount + "</div>";
|
||||
info += "<table>";
|
||||
info += "<tr class='other'>";
|
||||
foreach (ColumnDfn column in ColumnsToDisplay)
|
||||
info += "<th>" + column.Caption + "</th>";
|
||||
info += "</tr>";
|
||||
if (assetMovementCount > 0)
|
||||
{
|
||||
// Column headers.
|
||||
info += "<tr class='other'>";
|
||||
foreach (ColumnDfn column in ColumnsToDisplay)
|
||||
info += "<th>" + column.Caption + "</th>";
|
||||
info += "</tr>";
|
||||
}
|
||||
int assetCount = 0;
|
||||
foreach (SlmWebServiceItemData itemData in itemDataList)
|
||||
{
|
||||
|
||||
+75
-2
@@ -1,8 +1,11 @@
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets
|
||||
{
|
||||
@@ -14,16 +17,86 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private List<SlmAssetRepairImage.Data> repairImages = new List<SlmAssetRepairImage.Data>();
|
||||
private SlmLabel labelSummary = new SlmLabel();
|
||||
private SlmGrid gridDetails = new SlmGrid();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel_AssetRepair_Images ()
|
||||
{
|
||||
Caption = "Images";
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public SlmPage_Assets_Repair AssetRepairPage { get; set; }
|
||||
public List<SlmAssetRepairImage.Data> RepairImages => new List<SlmAssetRepairImage.Data>(repairImages);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
Caption = "Images";
|
||||
|
||||
// Summary panel.
|
||||
labelSummary.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
SummaryPanel.Content = labelSummary;
|
||||
|
||||
// Details panel.
|
||||
gridDetails.BackgroundColor = Color.Transparent;
|
||||
gridDetails.MinimumHeightRequest = 56;
|
||||
DetailsPanel.Content = gridDetails;
|
||||
|
||||
RefreshPanels();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e f r e s h
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshPanels ()
|
||||
{
|
||||
RefreshSummaryPanel();
|
||||
RefreshDetailsPanel();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshSummaryPanel ()
|
||||
{
|
||||
if (repairImages.Count == 0)
|
||||
labelSummary.Text = "No images defined";
|
||||
else if (repairImages.Count == 1)
|
||||
labelSummary.Text = "1 image defined";
|
||||
else
|
||||
labelSummary.Text = repairImages.Count + " images defined";
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshDetailsPanel ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected async override void ButtonAddItem_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
SlmPage_Assets_RepairImage.Config pageConfig = new SlmPage_Assets_RepairImage.Config(AssetRepairPage.CompanyId);
|
||||
SlmPage_Assets_RepairImage page = new SlmPage_Assets_RepairImage(pageConfig);
|
||||
page.Disappearing += (sender2, e2) =>
|
||||
{
|
||||
if (!page.Cancelled)
|
||||
{
|
||||
SlmAssetRepairImage.Data repairImageData = page.NewAssetRepairImageData;
|
||||
if (repairImageData != null)
|
||||
{
|
||||
repairImages.Add(repairImageData);
|
||||
RefreshPanels();
|
||||
DropDown();
|
||||
}
|
||||
}
|
||||
};
|
||||
await Application.Current.MainPage.Navigation.PushModalAsync(page, false);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
+129
-2
@@ -1,8 +1,13 @@
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Panels;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Utils;
|
||||
using Sarand.LogisticsMgr.Mobile.Forms.Pages.Assets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets
|
||||
{
|
||||
@@ -14,16 +19,138 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Panels.Assets
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private List<SlmAssetRepairJob.Data> repairJobs = new List<SlmAssetRepairJob.Data>();
|
||||
private SlmLabel labelSummary = new SlmLabel();
|
||||
private SlmGrid gridDetails = new SlmGrid();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel_AssetRepair_Jobs ()
|
||||
{
|
||||
Caption = "Jobs";
|
||||
InitialiseComponents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public SlmPage_Assets_Repair AssetRepairPage { get; set; }
|
||||
public List<SlmAssetRepairJob.Data> RepairJobs => new List<SlmAssetRepairJob.Data>(repairJobs);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
Caption = "Jobs";
|
||||
|
||||
// Summary panel.
|
||||
labelSummary.HorizontalOptions = LayoutOptions.FillAndExpand;
|
||||
SummaryPanel.Content = labelSummary;
|
||||
|
||||
// Details panel.
|
||||
gridDetails.BackgroundColor = Color.Transparent;
|
||||
gridDetails.MinimumHeightRequest = 56;
|
||||
gridDetails.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
gridDetails.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
gridDetails.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
DetailsPanel.Content = gridDetails;
|
||||
|
||||
RefreshPanels();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e f r e s h
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshPanels ()
|
||||
{
|
||||
RefreshSummaryPanel();
|
||||
RefreshDetailsPanel();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshSummaryPanel ()
|
||||
{
|
||||
if (repairJobs.Count == 0)
|
||||
labelSummary.Text = "No jobs defined";
|
||||
else if (repairJobs.Count == 1)
|
||||
labelSummary.Text = "1 job defined";
|
||||
else
|
||||
labelSummary.Text = repairJobs.Count + " jobs defined";
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void RefreshDetailsPanel ()
|
||||
{
|
||||
gridDetails.Children.Clear();
|
||||
gridDetails.RowDefinitions.Clear();
|
||||
int rowIdx = -1;
|
||||
|
||||
// Display repair jobs.
|
||||
foreach (SlmAssetRepairJob.Data repairJob in repairJobs)
|
||||
{
|
||||
// Repair Job display info.
|
||||
String repairJobDisplay = repairJob.LocationCode + "-" + repairJob.ComponentCode + "-" + repairJob.DamageCode + "-" + repairJob.RepairCode;
|
||||
|
||||
// Add repair job to grid.
|
||||
rowIdx = gridDetails.RowDefinitions.Count;
|
||||
gridDetails.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridDetails.Children.Add(new SlmLabel() { Text = repairJobDisplay }, 0, rowIdx);
|
||||
// 'Update' button.
|
||||
ImageButton buttonUpdate = new ImageButton()
|
||||
{
|
||||
Source = ImageUtils.GetImageFromByteArray(SacsResourceConsole.GetImageResource(SacsResourceConsole.ImageResource.IconShock_Pencil_Orange_72_png))
|
||||
};
|
||||
buttonUpdate.Pressed += (sender, evt) =>
|
||||
{
|
||||
// Update job.
|
||||
SlmPage_Assets_RepairJob.Config pageConfig = new SlmPage_Assets_RepairJob.Config(AssetRepairPage.CompanyId);
|
||||
pageConfig.AssetRepairJobToUpdate = repairJob;
|
||||
SlmPage_Assets_RepairJob page = new SlmPage_Assets_RepairJob(pageConfig);
|
||||
page.Disappearing += (sender2, e2) =>
|
||||
{
|
||||
if (page.Cancelled) return;
|
||||
RefreshPanels();
|
||||
};
|
||||
Application.Current.MainPage.Navigation.PushModalAsync(page, false);
|
||||
};
|
||||
gridDetails.Children.Add(buttonUpdate, 1, rowIdx);
|
||||
// 'Remove' button.
|
||||
ImageButton buttonRemove = new ImageButton()
|
||||
{
|
||||
Source = ImageUtils.GetImageFromByteArray(SacsResourceConsole.GetImageResource(SacsResourceConsole.ImageResource.IconShock_TrashCan_Grey_72_png))
|
||||
};
|
||||
buttonRemove.Pressed += async (sender, evt) =>
|
||||
{
|
||||
// Confirm removal.
|
||||
String msg = "Are you sure that job '" + repairJobDisplay + "' should be removed?";
|
||||
if (!await AssetRepairPage.DisplayConfirm(msg)) return;
|
||||
// Remove job from list and refresh.
|
||||
repairJobs.Remove(repairJob);
|
||||
RefreshPanels();
|
||||
};
|
||||
gridDetails.Children.Add(buttonRemove, 2, rowIdx);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
protected override void ButtonAddItem_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
SlmPage_Assets_RepairJob.Config pageConfig = new SlmPage_Assets_RepairJob.Config(AssetRepairPage.CompanyId);
|
||||
SlmPage_Assets_RepairJob page = new SlmPage_Assets_RepairJob(pageConfig);
|
||||
page.Disappearing += (sender2, e2) =>
|
||||
{
|
||||
if (!page.Cancelled)
|
||||
{
|
||||
SlmAssetRepairJob.Data repairJobData = page.NewAssetRepairJobData;
|
||||
if (repairJobData != null)
|
||||
{
|
||||
repairJobs.Add(repairJobData);
|
||||
RefreshPanels();
|
||||
DropDown();
|
||||
}
|
||||
}
|
||||
};
|
||||
Application.Current.MainPage.Navigation.PushModalAsync(page, false);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Views
|
||||
|
||||
// Menu grid.
|
||||
menuGrid.BackgroundColor = Color.FromHex("#F0F0F0");
|
||||
menuGrid.Padding = new Thickness(4);
|
||||
menuGrid.Padding = new Thickness(4,8);
|
||||
menuGrid.RowSpacing = 2.0;
|
||||
menuGrid.ColumnSpacing = 2.0;
|
||||
menuGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(48) });
|
||||
@@ -57,7 +57,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Views
|
||||
optionImage = new Image() { Source = option.ImageSource, HeightRequest = 24, WidthRequest = 24 };
|
||||
menuGrid.Children.Add(optionImage, 0, optionIdx);
|
||||
}
|
||||
Label optionLabel = new Label() { Text = option.Caption, HeightRequest = 24, BackgroundColor = Color.Transparent };
|
||||
SlmLabel optionLabel = new SlmLabel() { Text = option.Caption, HeightRequest = 24, BackgroundColor = Color.Transparent };
|
||||
if (option.Heading)
|
||||
optionLabel.FontAttributes = FontAttributes.Bold;
|
||||
menuGrid.Children.Add(optionLabel, 1, optionIdx);
|
||||
@@ -75,6 +75,7 @@ namespace Sarand.LogisticsMgr.Mobile.Forms.Views
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public virtual List<OptionData> MenuOptions { get; }
|
||||
public double MenuHeight => menuGrid.Height + menuGrid.Padding.Top + menuGrid.Padding.Bottom + SlmMobile.MenuBorder;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// M e n u E v e n t s
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.App;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.CodeTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class SlmApplication : Application
|
||||
public abstract class SlmApplication : SaxApplication
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
@@ -26,6 +28,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// W e b S e r v i c e
|
||||
//-------------------------------------------------------------------
|
||||
public abstract Task<bool> IsWebServiceAlive (SlmSiteDefinition siteDefinition);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S i t e D e f i n i t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Sarand.Core.Mobile.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
|
||||
@@ -24,6 +26,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
public static String AppTitle { get; } = "Sarand LogisticsMgr";
|
||||
// Utilities.
|
||||
public static Random Random { get; } = new Random();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Localisation.
|
||||
public static CultureInfo CultureInfo => CultureInfo.CurrentCulture;
|
||||
public static TextInfo TextInfo => CultureInfo.TextInfo;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Application styling.
|
||||
public static double ApplicationBarHeight = 28;
|
||||
@@ -34,6 +42,17 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
public static double ApplicationBarBorderBottom = 1.0;
|
||||
public static Color MenuBorderColor = Color.DarkSlateBlue;
|
||||
public static double MenuBorder = 1.0;
|
||||
// Dynamic font sizing.
|
||||
public static double FontSizeRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SaxApplication.MinDeviceDimension > 2000) return 1.75;
|
||||
if (SaxApplication.MinDeviceDimension > 1600) return 1.50;
|
||||
if (SaxApplication.MinDeviceDimension > 1200) return 1.25;
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
// Pages.
|
||||
public static Color PageCaptionBackgroundColor = Color.FromHex("#558395");
|
||||
public static double PageCaptionPaddingHorizontal = 4.0;
|
||||
@@ -53,6 +72,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.App
|
||||
public static Color ControlBorderColor = Color.FromHex("#f8f8f8");
|
||||
public static double ControlBorderWidth = 0.5;
|
||||
public static Thickness LabelMargin { get; } = new Thickness(4.0, 8.0, 0, 0);
|
||||
// Associated items panel.
|
||||
public static Color AssociatedItemsCaptionBackgroundColor = Color.FromHex("#becee4");
|
||||
public static Color AssociatedItemsCaptionTextColor = Color.FromHex("#f8f8f8");
|
||||
public static double AssociatedItemsCaptionTextSizeRatio = 1.2;
|
||||
public static Color AssociatedItemsBackgroundColor = Color.FromHex("#dbe4f0");
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
public String Email { get { return SessionProfile.Email; } }
|
||||
public override bool DatabaseIsValid { get { return true; } }
|
||||
public override bool CanUpdateDatabase { get { return true; } }
|
||||
public bool Populating { get; private set; } = false;
|
||||
public bool Populated { get; private set; } = false;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e f r e s h C o d e T y p e s
|
||||
@@ -65,6 +67,9 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
public void RefreshCodeTypes ()
|
||||
{
|
||||
String fn = GetType().Name + ".RefreshCodeTypes";
|
||||
Populated = false;
|
||||
Populating = true;
|
||||
|
||||
// Cancel previous refresh.
|
||||
if (refreshTaskData != null)
|
||||
{
|
||||
@@ -117,6 +122,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
codeTypes = refreshTaskData.CodeTypes;
|
||||
this.codeTypeCodes = codeTypeCodes;
|
||||
if (refreshTaskData.Debug) Logger.Debug(fn + " Code types: " + codeTypes.Count + ". Codes: " + codeTypeCodes.Count);
|
||||
Populating = false;
|
||||
Populated = true;
|
||||
// Dispose the class refresh data.
|
||||
if (this.refreshTaskData == refreshTaskData)
|
||||
{
|
||||
@@ -205,7 +212,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SaCodeType.Column.Id);
|
||||
String code = itemData.GetValue(SaCodeType.Column.Code);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SaCodeType.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SaCodeType.Column.Flags);
|
||||
// Create item.
|
||||
SlmCodeType_Mobile saCodeType = new SlmCodeType_Mobile(id, code, flags);
|
||||
// Populate item properties.
|
||||
@@ -277,7 +284,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.CodeTypes
|
||||
SysId id = itemData.GetIdValue(SaCode.Column.Id);
|
||||
SysId codeTypeId = itemData.GetIdValue(SaCode.Column.CodeTypeId);
|
||||
String code = itemData.GetValue(SaCode.Column.Code);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SaCode.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SaCode.Column.Flags);
|
||||
// Create item.
|
||||
SlmCode_Mobile saCode = new SlmCode_Mobile(id, codeTypeId, code, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
// Components.
|
||||
private SlmContentView outerView = new SlmContentView();
|
||||
private SlmContentView embeddedView = new SlmContentView();
|
||||
private readonly SlmLabel label = new SlmLabel() { Text = "" };
|
||||
private readonly SlmLabel label = new SlmLabel();
|
||||
// Styling.
|
||||
private Thickness borderThickness = new Thickness();
|
||||
private Color borderColor = Color.Transparent;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -19,6 +20,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
// Construction.
|
||||
public SlmEntry ()
|
||||
{
|
||||
// Font sizing.
|
||||
FontSize = FontSize * SlmMobile.FontSizeRatio;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -42,6 +43,21 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
get { return entry.MaxLength; }
|
||||
set { entry.MaxLength = value; }
|
||||
}
|
||||
public SaxEntry.TextCaseType TextCase
|
||||
{
|
||||
get { return entry.TextCase; }
|
||||
set { entry.TextCase = value; }
|
||||
}
|
||||
public bool NumericOnly
|
||||
{
|
||||
get { return entry.NumericOnly; }
|
||||
set { entry.NumericOnly = value; }
|
||||
}
|
||||
public byte Decimals
|
||||
{
|
||||
get { return entry.Decimals; }
|
||||
set { entry.Decimals = value; }
|
||||
}
|
||||
public Keyboard Keyboard
|
||||
{
|
||||
get { return entry.Keyboard; }
|
||||
|
||||
@@ -20,9 +20,14 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
OkCancel,
|
||||
Close
|
||||
}
|
||||
public class Config
|
||||
{
|
||||
public NavigationMode NavigationMode { get; set; } = NavigationMode.OkCancel;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Config config;
|
||||
private SlmAccountMgr_Mobile accountMgr = null;
|
||||
private SlmAssetMgr_Mobile assetMgr = null;
|
||||
// Main grid.
|
||||
@@ -42,7 +47,27 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmFormPage ()
|
||||
public SlmFormPage (Config config)
|
||||
{
|
||||
this.config = config;
|
||||
InitialiseComponents();
|
||||
ConfigureForm();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
protected SlmSessionContext_Mobile SessionContext { get { return SlmGlobals_Mobile.SessionProfile.SessionContext; } }
|
||||
protected SlmContentView FormBodyView { get { return contentViewBody; } }
|
||||
public bool AddMode { get; protected set; } = true;
|
||||
public bool Changed { get; protected set; } = false;
|
||||
public bool Cancelled { get; private set; } = true;
|
||||
// Managers.
|
||||
protected SlmAccountMgr_Mobile AccountMgr { get { if (accountMgr == null) accountMgr = new SlmAccountMgr_Mobile(SessionContext); return accountMgr; } }
|
||||
protected SlmAssetMgr_Mobile AssetMgr { get { if (assetMgr == null) assetMgr = new SlmAssetMgr_Mobile(SessionContext); return assetMgr; } }
|
||||
//-------------------------------------------------------------------
|
||||
// I n i t i a l i s e
|
||||
//-------------------------------------------------------------------
|
||||
private void InitialiseComponents ()
|
||||
{
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
BackgroundColor = SlmMobile.PageBaseColor;
|
||||
@@ -88,32 +113,16 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
viewNavigation.Content = gridNavigation;
|
||||
viewNavigation.Padding = new Thickness(0, SlmMobile.PageNavigationBorderTopWidth, 0, 0);
|
||||
viewNavigation.BackgroundColor = SlmMobile.PageNavigationBorderColor;
|
||||
ConfigureNavigationBar();
|
||||
buttonOk.Clicked += ButtonOk_Clicked;
|
||||
buttonCancel.Clicked += ButtonCancel_Clicked;
|
||||
buttonClose.Clicked += ButtonClose_Clicked;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
protected SlmSessionContext_Mobile SessionContext { get { return SlmGlobals_Mobile.SessionProfile.SessionContext; } }
|
||||
protected SlmContentView FormBodyView { get { return contentViewBody; } }
|
||||
public bool Changed { get; protected set; } = false;
|
||||
// Managers.
|
||||
protected SlmAccountMgr_Mobile AccountMgr { get { if (accountMgr == null) accountMgr = new SlmAccountMgr_Mobile(SessionContext); return accountMgr; } }
|
||||
protected SlmAssetMgr_Mobile AssetMgr { get { if (assetMgr == null) assetMgr = new SlmAssetMgr_Mobile(SessionContext); return assetMgr; } }
|
||||
|
||||
// C o n f i g u r e F o r m
|
||||
//-------------------------------------------------------------------
|
||||
// N a v i g a t i o n M o d e
|
||||
//-------------------------------------------------------------------
|
||||
private NavigationMode navigationMode = NavigationMode.OkCancel;
|
||||
protected NavigationMode SetNavigationMode ()
|
||||
private void ConfigureForm ()
|
||||
{
|
||||
return navigationMode;
|
||||
}
|
||||
protected void SetNavigationMode (NavigationMode mode)
|
||||
{
|
||||
navigationMode = mode;
|
||||
ConfigureNavigationBar();
|
||||
}
|
||||
private void ConfigureNavigationBar ()
|
||||
@@ -121,24 +130,29 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
gridNavigation.Margin = new Thickness(0);
|
||||
gridNavigation.Padding = new Thickness(SlmMobile.PageBodyPaddingHorizontalMin, SlmMobile.PageNavigationPaddingVertical);
|
||||
gridNavigation.RowSpacing = 4;
|
||||
gridNavigation.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
if (gridNavigation.RowDefinitions.Count == 0)
|
||||
gridNavigation.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridNavigation.ColumnSpacing = 0;
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
if (gridNavigation.ColumnDefinitions.Count == 0)
|
||||
{
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
gridNavigation.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
}
|
||||
gridNavigation.BackgroundColor = SlmMobile.PageNavigationBackgroundColor;
|
||||
|
||||
if (navigationMode == NavigationMode.OkCancel)
|
||||
if (config.NavigationMode == NavigationMode.OkCancel)
|
||||
{
|
||||
// OK & Cancel Buttons.
|
||||
gridNavigation.Children.Add(buttonCancel, 1, 0);
|
||||
gridNavigation.Children.Add(buttonOk, 3, 0);
|
||||
buttonCancel.HorizontalOptions = LayoutOptions.Start;
|
||||
gridNavigation.Children.Add(buttonCancel, 0, 0);
|
||||
buttonOk.HorizontalOptions = LayoutOptions.End;
|
||||
gridNavigation.Children.Add(buttonOk, 2, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
gridNavigation.Children.Add(buttonClose, 2, 3);
|
||||
buttonClose.HorizontalOptions = LayoutOptions.Center;
|
||||
gridNavigation.Children.Add(buttonClose, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,10 +207,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
/// <summary>Confirm that form is valid and details saved before closig the form page.</summary>
|
||||
protected void ButtonOk_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
if (!SaveFormData()) return;
|
||||
bool saveFormData = SaveFormData();
|
||||
if (!saveFormData) return;
|
||||
Cancelled = false;
|
||||
CloseForm();
|
||||
}
|
||||
protected virtual bool SaveFormData () { return true; }
|
||||
protected virtual bool SaveFormData () { return false; }
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Confirm that form is valid and details saved before closig the form page.</summary>
|
||||
protected void ButtonCancel_Clicked (object sender, EventArgs e)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using Sarand.Core.Mobile.Forms.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
{
|
||||
//=======================================================================
|
||||
public class SlmFrame : SaxFrame
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmFrame ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -20,7 +20,11 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
// Construction.
|
||||
public SlmLabel ()
|
||||
{
|
||||
// Styling.
|
||||
Margin = SlmMobile.LabelMargin;
|
||||
|
||||
// Font sizing.
|
||||
FontSize = FontSize * SlmMobile.FontSizeRatio;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -21,6 +22,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
// Construction.
|
||||
public SlmPicker ()
|
||||
{
|
||||
// Font sizing.
|
||||
FontSize = FontSize * SlmMobile.FontSizeRatio;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Mobile.Forms.Controls;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -31,6 +32,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
picker.Unfocused += Picker_Unfocused;
|
||||
picker.BackgroundColor = Color.Transparent;
|
||||
picker.SelectedIndexChanged += Picker_SelectedIndexChanged;
|
||||
picker.Populated += Picker_Populated;
|
||||
|
||||
ConfigureComponents();
|
||||
SetControlActivity();
|
||||
@@ -75,27 +77,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
if (!ReadOnly) Content = picker;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
private void Picker_Focused (object sender, FocusEventArgs e)
|
||||
{
|
||||
Control_Focused(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void Picker_Unfocused (object sender, FocusEventArgs e)
|
||||
{
|
||||
Control_Unfocused(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public event EventHandler<EventArgs> SelectedIndexChanged;
|
||||
private void Picker_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
ReadOnlyText = (picker.SelectedItem != null ? picker.SelectedItem.ToString() : "");
|
||||
if (ReadOnly) return;
|
||||
if (SelectedIndexChanged != null) SelectedIndexChanged.Invoke(sender, e);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// V i e w E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
@@ -128,6 +109,33 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Base
|
||||
base.OnSizeAllocated(width, height);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n t r o l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
private void Picker_Focused (object sender, FocusEventArgs e)
|
||||
{
|
||||
Control_Focused(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
private void Picker_Unfocused (object sender, FocusEventArgs e)
|
||||
{
|
||||
Control_Unfocused(sender, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public event SaxPicker.PopulatedEventHandler Populated;
|
||||
private void Picker_Populated (object sender, SaxPicker.PopulatedEventArgs e)
|
||||
{
|
||||
if (Populated != null) Populated.Invoke(this, e);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public event EventHandler<EventArgs> SelectedIndexChanged;
|
||||
private void Picker_SelectedIndexChanged (object sender, EventArgs e)
|
||||
{
|
||||
ReadOnlyText = (picker.SelectedItem != null ? picker.SelectedItem.ToString() : "");
|
||||
if (ReadOnly) return;
|
||||
if (SelectedIndexChanged != null) SelectedIndexChanged.Invoke(sender, e);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -29,6 +29,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
get { return (Picker as SlmPicker_Codes).CodeType; }
|
||||
set { (Picker as SlmPicker_Codes).CodeType = value; }
|
||||
}
|
||||
public bool ContainsCode (String code)
|
||||
{
|
||||
return Picker.ContainsItemCode(code);
|
||||
}
|
||||
public String SelectedCode
|
||||
{
|
||||
get { return (Picker as SlmPicker_Codes).SelectedCode; }
|
||||
|
||||
@@ -33,6 +33,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
get { return (Picker as SlmPicker_Companies).SelectedCompanyId; }
|
||||
set { (Picker as SlmPicker_Companies).SelectedCompanyId = value; }
|
||||
}
|
||||
public SlmCompany SelectedCompany
|
||||
{
|
||||
get { return (Picker as SlmPicker_Companies).SelectedCompany; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Companies.
|
||||
@@ -49,6 +53,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private Slm.CompanyType companyType = Slm.CompanyType.Unknown;
|
||||
private readonly List<SlmCompany> companies = new List<SlmCompany>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -82,6 +87,13 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
base.SelectedItemId = value;
|
||||
}
|
||||
}
|
||||
public SlmCompany SelectedCompany
|
||||
{
|
||||
get
|
||||
{
|
||||
return companies.Find(item => item.Id.Equals(SelectedCompanyId));
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o m p a n i e s
|
||||
@@ -107,6 +119,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
|
||||
// Clear companies.
|
||||
ClearItems();
|
||||
companies.Clear();
|
||||
if (companyType == Slm.CompanyType.Unknown) return;
|
||||
|
||||
// Refresh companies.
|
||||
@@ -137,7 +150,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Controls
|
||||
|
||||
// Retrieve companies.
|
||||
SlmAccountMgr_Mobile accountMgr = new SlmAccountMgr_Mobile(SlmGlobals_Mobile.SessionProfile.SessionContext);
|
||||
List<SlmCompany> companies = await accountMgr.GetCompanyList_Mobile(prmCompany, taskData);
|
||||
companies.Clear();
|
||||
companies.AddRange(await accountMgr.GetCompanyList_Mobile(prmCompany, taskData));
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
|
||||
List<SlmPickerItem> pickerItems = new List<SlmPickerItem>();
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.App;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Forms.Base;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -11,26 +14,130 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Forms.Panels
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
private SlmFrame viewPanel = new SlmFrame();
|
||||
private SlmStackLayout stackLayout = new SlmStackLayout() { Orientation = StackOrientation.Vertical };
|
||||
//private SlmPanel
|
||||
private SlmGrid gridCaption = new SlmGrid();
|
||||
private ImageButton buttonDropdown = new ImageButton();
|
||||
private ImageButton buttonCloseUp = new ImageButton();
|
||||
private SlmLabel labelCaption = new SlmLabel();
|
||||
private ImageButton buttonAddItem = new ImageButton();
|
||||
private SlmPanel panelSummary = new SlmPanel();
|
||||
private SlmPanel panelDetails = new SlmPanel();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
public String caption = "";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SlmPanel_AssociatedItems ()
|
||||
{
|
||||
// Panel view - to allow rounded corners.
|
||||
viewPanel.Padding = new Thickness(0,0,0,12);
|
||||
viewPanel.BackgroundColor = SlmMobile.AssociatedItemsBackgroundColor;
|
||||
viewPanel.CornerRadius = 8;
|
||||
Content = viewPanel;
|
||||
|
||||
// Main layout.
|
||||
stackLayout.Padding = new Thickness(0);
|
||||
viewPanel.Content = stackLayout;
|
||||
|
||||
// Caption grid.
|
||||
gridCaption.Margin = new Thickness(0);
|
||||
gridCaption.Padding = new Thickness(0, 4, 0, 0);
|
||||
gridCaption.HorizontalOptions = LayoutOptions.Center;
|
||||
gridCaption.VerticalOptions = LayoutOptions.Center;
|
||||
gridCaption.RowSpacing = 0;
|
||||
gridCaption.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridCaption.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
|
||||
gridCaption.ColumnSpacing = 0;
|
||||
gridCaption.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
gridCaption.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
|
||||
gridCaption.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
|
||||
gridCaption.BackgroundColor = SlmMobile.AssociatedItemsCaptionBackgroundColor;
|
||||
stackLayout.Children.Add(gridCaption);
|
||||
// Dropdown button.
|
||||
buttonDropdown.HorizontalOptions = LayoutOptions.Start;
|
||||
buttonDropdown.VerticalOptions = LayoutOptions.Center;
|
||||
buttonDropdown.Source = ImageUtils.GetImageFromByteArray(SacsResourceConsole.GetImageResource(SacsResourceConsole.ImageResource.IconShock_Arrow_Down_Purple_72_png));
|
||||
buttonDropdown.BackgroundColor = Color.Transparent;
|
||||
buttonDropdown.Padding = new Thickness(12, 0);
|
||||
buttonDropdown.Clicked += ButtonDropdown_Clicked;
|
||||
gridCaption.Children.Add(buttonDropdown, 0, 0);
|
||||
// Closeup button.
|
||||
buttonCloseUp.HorizontalOptions = LayoutOptions.Start;
|
||||
buttonCloseUp.VerticalOptions = LayoutOptions.Center;
|
||||
buttonCloseUp.Source = ImageUtils.GetImageFromByteArray(SacsResourceConsole.GetImageResource(SacsResourceConsole.ImageResource.IconShock_Arrow_Right_Purple_72_png));
|
||||
buttonCloseUp.BackgroundColor = Color.Transparent;
|
||||
buttonCloseUp.Padding = new Thickness(12, 0);
|
||||
buttonCloseUp.Clicked += ButtonCloseUp_Clicked;
|
||||
gridCaption.Children.Add(buttonCloseUp, 0, 0);
|
||||
// Caption.
|
||||
labelCaption.Margin = new Thickness(0, 0, 0, 8);
|
||||
labelCaption.TextColor = SlmMobile.AssociatedItemsCaptionTextColor;
|
||||
labelCaption.FontSize *= SlmMobile.AssociatedItemsCaptionTextSizeRatio;
|
||||
labelCaption.BackgroundColor = Color.Transparent;
|
||||
gridCaption.Children.Add(labelCaption, 1, 0);
|
||||
// Add Item button.
|
||||
buttonAddItem.HorizontalOptions = LayoutOptions.End;
|
||||
buttonAddItem.VerticalOptions = LayoutOptions.Center;
|
||||
buttonAddItem.Source = ImageUtils.GetImageFromByteArray(SacsResourceConsole.GetImageResource(SacsResourceConsole.ImageResource.IconShock_Add_Green_72_png));
|
||||
buttonAddItem.BackgroundColor = Color.Transparent;
|
||||
buttonAddItem.Padding = new Thickness(12, 0);
|
||||
buttonAddItem.Clicked += ButtonAddItem_Clicked;
|
||||
gridCaption.Children.Add(buttonAddItem, 2, 0);
|
||||
|
||||
// Panels.
|
||||
panelSummary.Padding = new Thickness(4,0);
|
||||
panelSummary.BackgroundColor = Color.Transparent;
|
||||
stackLayout.Children.Add(panelSummary);
|
||||
panelDetails.Padding = new Thickness(4, 0);
|
||||
panelDetails.BackgroundColor = Color.Transparent;
|
||||
stackLayout.Children.Add(panelDetails);
|
||||
|
||||
// Default configuration.
|
||||
CloseUp();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public String Caption
|
||||
{
|
||||
get { return caption; }
|
||||
set { if (caption.Equals(value)) return; caption = value; }
|
||||
get { return labelCaption.Text; }
|
||||
set { if (labelCaption.Text.Equals(value)) return; labelCaption.Text = value; }
|
||||
}
|
||||
protected SlmPanel SummaryPanel => panelSummary;
|
||||
protected SlmPanel DetailsPanel => panelDetails;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I t e m s T o g g l e
|
||||
//-------------------------------------------------------------------
|
||||
protected void DropDown ()
|
||||
{
|
||||
buttonDropdown.IsVisible = false;
|
||||
buttonCloseUp.IsVisible = true;
|
||||
panelSummary.IsVisible = false;
|
||||
panelDetails.IsVisible = true;
|
||||
}
|
||||
protected void CloseUp ()
|
||||
{
|
||||
buttonDropdown.IsVisible = true;
|
||||
buttonCloseUp.IsVisible = false;
|
||||
panelSummary.IsVisible = true;
|
||||
panelDetails.IsVisible = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a n e l E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
private void ButtonDropdown_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
DropDown();
|
||||
}
|
||||
private void ButtonCloseUp_Clicked (object sender, EventArgs e)
|
||||
{
|
||||
CloseUp();
|
||||
}
|
||||
protected virtual void ButtonAddItem_Clicked (object sender, EventArgs e) { }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
ItemId itemId = new ItemId();
|
||||
if (SysId.IsValid(companyId)) itemId = new ItemId((short)Slm.DataItemType.Company, companyId);
|
||||
else if (SysId.IsValid(staffMemberId)) itemId = new ItemId((short)Slm.DataItemType.Company, staffMemberId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmAddress.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmAddress.Column.Flags);
|
||||
// Create item.
|
||||
SlmAddress_Mobile address = new SlmAddress_Mobile(Site, id, itemId, addressType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -298,7 +298,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmCompany.Column.Id);
|
||||
Slm.CompanyType companyType = EnumUtil.ParseEnum(itemData.GetValue(SlmCompany.Column.CompanyType), Slm.CompanyType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCompany.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCompany.Column.Flags);
|
||||
// Create item.
|
||||
SlmCompany_Mobile company = new SlmCompany_Mobile(Site, id, companyType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -516,7 +516,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmAssetMovement.Column.Id);
|
||||
Slm.AssetItemType assetItemType = EnumUtil.ParseEnum(itemData.GetValue(SlmAssetMovement.Column.AssetItemType), Slm.AssetItemType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmAssetMovement.Column.Id.ToString());
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmAssetMovement.Column.Flags);
|
||||
// Create item.
|
||||
SlmAssetMovement_Mobile assetMovement = new SlmAssetMovement_Mobile(Site, id, assetItemType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -3,13 +3,16 @@ using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Data;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Tasks;
|
||||
using Sarand.Core.Xml;
|
||||
using Sarand.LogisticsMgr.Core.App;
|
||||
using Sarand.LogisticsMgr.Core.Bus;
|
||||
using Sarand.LogisticsMgr.Core.WebService;
|
||||
using Sarand.LogisticsMgr.Mobile.Core.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
@@ -34,6 +37,17 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
ClearErrorState();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public async Task<SlmAssetRepair> GetAssetRepair_Mobile (SlmAssetRepair.Params prmAssetRepair, SacsTaskData taskData)
|
||||
{
|
||||
ClearErrorState();
|
||||
List<SlmAssetRepair> companies = new List<SlmAssetRepair>();
|
||||
String fn = GetType().Name + ".GetAssetRepair_Mobile";
|
||||
|
||||
// Request item data.
|
||||
SlmWebServiceClient.ItemDataResponseData responseData = await webServiceClient.GetItemData(GetAssetRepairRequestConfig(SlmWebServiceRequest.RequestType.Data, taskData.Debug), GetAssetRepairQueryFilter_Mobile(prmAssetRepair), taskData);
|
||||
if (responseData.Item == null) SetErrorState("Asset Repair not present in response.");
|
||||
return GetAssetRepair(responseData.Item);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Asset Repair.
|
||||
@@ -44,6 +58,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 = GetAssetRepairRequestConfig(SlmWebServiceRequest.RequestType.Store, taskData.Debug);
|
||||
|
||||
// Execute web service request
|
||||
return await webServiceClient.StoreItem(configRequest, itemElement, taskData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Asset Repair.
|
||||
public override bool InsertAssetRepair (SlmAssetRepair assetRepair, DbUpdateInfo dbUpdateInfo)
|
||||
@@ -85,6 +111,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
// Copy data properties to and from database.
|
||||
private void PopulateTo (XElement assetRepairElement, SlmAssetRepair assetRepair, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
PopulateTo(assetRepairElement, assetRepair.GetData(), dbUpdateInfo);
|
||||
}
|
||||
private void PopulateTo (XElement assetRepairElement, SlmAssetRepair.Data assetRepair, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
assetRepairElement.AppendElement("Id", SysId.ToString(assetRepair.Id));
|
||||
assetRepairElement.AppendElement("Site", SlmSystem.GetSiteCode(assetRepair.Site));
|
||||
@@ -219,6 +249,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
ClearErrorState();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public async Task<long> GetCAssetRepairCount_Mobile (SlmAssetRepair.Params prmAssetRepair, SacsTaskData taskData)
|
||||
{
|
||||
ClearErrorState();
|
||||
SlmWebServiceClient.ItemCountResponseData responseData = await webServiceClient.GetItemCount(GetAssetRepairRequestConfig(SlmWebServiceRequest.RequestType.Count, taskData.Debug), GetAssetRepairQueryFilter_Mobile(prmAssetRepair), taskData);
|
||||
return responseData.ItemCount;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Asset Repair list.
|
||||
@@ -227,6 +263,77 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
List<SlmAssetRepair> assetRepairs = new List<SlmAssetRepair>();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public async Task<List<SlmAssetRepair>> GetAssetRepairList_Mobile (SlmAssetRepair.Params prmAssetRepair, SacsTaskData taskData)
|
||||
{
|
||||
ClearErrorState();
|
||||
List<SlmAssetRepair> assetRepairs = new List<SlmAssetRepair>();
|
||||
String fn = GetType().Name + ".GetAssetRepairList_Mobile";
|
||||
|
||||
// AssetRepair columns.
|
||||
List<SlmAssetRepair.Column> columns = new List<SlmAssetRepair.Column>()
|
||||
{
|
||||
SlmAssetRepair.Column.Id,
|
||||
SlmAssetRepair.Column.AssetMovementId,
|
||||
SlmAssetRepair.Column.RepairNarrative,
|
||||
SlmAssetRepair.Column.RepairInspector,
|
||||
SlmAssetRepair.Column.RepairReference,
|
||||
SlmAssetRepair.Column.RepairRemarks,
|
||||
SlmAssetRepair.Column.EstimateTypeCode,
|
||||
SlmAssetRepair.Column.CurrencyCode,
|
||||
SlmAssetRepair.Column.AuthoriseType,
|
||||
SlmAssetRepair.Column.AuthoriseReference,
|
||||
SlmAssetRepair.Column.AuthoriseRemarks,
|
||||
SlmAssetRepair.Column.EstimatedAt,
|
||||
SlmAssetRepair.Column.AuthorisedAt,
|
||||
SlmAssetRepair.Column.CompletedAt,
|
||||
SlmAssetRepair.Column.CancelledAt,
|
||||
SlmAssetRepair.Column.Notes,
|
||||
SlmAssetRepair.Column.Flags,
|
||||
SlmAssetRepair.Column.Status
|
||||
};
|
||||
|
||||
List<SlmWebServiceItemData> itemDataList = await ExecuteAssetRepairQuery_Mobile(columns, prmAssetRepair, taskData);
|
||||
foreach (SlmWebServiceItemData itemData in itemDataList)
|
||||
assetRepairs.Add(GetAssetRepair(itemData));
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
|
||||
if (taskData.Debug) Logger.Debug(fn + " AssetRepairs: " + assetRepairs.Count);
|
||||
return assetRepairs;
|
||||
}
|
||||
private SlmAssetRepair GetAssetRepair (SlmWebServiceItemData itemData)
|
||||
{
|
||||
if (itemData == null) return null;
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmAssetRepair.Column.Id);
|
||||
SysId assetMovementId = itemData.GetIdValue(SlmAssetRepair.Column.AssetMovementId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmAssetRepair.Column.Flags);
|
||||
// Create item.
|
||||
SlmAssetRepair_Mobile assetRepair = new SlmAssetRepair_Mobile(Site, id, assetMovementId, flags);
|
||||
// Populate item properties.
|
||||
foreach (SlmAssetRepair.Column column in EnumUtil.GetValues<SlmAssetRepair.Column>())
|
||||
{
|
||||
String value = itemData.GetValue(column);
|
||||
switch (column)
|
||||
{
|
||||
case SlmAssetRepair.Column.RepairNarrative: assetRepair.RepairNarrative = value; break;
|
||||
case SlmAssetRepair.Column.RepairInspector: assetRepair.RepairInspector = value; break;
|
||||
case SlmAssetRepair.Column.RepairReference: assetRepair.RepairReference = value; break;
|
||||
case SlmAssetRepair.Column.RepairRemarks: assetRepair.RepairRemarks = value; break;
|
||||
case SlmAssetRepair.Column.EstimateTypeCode: assetRepair.EstimateTypeCode = value; break;
|
||||
case SlmAssetRepair.Column.CurrencyCode: assetRepair.CurrencyCode = value; break;
|
||||
case SlmAssetRepair.Column.AuthoriseType: assetRepair.AuthoriseType = EnumUtil.ParseEnum(value, Slm.AssetRepairAuthoriseType.Unknown); break;
|
||||
case SlmAssetRepair.Column.AuthoriseReference: assetRepair.AuthoriseReference = value; break;
|
||||
case SlmAssetRepair.Column.AuthoriseRemarks: assetRepair.AuthoriseRemarks = value; break;
|
||||
case SlmAssetRepair.Column.EstimatedAt: assetRepair.EstimatedAt = itemData.GetDateTimeValue(column); break;
|
||||
case SlmAssetRepair.Column.AuthorisedAt: assetRepair.AuthorisedAt = itemData.GetDateTimeValue(column); break;
|
||||
case SlmAssetRepair.Column.CompletedAt: assetRepair.CompletedAt = itemData.GetDateTimeValue(column); break;
|
||||
case SlmAssetRepair.Column.CancelledAt: assetRepair.CancelledAt = itemData.GetDateTimeValue(column); break;
|
||||
case SlmAssetRepair.Column.Notes: assetRepair.Notes = value; break;
|
||||
case SlmAssetRepair.Column.Status: assetRepair.Status = SacsSystem.GetStatusForCode(value); break;
|
||||
}
|
||||
}
|
||||
return assetRepair;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Asset Repair query execution.
|
||||
@@ -235,6 +342,31 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
ClearErrorState();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public async Task<List<SlmWebServiceItemData>> ExecuteAssetRepairQuery_Mobile (List<SlmAssetRepair.Column> assetRepairColumns, SlmAssetRepair.Params prmAssetRepair, SacsTaskData taskData)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
// Columns.
|
||||
List<String> columns = new List<string>();
|
||||
foreach (SlmAssetRepair.Column column in assetRepairColumns)
|
||||
columns.Add(column.ToString());
|
||||
|
||||
SlmWebServiceClient.ItemListResponseData responseData = await webServiceClient.GetItemList(GetAssetRepairRequestConfig(SlmWebServiceRequest.RequestType.List, taskData.Debug), GetAssetRepairQueryFilter_Mobile(prmAssetRepair), columns, taskData);
|
||||
return responseData.Items;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
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 = User;
|
||||
configRequest.Context.Email = Email;
|
||||
configRequest.Context.Debug = debug;
|
||||
return configRequest;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
private SlmWebServiceDfn.ElementNameData ElementName { get; } = new SlmWebServiceDfn.ElementNameData();
|
||||
public SlmSessionProfile_Mobile SessionProfile { get { return SlmGlobals_Mobile.SessionProfile; } }
|
||||
public SlmSiteDefinition SiteDefinition { get { return SessionProfile.SiteDefinition; } }
|
||||
public String User { get { return SessionProfile.User; } }
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmBerthingCost.Column.Id);
|
||||
SysId berthingId = itemData.GetIdValue(SlmBerthingCost.Column.BerthingId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingCost.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingCost.Column.Flags);
|
||||
// Create item.
|
||||
SlmBerthingCost_Mobile berthingCost = new SlmBerthingCost_Mobile(Site, id, berthingId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmBerthingResource.Column.Id);
|
||||
SysId berthingId = itemData.GetIdValue(SlmBerthingResource.Column.BerthingId);
|
||||
Slm.BerthingResourceType berthingResourceType = EnumUtil.ParseEnum(itemData.GetValue(SlmBerthingResource.Column.BerthingResourceType), Slm.BerthingResourceType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingResource.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingResource.Column.Flags);
|
||||
// Create item.
|
||||
SlmBerthingResource_Mobile berthingResource = new SlmBerthingResource_Mobile(Site, id, berthingId, berthingResourceType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmBerthingTask.Column.Id);
|
||||
SysId berthingId = itemData.GetIdValue(SlmBerthingTask.Column.BerthingId);
|
||||
Slm.BerthingTaskType berthingTaskType = EnumUtil.ParseEnum(itemData.GetValue(SlmBerthingTask.Column.BerthingTaskType), Slm.BerthingTaskType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingTask.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthingTask.Column.Flags);
|
||||
// Create item.
|
||||
SlmBerthingTask_Mobile berthingTask = new SlmBerthingTask_Mobile(Site, id, berthingId, berthingTaskType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmBerthing.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthing.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmBerthing.Column.Flags);
|
||||
// Create item.
|
||||
SlmBerthing_Mobile berthing = new SlmBerthing_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmCruiseBerthing.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCruiseBerthing.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCruiseBerthing.Column.Flags);
|
||||
// Create item.
|
||||
SlmCruiseBerthing_Mobile cruiseBerthing = new SlmCruiseBerthing_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmDischargeHold.Column.Id);
|
||||
SysId berthingId = itemData.GetIdValue(SlmDischargeHold.Column.BerthingId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDischargeHold.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDischargeHold.Column.Flags);
|
||||
// Create item.
|
||||
SlmDischargeHold_Mobile dischargeHold = new SlmDischargeHold_Mobile(Site, id, berthingId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmDischarge.Column.Id);
|
||||
SysId berthingId = itemData.GetIdValue(SlmDischarge.Column.BerthingId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDischarge.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDischarge.Column.Flags);
|
||||
// Create item.
|
||||
SlmDischarge_Mobile discharge = new SlmDischarge_Mobile(Site, id, berthingId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmVessel.Column.Id);
|
||||
Slm.VesselCategory vesselCategory = EnumUtil.ParseEnum(itemData.GetValue(SlmVessel.Column.VesselCategory), Slm.VesselCategory.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmVessel.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmVessel.Column.Flags);
|
||||
// Create item.
|
||||
SlmVessel_Mobile vessel = new SlmVessel_Mobile(Site, id, vesselCategory, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmChecklistItem.Column.Id);
|
||||
SysId checklistId = itemData.GetIdValue(SlmChecklistItem.Column.ChecklistId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmChecklistItem.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmChecklistItem.Column.Flags);
|
||||
// Create item.
|
||||
SlmChecklistItem_Mobile checklistItem = new SlmChecklistItem_Mobile(Site, id, checklistId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmChecklist.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmChecklist.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmChecklist.Column.Flags);
|
||||
// Create item.
|
||||
SlmChecklist_Mobile checklist = new SlmChecklist_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmItemChecklistItem.Column.Id);
|
||||
SysId itemChecklistId = itemData.GetIdValue(SlmItemChecklistItem.Column.ItemChecklistId);
|
||||
SysId checklistItemId = itemData.GetIdValue(SlmItemChecklistItem.Column.ChecklistItemId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmItemChecklistItem.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmItemChecklistItem.Column.Flags);
|
||||
// Create item.
|
||||
SlmItemChecklistItem_Mobile itemChecklistItem = new SlmItemChecklistItem_Mobile(Site, id, itemChecklistId, checklistItemId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId itemId = itemData.GetIdValue(SlmItemChecklist.Column.ItemId);
|
||||
SysId checklistId = itemData.GetIdValue(SlmItemChecklist.Column.ChecklistId);
|
||||
Slm.ChecklistItemType itemType = EnumUtil.ParseEnum(itemData.GetValue(SlmItemChecklist.Column.ItemType), Slm.ChecklistItemType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmItemChecklist.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmItemChecklist.Column.Flags);
|
||||
// Create item.
|
||||
SlmItemChecklist_Mobile itemChecklist = new SlmItemChecklist_Mobile(Site, id, itemId, checklistId, itemType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -127,7 +127,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//commodity.Id = new SysId(StringUtil.ToInt(commodityElement.GetChildText("Id")));
|
||||
commodity.Code = commodityElement.GetChildText("Code");
|
||||
commodity.Desc = commodityElement.GetChildText("Desc");
|
||||
commodity.DescFmt = commodityElement.GetChildText("DescFmt");
|
||||
commodity.GenesysCode = commodityElement.GetChildText("GenesysCode");
|
||||
commodity.CustomerId = new SysId(StringUtil.ToInt(commodityElement.GetChildText("CustomerId")));
|
||||
commodity.CustomerCode = commodityElement.GetChildText("CustomerCode");
|
||||
@@ -252,7 +251,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmCommodity.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCommodity.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCommodity.Column.Flags);
|
||||
// Create item.
|
||||
SlmCommodity_Mobile commodity = new SlmCommodity_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
@@ -264,7 +263,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//case SlmCommodity.Column.CommodityCategory: commodity.CommodityCategory; break;
|
||||
case SlmCommodity.Column.Code: commodity.Code = value; break;
|
||||
case SlmCommodity.Column.Desc: commodity.Desc= value; break;
|
||||
case SlmCommodity.Column.DescFmt: commodity.DescFmt = value; break;
|
||||
case SlmCommodity.Column.GenesysCode: commodity.GenesysCode = value; break;
|
||||
case SlmCommodity.Column.CustomerId: commodity.CustomerId = itemData.GetIdValue(column); break;
|
||||
case SlmCommodity.Column.CustomerCode: commodity.CustomerCode = value; break;
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmCommodityLocation.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCommodityLocation.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmCommodityLocation.Column.Flags);
|
||||
// Create item.
|
||||
SlmCommodityLocation_Mobile commodityLocation = new SlmCommodityLocation_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmStockLevel.Column.Id);
|
||||
SysId commodityId = itemData.GetIdValue(SlmStockLevel.Column.CommodityId);
|
||||
Slm.StockLevelType stockLevelType = EnumUtil.ParseEnum(itemData.GetValue(SlmStockLevel.Column.StockLevelType), Slm.StockLevelType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLevel.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLevel.Column.Flags);
|
||||
// Create item.
|
||||
SlmStockLevel_Mobile stockLevel = new SlmStockLevel_Mobile(Site, id, commodityId, stockLevelType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStockLoading.Column.Id);
|
||||
SysId locationId = itemData.GetIdValue(SlmStockLoading.Column.LocationId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLoading.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLoading.Column.Flags);
|
||||
// Create item.
|
||||
SlmStockLoading_Mobile stockLoading = new SlmStockLoading_Mobile(Site, id, locationId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmStockLocation.Column.Id);
|
||||
SysId locationIdParent = itemData.GetIdValue(SlmStockLocation.Column.LocationIdParent);
|
||||
Slm.StockLocationType stockLocationType = EnumUtil.ParseEnum(itemData.GetValue(SlmStockLocation.Column.StockLocationType), Slm.StockLocationType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLocation.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockLocation.Column.Flags);
|
||||
// Create item.
|
||||
SlmStockLocation_Mobile stockLocation = new SlmStockLocation_Mobile(Site, id, locationIdParent, stockLocationType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmStockMovement.Column.Id);
|
||||
SysId commodityId = itemData.GetIdValue(SlmStockMovement.Column.CommodityId);
|
||||
Slm.StockMovementType stockMovementType = EnumUtil.ParseEnum(itemData.GetValue(SlmStockMovement.Column.StockMovementType), Slm.StockMovementType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockMovement.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStockMovement.Column.Flags);
|
||||
// Create item.
|
||||
SlmStockMovement_Mobile stockMovement = new SlmStockMovement_Mobile(Site, id, commodityId, stockMovementType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
//SysId id = itemData.GetIdValue(SlmDataItemValue.Column.Id);
|
||||
ItemId itemId = new ItemId();
|
||||
Slm.ItemValueType valueType = EnumUtil.ParseEnum(itemData.GetValue(SlmDataItemValue.Column.ValueType), Slm.ItemValueType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDataItemValue.Column.ItemId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmDataItemValue.Column.Flags);
|
||||
// Create item.
|
||||
SlmDataItemValue_Mobile dataItemValue = new SlmDataItemValue_Mobile(Site, itemId, valueType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmStaffAllocation.Column.Id);
|
||||
SysId staffTaskId = itemData.GetIdValue(SlmStaffAllocation.Column.StaffTaskId);
|
||||
SysId staffMemberId = itemData.GetIdValue(SlmStaffAllocation.Column.StaffMemberId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffAllocation.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffAllocation.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffAllocation_Mobile staffAllocation = new SlmStaffAllocation_Mobile(Site, id, staffTaskId, staffMemberId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffJob.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffJob.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffJob.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffJob_Mobile staffJob = new SlmStaffJob_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffMemberAvailability.Column.Id);
|
||||
SysId staffMemberId = itemData.GetIdValue(SlmStaffMemberAvailability.Column.StaffMemberId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMemberAvailability.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMemberAvailability.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffMemberAvailability_Mobile staffMemberAvailability = new SlmStaffMemberAvailability_Mobile(Site, id, staffMemberId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffMemberSkill.Column.Id);
|
||||
SysId staffMemberId = itemData.GetIdValue(SlmStaffMemberSkill.Column.StaffMemberId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMemberSkill.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMemberSkill.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffMemberSkill_Mobile staffMemberSkill = new SlmStaffMemberSkill_Mobile(Site, id, staffMemberId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
taskData.ThrowIfCancellationRequested();
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffMember.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMember.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffMember.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffMember_Mobile staffMember = new SlmStaffMember_Mobile(Site, id, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffTaskSkill.Column.Id);
|
||||
SysId staffMemberId = itemData.GetIdValue(SlmStaffTaskSkill.Column.StaffTaskId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffTaskSkill.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffTaskSkill.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffTaskSkill_Mobile staffTaskSkill = new SlmStaffTaskSkill_Mobile(Site, id, staffMemberId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmStaffTask.Column.Id);
|
||||
SysId staffJobId = itemData.GetIdValue(SlmStaffTask.Column.StaffJobId);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffTask.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmStaffTask.Column.Flags);
|
||||
// Create item.
|
||||
SlmStaffTask_Mobile staffTask = new SlmStaffTask_Mobile(Site, id, staffJobId, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
SysId id = itemData.GetIdValue(SlmRequirement.Column.Id);
|
||||
SysId transId = itemData.GetIdValue(SlmRequirement.Column.TransId);
|
||||
Slm.RequirementType requirementType = EnumUtil.ParseEnum(itemData.GetValue(SlmRequirement.Column.RequirementType), Slm.RequirementType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmRequirement.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmRequirement.Column.Flags);
|
||||
// Create item.
|
||||
SlmRequirement_Mobile requirement = new SlmRequirement_Mobile(Site, id, transId, requirementType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr
|
||||
// Item construction properties.
|
||||
SysId id = itemData.GetIdValue(SlmTransaction.Column.Id);
|
||||
Slm.TransactionType transactionType = EnumUtil.ParseEnum(itemData.GetValue(SlmTransaction.Column.TransactionType), Slm.TransactionType.Unknown);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmTransaction.Column.Id);
|
||||
ushort flags = (ushort)itemData.GetIntValue(SlmTransaction.Column.Flags);
|
||||
// Create item.
|
||||
SlmTransaction_Mobile transaction = new SlmTransaction_Mobile(Site, id, transactionType, flags);
|
||||
// Populate item properties.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Sarand.LogisticsMgr.Mobile.Core.WebService
|
||||
{
|
||||
//=======================================================================
|
||||
public static class SlmWebServiceStoreItemHelper
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -15,8 +16,4 @@
|
||||
<ProjectReference Include="..\..\..\LogisticsMgr-C#\Workspace\SaLogMgrCore\SaLogMgrCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Mobile\Core\Interface\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user