浏览代码

Added Security Tokens to govern Mobile QuickPick Module
Improved Speed of first scan in QuickPick module

frankvandenbos 8 月之前
父节点
当前提交
5d2a782d1f

+ 10 - 0
prs.classes/SecurityDescriptors/Mobile_Access.cs

@@ -96,4 +96,14 @@ namespace Comal.Classes.SecurityDescriptors
     public class ViewMobileTimesheetsModule : EnabledSecurityDescriptor<MobileAccessLicence>
     { 
     }
+    
+    [Caption("View Warehouse Quick Pick Module")]
+    public class ViewMobileQuickPickModule : EnabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
+    
+    [Caption("Allow Quick Pick without Job")]
+    public class AllowMobileQuickPickWithoutJob : DisabledSecurityDescriptor<MobileAccessLicence>
+    { 
+    }
 }

+ 2 - 9
prs.mobile.new/PRS.Mobile.Droid/PRS.Mobile.Droid.csproj

@@ -30,6 +30,7 @@
         <WarningLevel>4</WarningLevel>
         <AndroidLinkMode>None</AndroidLinkMode>
         <AndroidUseAapt2>true</AndroidUseAapt2>
+        <AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
     </PropertyGroup>
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
         <DebugSymbols>true</DebugSymbols>
@@ -46,14 +47,6 @@
         <AndroidLinkMode>None</AndroidLinkMode>
         <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
     </PropertyGroup>
-    <ItemGroup>
-        <Reference Include="Mono.Android" />
-        <Reference Include="System" />
-        <Reference Include="System.Core" />
-        <Reference Include="System.Xml.Linq" />
-        <Reference Include="System.Xml" />
-        <Reference Include="Mono.Android.Export" />
-    </ItemGroup>
     <ItemGroup>
         <PackageReference Include="Plugin.LocalNotification" Version="10.1.8" />
         <PackageReference Include="Resizetizer.NT" Version="0.3.0">
@@ -62,7 +55,7 @@
         </PackageReference>
         <PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.3" />
         <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
-        <PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
+        <PackageReference Include="Xamarin.Essentials" Version="1.8.1" />
         <PackageReference Include="Xamarin.Forms" Version="5.0.0.2662" />
         <PackageReference Include="XF.Material" Version="1.8.0" />
         <PackageReference Include="ZXing.Net.Mobile" Version="2.4.1" />

+ 0 - 1
prs.mobile.new/PRS.Mobile.Droid/Resources/Resource.designer.cs

@@ -2,7 +2,6 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.

+ 8 - 0
prs.mobile.new/PRS.Mobile.sln

@@ -111,12 +111,20 @@ Global
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
+		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhoneSimulator
+		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone
+		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
+		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
+		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|Any CPU.ActiveCfg = AppStore|iPhoneSimulator
+		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|Any CPU.Build.0 = AppStore|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Build.0 = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Deploy.0 = AppStore|iPhone
+		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
+		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator

+ 2 - 2
prs.mobile.new/PRS.Mobile/Modules/Warehousing/QuickPick/QuickPickModule.xaml

@@ -18,7 +18,7 @@
         <mobile:IntToBooleanConverter x:Key="SummaryPageVisible" Value="1" Result="True" />
         <mobile:BooleanMatcher x:Key="MatchAll" Type="All" Value="True" />
         <mobile:StringWithDefaultValueConverter x:Key="JobNameConverter" Default="(Select Job)" />
-        <mobile:GuidToBooleanConverter x:Key="GuidToBooleanConverter" EmptyValue="False"></mobile:GuidToBooleanConverter>
+        <!-- <mobile:GuidToBooleanConverter x:Key="GuidToBooleanConverter" EmptyValue="False"></mobile:GuidToBooleanConverter> -->
         
         <DataTemplate x:Key="_locationTemplate" x:Name="_locationTemplate" x:DataType="local:StockHoldingShell">
             <ViewCell>
