chore: add Imagoverum fleet management package
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Matrix42.Behaviors.Contracts;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using update4u.SPS.Security;
|
||||
|
||||
namespace Imagoverum.FleetManagement.BizLogic
|
||||
{
|
||||
public class CarBehavior() : CustomGenericBehavior
|
||||
{
|
||||
private static readonly string Secured = "***Secured***";
|
||||
|
||||
private const string PasswordField = "FuelCardPinCode";
|
||||
|
||||
public override void OnAdding(DbRecord dbRecord, BehaviorActionContext context)
|
||||
{
|
||||
if (dbRecord.Data["IMGVCarClass"]["Name"].ToString() == "Test")
|
||||
{
|
||||
dbRecord.Data["IMGVCarClass"]["Name"] = "Specify choice";
|
||||
}
|
||||
|
||||
EncryptPasswordField(dbRecord, context, isNew: true);
|
||||
|
||||
base.OnAdding(dbRecord, context);
|
||||
}
|
||||
|
||||
public override void OnModifing(DbRecord dbRecord, BehaviorActionContext context)
|
||||
{
|
||||
EncryptPasswordField(dbRecord, context, isNew: false);
|
||||
|
||||
base.OnModifing(dbRecord, context);
|
||||
}
|
||||
|
||||
private void EncryptPasswordField(DbRecord dbRecord, BehaviorActionContext context, bool isNew)
|
||||
{
|
||||
if (isNew || dbRecord.Data["IMGVCarClass"][PasswordField].ToString() != Secured)
|
||||
{
|
||||
dbRecord.Data["IMGVCarClass"][PasswordField] = CryptoManager.Instance.EncryptDBText(dbRecord.Data["IMGVCarClass"][PasswordField].ToString());
|
||||
}
|
||||
else if (dbRecord.Data["IMGVCarClass"][PasswordField].ToString() == Secured)
|
||||
{
|
||||
var oldRecordData = context?.OldValue?.Data;
|
||||
if (oldRecordData != null)
|
||||
{
|
||||
dbRecord.Data["IMGVCarClass"][PasswordField] = oldRecordData["IMGVCarClass"][PasswordField];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Imagoverum.FleetManagement.BizLogic
|
||||
{
|
||||
public static class CarTester
|
||||
{
|
||||
public static bool IsCarWorkingProperly()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>latestmajor</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Matrix42.Behaviors.Contracts">
|
||||
<HintPath>..\..\..\..\Root\bin\Matrix42.Behaviors.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="update4u.SPS.Security">
|
||||
<HintPath>..\..\..\..\Root\bin\update4u.SPS.Security.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<M42ExtensionId>22be0879-4587-cf4b-333c-08de16408acb</M42ExtensionId>
|
||||
<M42AssemblyPattern>$(MSBuildProjectName)*.*</M42AssemblyPattern>
|
||||
<M42EnableRidBuild>false</M42EnableRidBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\..\Extension.Assemblies.targets" Condition="Exists('..\..\..\Extension.Assemblies.targets')" />
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
REM %robodir%robocopy %targetDir% %basedir%BasePackage\Assemblies\ Imagoverum.FleetManagement*.* /s %roboOptions%
|
||||
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user