TS - Bus objects updated + Service classes and forms added

This commit is contained in:
Thomas Savine
2020-03-23 09:12:33 +00:00
parent 114aa49535
commit 7edbd07575
55 changed files with 8312 additions and 372 deletions
@@ -0,0 +1,71 @@
using Sarand.Core.Base;
using Sarand.Core.Data;
using System;
using System.Collections.Generic;
using System.Text;
namespace Sarand.PatientMgr.Core.Data
{
//=======================================================================
public static class SpmWindowsServiceCrypter
{
//-------------------------------------------------------------------
// Data members.
/// <summary>
/// Encryption is shared between Windows Service app and mobile
/// </summary>
private static readonly String requestDataKey = "<Sarand>~{PatientMgr}#[WindowsService]&/DataCryption/*|RequestData|";
private static readonly String responseDataKey = "{Sarand}+(PatientMgr)%\\WindowsService/=<DataCryption>@:Response:";
//-------------------------------------------------------------------
// R e q u e s t D a t a
//-------------------------------------------------------------------
/// <summary>Encrypt request data</summary>
public static String EncryptRequestData (String value)
{
try
{
return SacsAesIvCrypter.Encrypt(value, requestDataKey);
}
catch (Exception exc) { Logger.Debug("EncryptRequestData " + exc.GetType().Name + ": " + exc.Message); }
return value;
}
/// <summary>Decrypt request data</summary>
public static String DecryptRequestData (String value)
{
try
{
return SacsAesIvCrypter.Decrypt(value, requestDataKey);
}
catch (Exception exc) { Logger.Debug("DecryptRequestData " + exc.GetType().Name + ": " + exc.Message); }
return value;
}
//-------------------------------------------------------------------
// R e s p o n s e D a t a
//-------------------------------------------------------------------
/// <summary>Encrypt response data</summary>
public static String EncryptResponseData (String value)
{
try
{
return SacsAesIvCrypter.Encrypt(value, responseDataKey);
}
catch (Exception exc) { Logger.Debug("EncryptResponseData " + exc.GetType().Name + ": " + exc.Message); }
return value;
}
/// <summary>Decrypt response data</summary>
public static String DecryptResponseData (String value)
{
try
{
return SacsAesIvCrypter.Decrypt(value, responseDataKey);
}
catch (Exception exc) { Logger.Debug("DecryptResponseData " + exc.GetType().Name + ": " + exc.Message); }
return value;
}
//-------------------------------------------------------------------
}
//=======================================================================
}