Saxonite 1.2.11.3. Sandtrap.

This commit is contained in:
Andy Howard
2024-04-24 17:18:05 +01:00
parent 496aaeee0b
commit 7748941680
104 changed files with 5615 additions and 177 deletions
+6 -9
View File
@@ -41,7 +41,6 @@ namespace Sacs.Web.Components
//-------------------------------------------------------------------
// Properties.
private static String ClassName { get; } = nameof(SaController);
public DateTime CreatedAt { get; } = DateTime.Now;
public bool DebugMode { get; } = SacsSystem.DebugMode;
/// <summary>
@@ -125,7 +124,6 @@ namespace Sacs.Web.Components
//-------------------------------------------------------------------
public static String EncryptParameters(NameValueCollection parameters, String base64IV, String base64Key)
{
String fn = ClassName + ".EncryptParameters";
try
{
// Copy the list of parameters and sort the keys.
@@ -140,22 +138,21 @@ namespace Sacs.Web.Components
// Encrypt data.
String encrypted = SacsEncryptionHelper.Encrypt(queryString, base64IV, base64Key);
//if (SacsSystem.DebugMode) SaLogger.Debug(fn + "\n\tData: " + queryString + " \n\tEncrypted: " + encrypted);
//if (SacsSystem.DebugMode) SaLogger.Debug(SysUtil.Fn + "\n\tData: " + queryString + " \n\tEncrypted: " + encrypted);
return encrypted;
}
catch (Exception exc) { SaLogger.Warn(fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); }
catch (Exception exc) { SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); }
return "";
}
public static NameValueCollection DecryptParameters(String encrypted, String base64IV, String base64Key)
{
String fn = ClassName + ".DecryptParameters";
try
{
String queryString = SacsEncryptionHelper.Decrypt(encrypted, base64IV, base64Key);
//if (SacsSystem.DebugMode) SaLogger.Debug(fn + " \n\tEncrypted: " + encrypted + "\n\tData: " + queryString);
//if (SacsSystem.DebugMode) SaLogger.Debug(SysUtil.Fn + " \n\tEncrypted: " + encrypted + "\n\tData: " + queryString);
return HttpUtility.ParseQueryString(queryString);
}
catch (Exception exc) { SaLogger.Warn(fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); }
catch (Exception exc) { SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); }
return new NameValueCollection();
}
@@ -236,7 +233,7 @@ namespace Sacs.Web.Components
public MessageData Message { get; private set; }
public AjaxResponse_Base SetMessage(String title, String text)
{
if (!StringUtil.IsEmpty(text))
if (!StringUtil.IsBlank(text))
Message = new MessageData() { Title = title, Text = text };
return this;
}
@@ -368,7 +365,7 @@ namespace Sacs.Web.Components
{
foreach (FormControlValue controlValue in controlValues.Values)
{
if (!StringUtil.IsEmpty(controlValue.Error)) return true;
if (!StringUtil.IsBlank(controlValue.Error)) return true;
}
return false;
}