@@ -168,7 +168,7 @@
             <mobile:MobileMenuButton.IsVisible>
                 <MultiBinding Converter="{StaticResource MatchAll}">
                     <Binding Path="HasItems" />
-                    <Binding Path="Job.ID" Converter="{StaticResource GuidToBooleanConverter}" />
+                    <!-- <Binding Path="Job.ID" Converter="{StaticResource GuidToBooleanConverter}" /> -->
                     <Binding Source="{x:Reference _tabStrip}" Path="SelectedIndex" Converter="{StaticResource SummaryPageVisible}" />
                 </MultiBinding>
             </mobile:MobileMenuButton.IsVisible>

+ 13 - 6
prs.mobile.new/PRS.Mobile/Modules/Warehousing/QuickPick/QuickPickModule.xaml.cs

@@ -4,6 +4,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using Comal.Classes;
+using Comal.Classes.SecurityDescriptors;
 using InABox.Core;
 using InABox.Mobile;
 using Xamarin.Essentials;
@@ -106,14 +107,14 @@ namespace PRS.Mobile
 
         private void SearchLocationID(Guid id)
         {
-            App.Data.StockLocations.Refresh(false);
-            var location = App.Data.StockLocations.FirstOrDefault(x => Guid.Equals(x.ID,id));
-            if (location != null)
-            {
+            //App.Data.StockLocations.Refresh(false);
+            //var location = App.Data.StockLocations.FirstOrDefault(x => Guid.Equals(x.ID,id));
+            //if (location != null)
+            //{
                 _viewModel.Holdings.Filter = () =>
-                    new Filter<StockHolding>(x => x.Location.ID).IsEqualTo(location.ID);
+                    new Filter<StockHolding>(x => x.Location.ID).IsEqualTo(id).Or(x=>x.Product.ID).IsEqualTo(id);
                 _viewModel.Holdings.Refresh(true);
-            }
+            //}
         }
         
         private void SelectFromHolding_Click(object sender, EventArgs e)
@@ -196,6 +197,12 @@ namespace PRS.Mobile
 
         private async void SaveList_Click(object sender, MobileMenuButtonClickedEventArgs args)
         {
+            if (_viewModel.Job.ID == Guid.Empty && !Security.IsAllowed<AllowMobileQuickPickWithoutJob>())
+            {
+                await MaterialDialog.Instance.AlertAsync("Please select a Job before saving!", "Error");
+                return;
+            }
+            
             using (await MaterialDialog.Instance.LoadingDialogAsync(message: "Saving"))
             {
                 try

+ 9 - 8
prs.mobile.new/PRS.Mobile/Modules/Warehousing/WarehouseModule.xaml.cs

@@ -16,6 +16,7 @@ namespace PRS.Mobile
 		{
 			InitializeComponent();
 			PickingLists.IsVisible = Security.IsAllowed<ViewMobileStoreRequisModule>();
+			QuickPick.IsVisible = Security.IsAllowed<ViewMobileQuickPickModule>();
 		}
 		
 		private void ReceiveStock_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
@@ -23,10 +24,10 @@ namespace PRS.Mobile
 			Navigation.PushAsync(new ConsignmentsModule());
 		}
 
-		private void IssueStock_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
-		{
-			Navigation.PushAsync(new TransferModule());
-		}
+		// private void IssueStock_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
+		// {
+		// 	Navigation.PushAsync(new TransferModule());
+		// }
 
 		private void TransferStock_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
 		{
@@ -77,10 +78,10 @@ namespace PRS.Mobile
 			Navigation.PushAsync(page);
 		}
 
-		private void Search_Products_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
-		{
-			Navigation.PushAsync(new ProductList2());
-		}
+		// private void Search_Products_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
+		// {
+		// 	Navigation.PushAsync(new ProductList2());
+		// }
 
 		private void PickingLists_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
 		{