3.0.0.0 Initial deployment.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.1",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,7 @@ namespace Sarand.BusinessMgr.Web.Control.App
|
||||
|
||||
// Application configuration.
|
||||
appConfigs = SbmAppConfigHelper.ExtractAppConfigs(SbmConfiguration.GetSection("AppConfigs"));
|
||||
emailConfigs = SbmEmailConfigHelper.ExtractEmailConfigs(SbmConfiguration.GetSection("EmailConfigs"));
|
||||
emailConfigs = SbmEmailConfigHelper.ExtractEmailConfigs(SbmConfiguration.GetSection("Email/Configs"));
|
||||
LoggingRootFolder = AppConfig.Logging.RootFolder;
|
||||
|
||||
// Application instance.
|
||||
|
||||
@@ -3,7 +3,7 @@ using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Web.Control.Controllers;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Helpers;
|
||||
|
||||
+23
-23
@@ -19,7 +19,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Web;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
namespace Sarand.BusinessMgr.Web.Control.Components
|
||||
{
|
||||
//======================================================================
|
||||
public class SbmController_Control : SbmController_Web
|
||||
@@ -56,7 +56,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
/// <summary>Control session data</summary>
|
||||
protected SbmApplication_Control App_Control { get { return SbmApplication_Control.Instance; } }
|
||||
protected SbmSessionData_Control SessionData_Control { get { return SessionData as SbmSessionData_Control; } }
|
||||
protected override SbmSessionData_Web DeserializeSessionData(String sessionDataJson)
|
||||
protected override SbmSessionData_Web DeserializeSessionData(string sessionDataJson)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<SbmSessionData_Control>(sessionDataJson, SessionDataJsonDeserializerSettings);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
/// <para>- Open user session - store details against Sesion Data.</para>
|
||||
/// <para>- Set 'Keep logged in' cookie if required.</para>
|
||||
/// </summary>
|
||||
protected bool SignUserIn(SbmcUserAccount userAccount, bool keepLoggedIn, ref String errorMessage)
|
||||
protected bool SignUserIn(SbmcUserAccount userAccount, bool keepLoggedIn, ref string errorMessage)
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposables = new DisposableCollection<SacsHierarchyItem>())
|
||||
@@ -134,7 +134,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
{
|
||||
// Validate user properties.
|
||||
if (!SysId.IsValid(userAccount.Id)) return false;
|
||||
if (StringUtil.IsEmpty(userAccount.EmailAddress)) return false;
|
||||
if (userAccount.EmailAddress.IsEmpty()) return false;
|
||||
|
||||
// Close previous session.
|
||||
CloseUserSession();
|
||||
@@ -161,9 +161,9 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
if (!AppConfig.Security.SignIn.KeepLoggedIn.Allowed) return false;
|
||||
|
||||
// Extract cookie details.
|
||||
String encryptedParams = GetRequestCookie(KeepLoggedIn.CookieName);
|
||||
string encryptedParams = GetRequestCookie(KeepLoggedIn.CookieName);
|
||||
KeepLoggedInParams keepLoggedInParams = ExtractKeepLoggedInParams(encryptedParams);
|
||||
String logSuffix = keepLoggedInParams.GetValidParams().Concat("", " ", ".");
|
||||
string logSuffix = keepLoggedInParams.GetValidParams().Concat("", " ", ".");
|
||||
if (keepLoggedInParams.IsValid())
|
||||
{
|
||||
using (SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(keepLoggedInParams.UserAccountId))
|
||||
@@ -172,7 +172,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
{
|
||||
if (userAccount.IsStatusActive)
|
||||
{
|
||||
String errorMessage = "";
|
||||
string errorMessage = "";
|
||||
if (SignUserIn(userAccount, true, ref errorMessage))
|
||||
{
|
||||
// Successful login.
|
||||
@@ -194,7 +194,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
/// <summary>Keep-Logged-In cookie.</summary>
|
||||
protected void SetKeepLoggedInCookie()
|
||||
{
|
||||
String keepLoggedInCookieValue = GenerateKeepLoggedInCookieValue();
|
||||
string keepLoggedInCookieValue = GenerateKeepLoggedInCookieValue();
|
||||
int cookieExpiresDays = Math.Max(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Min, Math.Min(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Max, AppConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays));
|
||||
SetResponseCookie(KeepLoggedIn.CookieName, keepLoggedInCookieValue, DateTime.Now.AddDays(cookieExpiresDays), true);
|
||||
SaLogger.Debug($"{SysUtil.Fn} 'Keep Logged In' cookie set. Value: " + keepLoggedInCookieValue);
|
||||
@@ -203,7 +203,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
/// <summary>Set the 'Keep Logged In' response cookie to expired with no data.</summary>
|
||||
public void ClearKeepLoggedInCookie()
|
||||
{
|
||||
if (StringUtil.IsEmpty(GetRequestCookie(KeepLoggedIn.CookieName))) return;
|
||||
if (GetRequestCookie(KeepLoggedIn.CookieName).IsEmpty()) return;
|
||||
// Clear cookie by setting expiry date in the past.
|
||||
SetResponseCookie(KeepLoggedIn.CookieName, "", DateTime.Today.AddDays(-7), true);
|
||||
SaLogger.Debug($"{SysUtil.Fn} 'Keep Logged In' cookie cleared.");
|
||||
@@ -217,16 +217,16 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
// - IV Must be regenerated if key is changed: uncomment 'Generated' variable and copy resulting value to IV variable.
|
||||
public static class KeepLoggedIn
|
||||
{
|
||||
public static String CookieName = "BCKLI";
|
||||
public static String Base64Key = SacsEncryptionHelper.EncodePlainKey("$BusinessMgr+KeEp-1OgG3d=1n}*32?", SacsEncryptionHelper.KeyLength);
|
||||
public static String Base64IV = "fpHMZchDkrJzgjVMrjpdHg==";
|
||||
public static string CookieName = "BCKLI";
|
||||
public static string Base64Key = SacsEncryptionHelper.EncodePlainKey("$BusinessMgr+KeEp-1OgG3d=1n}*32?", SacsEncryptionHelper.KeyLength);
|
||||
public static string Base64IV = "fpHMZchDkrJzgjVMrjpdHg==";
|
||||
//public static String Base64IV_Generated = SacsEncryptionHelper.InitSymmetricEncryptionIV(KeepLoggedIn.Base64Key);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Keep-logged-in cookie value.
|
||||
private static readonly String ParamName_KeepLoggedIn_UserAccountId = "uai";
|
||||
private String GenerateKeepLoggedInCookieValue()
|
||||
private static readonly string ParamName_KeepLoggedIn_UserAccountId = "uai";
|
||||
private string GenerateKeepLoggedInCookieValue()
|
||||
{
|
||||
NameValueCollection keepLoggedInParams = new NameValueCollection();
|
||||
keepLoggedInParams.Add(ParamName_KeepLoggedIn_UserAccountId, SysId.ToString(SessionData_Control.User.UserAccountId));
|
||||
@@ -238,9 +238,9 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
{
|
||||
public SysId UserAccountId { get; set; }
|
||||
/// <summary>Retrieve the list of valid parameters in printable format [Name: Value].</summary>
|
||||
public List<String> GetValidParams()
|
||||
public List<string> GetValidParams()
|
||||
{
|
||||
List<String> values = new List<String>();
|
||||
List<string> values = new List<string>();
|
||||
if (SysId.IsValid(UserAccountId))
|
||||
values.Add("UserAccountId: " + SysId.ToString(UserAccountId));
|
||||
return values;
|
||||
@@ -252,13 +252,13 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
SysId.IsValid(UserAccountId);
|
||||
}
|
||||
}
|
||||
public KeepLoggedInParams ExtractKeepLoggedInParams(String encryptedParams)
|
||||
public KeepLoggedInParams ExtractKeepLoggedInParams(string encryptedParams)
|
||||
{
|
||||
KeepLoggedInParams keepLoggedInParams = new KeepLoggedInParams();
|
||||
if (!StringUtil.IsEmpty(encryptedParams))
|
||||
if (!encryptedParams.IsEmpty())
|
||||
{
|
||||
NameValueCollection linkParams = DecryptParameters(encryptedParams, KeepLoggedIn.Base64IV, KeepLoggedIn.Base64Key);
|
||||
keepLoggedInParams.UserAccountId = new SysId(StringUtil.ToInt(linkParams.Get(ParamName_KeepLoggedIn_UserAccountId)));
|
||||
keepLoggedInParams.UserAccountId = new SysId(linkParams.Get(ParamName_KeepLoggedIn_UserAccountId).ToInt());
|
||||
}
|
||||
if (DebugMode) SaLogger.Info($"{SysUtil.Fn} UserAccountId: " + SysId.ToString(keepLoggedInParams.UserAccountId));
|
||||
return keepLoggedInParams;
|
||||
@@ -269,16 +269,16 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Encryption key is the same for all users each time the application is started,
|
||||
// but a different IV value is generated for each session so that the links/parameters cannot be shared.
|
||||
public static String Base64Key_ControlApp { get; } = SacsEncryptionHelper.EncodePlainKey("BusinessMgr=Control&Encryption-" + DateTime.Today.Format("ddMMyy"), SacsEncryptionHelper.KeyLength);
|
||||
protected String EncryptSessionParams(NameValueCollection parameters)
|
||||
public static string Base64Key_ControlApp { get; } = SacsEncryptionHelper.EncodePlainKey("BusinessMgr=Control&Encryption-" + DateTime.Today.Format("ddMMyy"), SacsEncryptionHelper.KeyLength);
|
||||
protected string EncryptSessionParams(NameValueCollection parameters)
|
||||
{
|
||||
return HttpUtility.UrlEncode(EncryptParameters(parameters, SessionData_Control.Base64IV_ControlApp, Base64Key_ControlApp));
|
||||
}
|
||||
public static String EncryptSessionParams(SbmController_Control controller, NameValueCollection parameters)
|
||||
public static string EncryptSessionParams(SbmController_Control controller, NameValueCollection parameters)
|
||||
{
|
||||
return controller.EncryptSessionParams(parameters);
|
||||
}
|
||||
protected NameValueCollection ExtractSessionParams(String encryptedParams)
|
||||
protected NameValueCollection ExtractSessionParams(string encryptedParams)
|
||||
{
|
||||
return DecryptParameters(encryptedParams, SessionData_Control.Base64IV_ControlApp, Base64Key_ControlApp);
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ using Sarand.Net.Standard.Base.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Models
|
||||
namespace Sarand.BusinessMgr.Web.Control.Components
|
||||
{
|
||||
//=======================================================================
|
||||
public class SbmModel_Control : SbmModel_Base
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Account;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Account;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,8 +11,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers.Account
|
||||
{
|
||||
//======================================================================
|
||||
public partial class UserAccountController : SbmController_Control
|
||||
//======================================================================
|
||||
public partial class UserAccountController : SbmController_Control
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Consoles;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Consoles;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Consoles;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Instance;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Param;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Models.Param;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers.Param
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Control.Models;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Controllers
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Models.Instance
|
||||
|
||||
@@ -3,6 +3,7 @@ using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -3,6 +3,7 @@ using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -5,6 +5,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.BusinessMgr.Web.Control.Consoles;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Control.Models
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_Home : SbmModel_Control
|
||||
//=======================================================================
|
||||
public class Model_Home : SbmModel_Control
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.Helpers;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Control.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.CodeTypes;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Control\Controllers\NewFolder\" />
|
||||
<Folder Include="Control\Controllers\System\" />
|
||||
<Folder Include="Views\Security\" />
|
||||
</ItemGroup>
|
||||
@@ -35,6 +36,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.Machine.Sarand602.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Update="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@using Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
@using Sarand.BusinessMgr.Net.Core.Web.App
|
||||
@using Sarand.BusinessMgr.Web.Control
|
||||
@using Sarand.BusinessMgr.Web.Control.Components
|
||||
@using Sarand.BusinessMgr.Web.Control.Models
|
||||
@using Sarand.BusinessMgr.Web.Control.Models.Account
|
||||
@using Sarand.BusinessMgr.Web.Control.Models.Instance
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"EmailConfigs": {
|
||||
"SBM-Dev": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Configs": {
|
||||
"SBM-Dev": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"AppConfigs": {
|
||||
"BusMgr-Ctrl": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "Prod",
|
||||
"ControlDatabase": {
|
||||
"Location": "MsSql:.\\BusMgr.SaBusinessMgr_Control",
|
||||
"User": "bmc",
|
||||
"Password": "sarand"
|
||||
},
|
||||
"TemplateDatabase": {
|
||||
"Location": "MsSql:.\\BusMgr.SaBusinessMgr_Template",
|
||||
"User": "busmgr",
|
||||
"Password": "sapphire"
|
||||
},
|
||||
"Email": {
|
||||
"Configs": [],
|
||||
"Context": "SBC",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [ "contact@BusMgr.Sarand.com" ]
|
||||
}
|
||||
},
|
||||
"Documents": {
|
||||
"RootFolder": "C:\\Sarand\\BusinessMgr\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "C:\\Sarand\\BusinessMgr\\Log\\WebControl"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
{
|
||||
"EmailConfigs": {
|
||||
"SBM-Prod": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
"Email": {
|
||||
"Configs": {
|
||||
"SBM-Prod": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.1",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ namespace Sarand.BusinessMgr.Web.Portal.App
|
||||
|
||||
// Application configuration.
|
||||
appConfigs = SbmAppConfigHelper.ExtractAppConfigs(SbmConfiguration.GetSection("AppConfigs"));
|
||||
emailConfigs = SbmEmailConfigHelper.ExtractEmailConfigs(SbmConfiguration.GetSection("EmailConfigs"));
|
||||
emailConfigs = SbmEmailConfigHelper.ExtractEmailConfigs(SbmConfiguration.GetSection("Email/Configs"));
|
||||
LoggingRootFolder = AppConfig.Logging.RootFolder;
|
||||
|
||||
// Application instance.
|
||||
|
||||
@@ -4,7 +4,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Web.Portal.Controllers;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
|
||||
+37
-38
@@ -9,7 +9,6 @@ using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Web.Portal.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.CodeTypes;
|
||||
@@ -32,7 +31,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Components
|
||||
{
|
||||
//=======================================================================
|
||||
// Portal Controller - Utils.
|
||||
@@ -100,7 +99,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
/// <summary>
|
||||
/// Session data deserialisation.
|
||||
/// </summary>
|
||||
protected override SbmSessionData_Web DeserializeSessionData(String sessionDataJson)
|
||||
protected override SbmSessionData_Web DeserializeSessionData(string sessionDataJson)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<SbmSessionData_Portal>(sessionDataJson, SessionDataJsonDeserializerSettings);
|
||||
}
|
||||
@@ -120,7 +119,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
/// <para>- Open user session - store details against Sesion Data.</para>
|
||||
/// <para>- Set 'Keep logged in' cookie if required.</para>
|
||||
/// </summary>
|
||||
protected bool SignUserIn(SbmSessionData_Portal sessionDataForUser, SbmInternals internalsForUser, SaSecurityItem securityItemUser, SbmAffiliate affiliateUser, SbmAssociation associationOrganisation, SbmAffiliate affiliateOrganisation, bool keepLoggedIn, ref String errorMessage)
|
||||
protected bool SignUserIn(SbmSessionData_Portal sessionDataForUser, SbmInternals internalsForUser, SaSecurityItem securityItemUser, SbmAffiliate affiliateUser, SbmAssociation associationOrganisation, SbmAffiliate affiliateOrganisation, bool keepLoggedIn, ref string errorMessage)
|
||||
{
|
||||
string errorPrefix = $"Unable to sign account in";
|
||||
string errorSuffix = $"Context: {sessionDataForUser.RepositoryContext}. Email: {sessionDataForUser.UserEmailAddress}.";
|
||||
@@ -240,7 +239,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (StringUtil.IsBlank(sessionDataForUser.UserEmailAddress))
|
||||
if (sessionDataForUser.UserEmailAddress.IsBlank())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -311,10 +310,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
if (!AppConfig.Security.SignIn.KeepLoggedIn.Allowed) return false;
|
||||
|
||||
// Extract parameters and validate that they are populated.
|
||||
String encryptedParams = GetRequestCookie(KeepLoggedIn.CookieName);
|
||||
string encryptedParams = GetRequestCookie(KeepLoggedIn.CookieName);
|
||||
KeepLoggedInParams keepLoggedInParams = ExtractKeepLoggedInParams(encryptedParams);
|
||||
String logPrefix = $"{SysUtil.Fn} 'Keep Logged In' cookie found but ";
|
||||
String logSuffix = keepLoggedInParams.GetValidParams().Concat("", " ", ".");
|
||||
string logPrefix = $"{SysUtil.Fn} 'Keep Logged In' cookie found but ";
|
||||
string logSuffix = keepLoggedInParams.GetValidParams().Concat("", " ", ".");
|
||||
if (keepLoggedInParams.IsValid())
|
||||
{
|
||||
// Instance Repository configured on Control database identified by Context.
|
||||
@@ -338,7 +337,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
{
|
||||
// Bring the Session Data up to date with the session properties.
|
||||
sessionDataForUser.Refresh(securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation);
|
||||
String errorMessage = "";
|
||||
string errorMessage = "";
|
||||
if (SignUserIn(sessionDataForUser, internalsForUser, securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation, true, ref errorMessage))
|
||||
{
|
||||
// User auto-login successful.
|
||||
@@ -357,7 +356,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
}
|
||||
else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but no matching session contexts found." + logSuffix);
|
||||
}
|
||||
else if (!StringUtil.IsEmpty(encryptedParams))
|
||||
else if (!encryptedParams.IsEmpty())
|
||||
SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but with incomplete details." + logSuffix);
|
||||
ClearKeepLoggedInCookie();
|
||||
return false;
|
||||
@@ -367,7 +366,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
/// <summary>Keep-Logged-In cookie.</summary>
|
||||
protected void SetKeepLoggedInCookie()
|
||||
{
|
||||
String keepLoggedInCookieValue = GenerateKeepLoggedInCookieValue();
|
||||
string keepLoggedInCookieValue = GenerateKeepLoggedInCookieValue();
|
||||
int cookieExpiresDays = Math.Max(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Min, Math.Min(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Max, AppConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays));
|
||||
SetResponseCookie(KeepLoggedIn.CookieName, keepLoggedInCookieValue, DateTime.Now.AddDays(cookieExpiresDays), true);
|
||||
SaLogger.Debug($"{SysUtil.Fn} 'Keep Logged In' cookie set. Name: {KeepLoggedIn.CookieName}. Value: {keepLoggedInCookieValue}");
|
||||
@@ -376,7 +375,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
/// <summary>Set the 'Keep Logged In' response cookie to expired with no data.</summary>
|
||||
public void ClearKeepLoggedInCookie()
|
||||
{
|
||||
if (StringUtil.IsEmpty(GetRequestCookie(KeepLoggedIn.CookieName))) return;
|
||||
if (GetRequestCookie(KeepLoggedIn.CookieName).IsEmpty()) return;
|
||||
// Clear cookie by setting expiry date in the past.
|
||||
SetResponseCookie(KeepLoggedIn.CookieName, "", DateTime.Today.AddDays(-7), true);
|
||||
SaLogger.Debug($"{SysUtil.Fn} 'Keep Logged In' cookie cleared. Name: {KeepLoggedIn.CookieName}.");
|
||||
@@ -391,20 +390,20 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
// NB - 'Keep Logged In' is termed 'Remember Me' in the Portal application.
|
||||
public static class KeepLoggedIn
|
||||
{
|
||||
public static String CookieName = "sbprm";
|
||||
public static String Base64Key = SacsEncryptionHelper.EncodePlainKey("<=SaBusMgr^P0rt4L{KeepLoggedIn}~", SacsEncryptionHelper.KeyLength);
|
||||
public static string CookieName = "sbprm";
|
||||
public static string Base64Key = SacsEncryptionHelper.EncodePlainKey("<=SaBusMgr^P0rt4L{KeepLoggedIn}~", SacsEncryptionHelper.KeyLength);
|
||||
//private static String KeepLoggedIn.Base64IV_Generated = SacsEncryptionHelper.InitSymmetricEncryptionIV(KeepLoggedIn.Base64Key);
|
||||
public static String Base64IV = "m47AMcMgACp3aoQVc0Y92A==";
|
||||
public static string Base64IV = "m47AMcMgACp3aoQVc0Y92A==";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Keep-logged-in cookie value.
|
||||
private static readonly String ParamName_KeepLoggedIn_RepositoryContext = "rct";
|
||||
private static readonly String ParamName_KeepLoggedIn_EmailAddress = "ema";
|
||||
private static readonly String ParamName_KeepLoggedIn_SecurityItemId = "sii";
|
||||
private static readonly String ParamName_KeepLoggedIn_AffiliateIdUser = "afiu";
|
||||
private static readonly String ParamName_KeepLoggedIn_AssociationIdOrganisation = "asio";
|
||||
private String GenerateKeepLoggedInCookieValue()
|
||||
private static readonly string ParamName_KeepLoggedIn_RepositoryContext = "rct";
|
||||
private static readonly string ParamName_KeepLoggedIn_EmailAddress = "ema";
|
||||
private static readonly string ParamName_KeepLoggedIn_SecurityItemId = "sii";
|
||||
private static readonly string ParamName_KeepLoggedIn_AffiliateIdUser = "afiu";
|
||||
private static readonly string ParamName_KeepLoggedIn_AssociationIdOrganisation = "asio";
|
||||
private string GenerateKeepLoggedInCookieValue()
|
||||
{
|
||||
NameValueCollection keepLoggedInParams = new NameValueCollection();
|
||||
keepLoggedInParams.Add(ParamName_KeepLoggedIn_RepositoryContext, SessionData_Portal.RepositoryContext);
|
||||
@@ -418,18 +417,18 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
public class KeepLoggedInParams
|
||||
{
|
||||
public String RepositoryContext { get; set; }
|
||||
public String EmailAddress { get; set; }
|
||||
public string RepositoryContext { get; set; }
|
||||
public string EmailAddress { get; set; }
|
||||
public SysId SecurityItemId { get; set; }
|
||||
public SysId AffiliateIdUser { get; set; }
|
||||
public SysId AssociationIdOrganisation { get; set; }
|
||||
/// <summary>Retrieve the list of valid parameters in printable format [Name: Value].</summary>
|
||||
public List<String> GetValidParams()
|
||||
public List<string> GetValidParams()
|
||||
{
|
||||
List<String> values = new List<String>();
|
||||
if (!StringUtil.IsBlank(RepositoryContext))
|
||||
List<string> values = new List<string>();
|
||||
if (!RepositoryContext.IsBlank())
|
||||
values.Add("RepositoryContext: " + RepositoryContext);
|
||||
if (!StringUtil.IsBlank(EmailAddress))
|
||||
if (!EmailAddress.IsBlank())
|
||||
values.Add("EmailAddress: " + EmailAddress);
|
||||
if (SysId.IsValid(SecurityItemId))
|
||||
values.Add("SecurityItemId: " + SysId.ToString(SecurityItemId));
|
||||
@@ -443,17 +442,17 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
public bool IsValid()
|
||||
{
|
||||
return
|
||||
!StringUtil.IsBlank(RepositoryContext) &&
|
||||
!StringUtil.IsBlank(EmailAddress) &&
|
||||
!RepositoryContext.IsBlank() &&
|
||||
!EmailAddress.IsBlank() &&
|
||||
SysId.IsValid(SecurityItemId) &&
|
||||
SysId.IsValid(AffiliateIdUser) &&
|
||||
SysId.IsValid(AssociationIdOrganisation);
|
||||
}
|
||||
}
|
||||
public KeepLoggedInParams ExtractKeepLoggedInParams(String encryptedParams)
|
||||
public KeepLoggedInParams ExtractKeepLoggedInParams(string encryptedParams)
|
||||
{
|
||||
KeepLoggedInParams keepLoggedInParams = new KeepLoggedInParams();
|
||||
if (!StringUtil.IsEmpty(encryptedParams))
|
||||
if (!encryptedParams.IsEmpty())
|
||||
{
|
||||
NameValueCollection linkParams = DecryptParameters(encryptedParams, KeepLoggedIn.Base64IV, KeepLoggedIn.Base64Key);
|
||||
keepLoggedInParams.RepositoryContext = linkParams.Get(ParamName_KeepLoggedIn_RepositoryContext);
|
||||
@@ -470,16 +469,16 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
// Parameter encryption, eg. for images.
|
||||
//-------------------------------------------------------------------
|
||||
// Encryption key is the same for all users but a different IV value is generated for each session so that the links/parameters cannot be shared.
|
||||
public static String Base64Key_PortalApp { get; } = SacsEncryptionHelper.EncodePlainKey("{SaBusMgr=Portal-App#Encryption}", SacsEncryptionHelper.KeyLength);
|
||||
protected String EncryptPortalParams(NameValueCollection parameters)
|
||||
public static string Base64Key_PortalApp { get; } = SacsEncryptionHelper.EncodePlainKey("{SaBusMgr=Portal-App#Encryption}", SacsEncryptionHelper.KeyLength);
|
||||
protected string EncryptPortalParams(NameValueCollection parameters)
|
||||
{
|
||||
return HttpUtility.UrlEncode(EncryptParameters(parameters, SessionData_Portal.Base64IV_PortalApp, Base64Key_PortalApp));
|
||||
}
|
||||
public static String EncryptPortalParams(SbmController_Portal controller, NameValueCollection parameters)
|
||||
public static string EncryptPortalParams(SbmController_Portal controller, NameValueCollection parameters)
|
||||
{
|
||||
return controller.EncryptPortalParams(parameters);
|
||||
}
|
||||
protected NameValueCollection ExtractPortalParams(String encryptedParams)
|
||||
protected NameValueCollection ExtractPortalParams(string encryptedParams)
|
||||
{
|
||||
return DecryptParameters(encryptedParams, SessionData_Portal.Base64IV_PortalApp, Base64Key_PortalApp);
|
||||
}
|
||||
@@ -487,13 +486,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Logging.
|
||||
//-------------------------------------------------------------------
|
||||
protected String getLogSuffix()
|
||||
protected string getLogSuffix()
|
||||
{
|
||||
List<String> logSuffix = new List<string>();
|
||||
List<string> logSuffix = new List<string>();
|
||||
SbmSessionData_Portal sessionData = SessionData_Portal;
|
||||
if (sessionData != null)
|
||||
{
|
||||
if (!StringUtil.IsEmpty(sessionData.User.EmailAddress))
|
||||
if (!sessionData.User.EmailAddress.IsEmpty())
|
||||
logSuffix.Add("User: " + sessionData.User.EmailAddress);
|
||||
}
|
||||
return logSuffix.Concat("", " ", ".");
|
||||
+39
-39
@@ -22,7 +22,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Components
|
||||
{
|
||||
//=======================================================================
|
||||
public class SbmModel_Portal : SbmModel_Base
|
||||
@@ -50,17 +50,17 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
protected SbmSessionData_Portal SessionData_Portal { get { return SessionData_Web as SbmSessionData_Portal; } }
|
||||
public String OrganisationName { get { return SessionData_Portal?.Organisation?.DisplayName ?? ""; } }
|
||||
public string OrganisationName { get { return SessionData_Portal?.Organisation?.DisplayName ?? ""; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security profile.
|
||||
public bool UserCanViewFinancials() { return SessionData_Portal.SecurityProfile.UserCanViewFinancials(); }
|
||||
public bool UserCanViewCommodityFinancials_Supply() { return SessionData_Portal.SecurityProfile.UserCanViewFinancials(Sbm.FinancialType.CommoditySupply); }
|
||||
public bool UserCanViewCommodityFinancials_Sales() { return SessionData_Portal.SecurityProfile.UserCanViewFinancials(Sbm.FinancialType.CommoditySales); }
|
||||
public bool UserCanViewCommodityFinancials_Supply() { return SessionData_Portal.SecurityProfile.UserCanViewFinancials(FinancialType.CommoditySupply); }
|
||||
public bool UserCanViewCommodityFinancials_Sales() { return SessionData_Portal.SecurityProfile.UserCanViewFinancials(FinancialType.CommoditySales); }
|
||||
public bool UserCanUpdateFinancials() { return SessionData_Portal.SecurityProfile.UserCanUpdateFinancials(); }
|
||||
public bool UserCanStockTake() { return SessionData_Portal.SecurityProfile.UserHasSecurityRight(Sbm.SecurityRight.StockTake); }
|
||||
public bool UserCanCreateItem(Sbm.ItemType itemType) { return SessionData_Portal.SecurityProfile.UserCanCreateItemType(itemType); }
|
||||
public bool UserCanUpdateItem(Sbm.ItemType itemType) { return SessionData_Portal.SecurityProfile.UserCanUpdateItemType(itemType); }
|
||||
public bool UserCanStockTake() { return SessionData_Portal.SecurityProfile.UserHasSecurityRight(SecurityRight.StockTake); }
|
||||
public bool UserCanCreateItem(ItemType itemType) { return SessionData_Portal.SecurityProfile.UserCanCreateItemType(itemType); }
|
||||
public bool UserCanUpdateItem(ItemType itemType) { return SessionData_Portal.SecurityProfile.UserCanUpdateItemType(itemType); }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Business components.
|
||||
@@ -90,19 +90,19 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
protected SbmStockControlConfig StockControlConfig { get { return Internals.StockControlConfig; } }
|
||||
protected SbmRequirementCostingConfig RequirementCostingConfig { get { return Internals.RequirementCostingConfig; } }
|
||||
// System codes.
|
||||
protected List<TypeCodeDesc> GetCodesOfType(Sbm.SystemCode systemCode) { return Internals.GetSystemCodes(systemCode); }
|
||||
protected List<TypeCodeDesc> GetCodesOfType(SystemCode systemCode) { return Internals.GetSystemCodes(systemCode); }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Page menu options.
|
||||
|
||||
public class MenuOptionData
|
||||
{
|
||||
public String Caption { get; set; }
|
||||
public String Page { get; set; }
|
||||
public string Caption { get; set; }
|
||||
public string Page { get; set; }
|
||||
}
|
||||
public class MenuItemData
|
||||
{
|
||||
public String Caption { get; set; }
|
||||
public string Caption { get; set; }
|
||||
public List<MenuOptionData> Options { get; } = new List<MenuOptionData>();
|
||||
}
|
||||
public class MenuData
|
||||
@@ -122,7 +122,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
|
||||
// Contacts.
|
||||
MenuItemData contactsItem = new MenuItemData() { Caption = @Localiser["label.contacts"] };
|
||||
if (SessionConsole.AllowOption(Sbm.ConfigOption.Contacts))
|
||||
if (SessionConsole.AllowOption(ConfigOption.Contacts))
|
||||
{
|
||||
contactsItem.Options.Add(new MenuOptionData() { Caption = @Localiser["label.contacts"], Page = "Contacts" });
|
||||
contactsItem.Options.Add(new MenuOptionData() { Caption = @Localiser["label.customers"], Page = "Customers" });
|
||||
@@ -134,13 +134,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
|
||||
// Commodities.
|
||||
MenuItemData commoditiesItem = new MenuItemData() { Caption = @Localiser["label.commodities"] };
|
||||
if (SessionConsole.AllowOption(Sbm.ConfigOption.Commodities))
|
||||
if (SessionConsole.AllowOption(ConfigOption.Commodities))
|
||||
commoditiesItem.Options.Add(new MenuOptionData() { Caption = @Localiser["label.commodities"], Page = "Commodity" });
|
||||
if (SessionConsole.AllowOption(Sbm.ConfigOption.Assets))
|
||||
if (SessionConsole.AllowOption(ConfigOption.Assets))
|
||||
{
|
||||
commoditiesItem.Options.Add(new MenuOptionData() { Caption = @Localiser["caption.asset.categories"], Page = "Assets/AssetCategory" });
|
||||
commoditiesItem.Options.Add(new MenuOptionData() { Caption = @Localiser["label.assets"], Page = "Assets/Asset" });
|
||||
if (SessionConsole.AllowOption(Sbm.ConfigOption.Vehicles))
|
||||
if (SessionConsole.AllowOption(ConfigOption.Vehicles))
|
||||
{
|
||||
commoditiesItem.Options.Add(new MenuOptionData() { Caption = @Localiser["caption.vehicle.classes"], Page = "Vehicles/VehicleClass" });
|
||||
commoditiesItem.Options.Add(new MenuOptionData() { Caption = @Localiser["label.vehicles"], Page = "Vehicles/Vehicle" });
|
||||
@@ -175,7 +175,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
}
|
||||
|
||||
/// <summary>List of Code Type Codes for dropdown.</summary>
|
||||
public IEnumerable<SelectListItem> GetCodeTypeCodesForSelect(Sbm.ApplCodeType codeType, bool activeOnly = true)
|
||||
public IEnumerable<SelectListItem> GetCodeTypeCodesForSelect(ApplCodeType codeType, bool activeOnly = true)
|
||||
{
|
||||
List<CodeDesc> codes = new List<CodeDesc>();
|
||||
foreach (SaCode code in CodeTypeConsole.GetCodesForCodeType(SbmSystem.GetCodeTypeCode(codeType), activeOnly))
|
||||
@@ -192,10 +192,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
/// </summary>
|
||||
public IEnumerable<SelectListItem> GetAffiliateTypeCodesForFilterDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> affiliateTypes = GetCodesOfType(Sbm.SystemCode.AffiliateType);
|
||||
if (!affiliateTypes.Any(item => item.Type == (int)Sbm.AffiliateType.AnyOrganisation))
|
||||
affiliateTypes.Insert(0, new TypeCodeDesc((int)Sbm.AffiliateType.AnyOrganisation, ((short)Sbm.AffiliateType.AnyOrganisation).ToString(), Localiser["label.organisation"]));
|
||||
affiliateTypes.Insert(0, Sbm.AffiliateType.Any, "", Localiser["label.any"]);
|
||||
List<TypeCodeDesc> affiliateTypes = GetCodesOfType(SystemCode.AffiliateType);
|
||||
if (!affiliateTypes.Any(item => item.Type == (int)AffiliateType.AnyOrganisation))
|
||||
affiliateTypes.Insert(0, new TypeCodeDesc((int)AffiliateType.AnyOrganisation, ((short)AffiliateType.AnyOrganisation).ToString(), Localiser["label.organisation"]));
|
||||
affiliateTypes.Insert(0, AffiliateType.Any, "", Localiser["label.any"]);
|
||||
return new SelectList(affiliateTypes, "Code", "Desc");
|
||||
}
|
||||
|
||||
@@ -205,10 +205,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
/// </summary>
|
||||
public IEnumerable<SelectListItem> GetAssociationTypeCodesForFilterDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> associationTypes = GetCodesOfType(Sbm.SystemCode.AssociationType);
|
||||
associationTypes.Insert(0, Sbm.AssociationType.Any, "", Localiser["label.any"]);
|
||||
associationTypes.RemoveAll(item => item.Type == (short)Sbm.AssociationType.Internal);
|
||||
foreach (Sbm.AssociationType associationType in EnumUtil.GetValues<Sbm.AssociationType>())
|
||||
List<TypeCodeDesc> associationTypes = GetCodesOfType(SystemCode.AssociationType);
|
||||
associationTypes.Insert(0, AssociationType.Any, "", Localiser["label.any"]);
|
||||
associationTypes.RemoveAll(item => item.Type == (short)AssociationType.Internal);
|
||||
foreach (AssociationType associationType in EnumUtil.GetValues<AssociationType>())
|
||||
{
|
||||
if (!SessionConsole.AllowAssociationType(associationType))
|
||||
associationTypes.RemoveAll(item => item.Type == (short)associationType);
|
||||
@@ -225,10 +225,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetCommodityTypeCodesForFilterDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> commodityTypes = new List<TypeCodeDesc>();
|
||||
commodityTypes.Add(Sbm.CommodityType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc commodityType in GetCodesOfType(Sbm.SystemCode.CommodityType))
|
||||
commodityTypes.Add(CommodityType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc commodityType in GetCodesOfType(SystemCode.CommodityType))
|
||||
{
|
||||
if (commodityType.Type == (int)Sbm.CommodityType.Asset && !SessionConsole.AllowOption(Sbm.ConfigOption.Assets)) continue;
|
||||
if (commodityType.Type == (int)CommodityType.Asset && !SessionConsole.AllowOption(ConfigOption.Assets)) continue;
|
||||
commodityTypes.Add(commodityType);
|
||||
}
|
||||
return new SelectList(commodityTypes, "Code", "Desc");
|
||||
@@ -240,9 +240,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetCommodityTypeCodesForDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> commodityTypes = new List<TypeCodeDesc>();
|
||||
foreach (TypeCodeDesc commodityType in GetCodesOfType(Sbm.SystemCode.CommodityType))
|
||||
foreach (TypeCodeDesc commodityType in GetCodesOfType(SystemCode.CommodityType))
|
||||
{
|
||||
if (commodityType.Type == (int)Sbm.CommodityType.Asset && !SessionConsole.AllowOption(Sbm.ConfigOption.Assets)) continue;
|
||||
if (commodityType.Type == (int)CommodityType.Asset && !SessionConsole.AllowOption(ConfigOption.Assets)) continue;
|
||||
commodityTypes.Add(commodityType);
|
||||
}
|
||||
return new SelectList(commodityTypes, "Code", "Desc");
|
||||
@@ -254,8 +254,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetAssetTypeCodesForFilterDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> assetTypes = new List<TypeCodeDesc>();
|
||||
assetTypes.Add(Sbm.AssetType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc assetType in GetCodesOfType(Sbm.SystemCode.AssetType))
|
||||
assetTypes.Add(AssetType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc assetType in GetCodesOfType(SystemCode.AssetType))
|
||||
{
|
||||
assetTypes.Add(assetType);
|
||||
}
|
||||
@@ -268,7 +268,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetAssetTypeCodesForDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> assetTypes = new List<TypeCodeDesc>();
|
||||
foreach (TypeCodeDesc assetType in GetCodesOfType(Sbm.SystemCode.AssetType))
|
||||
foreach (TypeCodeDesc assetType in GetCodesOfType(SystemCode.AssetType))
|
||||
{
|
||||
assetTypes.Add(assetType);
|
||||
}
|
||||
@@ -284,11 +284,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetTransactionTypeCodesForFilterDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> transactionTypes = new List<TypeCodeDesc>();
|
||||
transactionTypes.Add(Sbm.TransactionType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc transactionType in GetCodesOfType(Sbm.SystemCode.TransactionType))
|
||||
transactionTypes.Add(TransactionType.Any, "", Localiser["label.any"]);
|
||||
foreach (TypeCodeDesc transactionType in GetCodesOfType(SystemCode.TransactionType))
|
||||
{
|
||||
if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)transactionType.Type)) continue;
|
||||
String description = SessionConsole.GetOwnerOption_Caption(Sbm.TransTypeToOrgOption((Sbm.TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((Sbm.TransactionType)transactionType.Type));
|
||||
if (!SessionConsole.AllowTransactionType((TransactionType)transactionType.Type)) continue;
|
||||
string description = SessionConsole.GetOwnerOption_Caption(TransTypeToOrgOption((TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((TransactionType)transactionType.Type));
|
||||
transactionTypes.Add(transactionType.Type, transactionType.Code, description);
|
||||
}
|
||||
return new SelectList(transactionTypes, "Code", "Desc");
|
||||
@@ -300,10 +300,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
public IEnumerable<SelectListItem> GetTransactionTypeCodesForDropdown()
|
||||
{
|
||||
List<TypeCodeDesc> transactionTypes = new List<TypeCodeDesc>();
|
||||
foreach (TypeCodeDesc transactionType in GetCodesOfType(Sbm.SystemCode.TransactionType))
|
||||
foreach (TypeCodeDesc transactionType in GetCodesOfType(SystemCode.TransactionType))
|
||||
{
|
||||
if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)transactionType.Type)) continue;
|
||||
String description = SessionConsole.GetOwnerOption_Caption(Sbm.TransTypeToOrgOption((Sbm.TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((Sbm.TransactionType)transactionType.Type));
|
||||
if (!SessionConsole.AllowTransactionType((TransactionType)transactionType.Type)) continue;
|
||||
string description = SessionConsole.GetOwnerOption_Caption(TransTypeToOrgOption((TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((TransactionType)transactionType.Type));
|
||||
transactionTypes.Add(transactionType.Type, transactionType.Code, description);
|
||||
}
|
||||
return new SelectList(transactionTypes, "Code", "Desc");
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Commodities;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using System;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using System;
|
||||
|
||||
@@ -3,7 +3,7 @@ using NPOI.OpenXmlFormats.Dml.Diagram;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Codes;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Codes;
|
||||
using System;
|
||||
|
||||
@@ -3,7 +3,7 @@ using NPOI.SS.Formula.Functions;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Codes;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Assets;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Codes;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Commodities;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
|
||||
@@ -15,11 +15,12 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Commodities;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class CommodityController : SbmController_Portal
|
||||
//=======================================================================
|
||||
public partial class CommodityController : SbmController_Portal
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.OpenXmlFormats.Dml.Diagram;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -16,6 +16,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using DocumentFormat.OpenXml.ExtendedProperties;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts
|
||||
{
|
||||
|
||||
@@ -15,11 +15,12 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
public class HomeController : SbmController_Portal
|
||||
//=======================================================================
|
||||
public class HomeController : SbmController_Portal
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
@@ -6,6 +6,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Web.Portal.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
|
||||
@@ -18,6 +18,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Portal.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Transactions;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
@@ -13,6 +12,7 @@ using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Sacs.Web.Components.SaController.AjaxResponse_Data;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
{
|
||||
|
||||
@@ -15,11 +15,12 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Transactions;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class TransactionController : SbmController_Portal
|
||||
//=======================================================================
|
||||
public partial class TransactionController : SbmController_Portal
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Vehicles;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Vehicles;
|
||||
using System;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.CodeTypes;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.CodeTypes;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Models
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.Helpers;
|
||||
using Sarand.Net.Standard.Base.Security;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@using Sarand.BusinessMgr.Net.Core.Web.App
|
||||
@using Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
@using Sarand.BusinessMgr.Web.Portal.Components
|
||||
@using Sarand.BusinessMgr.Web.Portal.Models
|
||||
@using Sarand.BusinessMgr.Web.Portal.Models.Contacts
|
||||
@using Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"EmailConfigs": {
|
||||
"SBM-Dev": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apPh1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Configs": {
|
||||
"SBM-Dev": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apPh1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"AppConfigs": {
|
||||
"BusMgr": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "Prod",
|
||||
"ControlDatabase": {
|
||||
"Location": "MsSql:.\\BusMgr.SaBusinessMgr_Control",
|
||||
"User": "bmc",
|
||||
"Password": "sarand"
|
||||
},
|
||||
"Email": {
|
||||
"Configs": [],
|
||||
"Context": "SBM-Dev",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [ "Control@BusMgr.Sarand.com" ]
|
||||
}
|
||||
},
|
||||
"Documents": {
|
||||
"RootFolder": "D:\\Sarand\\Projects\\Users\\AHoward\\VS2022\\BusinessMgr\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "D:\\Sarand\\Projects\\Users\\AHoward\\VS2022\\BusinessMgr\\Logs\\WebPortal"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
{
|
||||
"EmailConfigs": {
|
||||
"SBM-Prod": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
"Email": {
|
||||
"Configs": {
|
||||
"SBM-Prod": {
|
||||
"SMTP": {
|
||||
"Server": "smtp.ionos.co.uk",
|
||||
"ServerPort": 587,
|
||||
"UseSSL": true
|
||||
},
|
||||
"Send": {
|
||||
"Using": 2,
|
||||
"UserName": "businessmgr@sarand.com",
|
||||
"Password": "sarand-busmgr-5apP1re"
|
||||
},
|
||||
"Message": {
|
||||
"AddressFrom": "DoNotReply@SaBusinessMgr.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user