3.0.0.6 Main page layouts. Demo account registration.
This commit is contained in:
@@ -336,8 +336,8 @@
|
||||
<data name="msg.item.deleted" xml:space="preserve">
|
||||
<value>Item deleted.</value>
|
||||
</data>
|
||||
<data name="msg.item.removed" xml:space="preserve">
|
||||
<value>Item removed.</value>
|
||||
<data name="msg.item.updated" xml:space="preserve">
|
||||
<value>Item updated.</value>
|
||||
</data>
|
||||
<data name="msg.item.updated" xml:space="preserve">
|
||||
<value>Item updated.</value>
|
||||
@@ -720,11 +720,11 @@
|
||||
<data name="label.count" xml:space="preserve">
|
||||
<value>Count</value>
|
||||
</data>
|
||||
<data name="caption.register.demo.account" xml:space="preserve">
|
||||
<value>Register Demo Account</value>
|
||||
<data name="caption.demo.account.register" xml:space="preserve">
|
||||
<value>Demo Account Registration</value>
|
||||
</data>
|
||||
<data name="caption.request.demo.account" xml:space="preserve">
|
||||
<value>Request Demo Account</value>
|
||||
<data name="caption.demo.account.request" xml:space="preserve">
|
||||
<value>Demo Account Request</value>
|
||||
</data>
|
||||
<data name="label.register" xml:space="preserve">
|
||||
<value>Register</value>
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
public IActionResult Ajax_DemoAccountRequest(Model_Demo model)
|
||||
{
|
||||
AjaxResponse_DemoAccountRequest responseData = new AjaxResponse_DemoAccountRequest(model);
|
||||
String messageTitle = Localiser["caption.request.demo.account"];
|
||||
String messageTitle = Localiser["caption.demo.account.request"];
|
||||
|
||||
// Validate session and referrer.
|
||||
if (ValidUserSession) return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
@@ -59,6 +59,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
if (accountRegistration == null)
|
||||
{
|
||||
accountRegistration = ControlAccountMgr.CreateAccountRegistration(model.EmailAddress, Guid.NewGuid());
|
||||
accountRegistration.RepositoryContext = Sbm.RepositoryContext_Demo;
|
||||
if (!ControlAccountMgr.InsertAccountRegistration(accountRegistration, new DbUpdateInfo(null, "Registration", SacsSystem.ComputerName)))
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to insert Account Registration - {ControlAccountMgr.ErrorStateMessage.TrimEnd('.')}.");
|
||||
@@ -83,7 +84,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
SaEmailData emailData = new SaEmailData();
|
||||
emailData.Config = App.EmailConfig;
|
||||
emailData.AddressesTo.Add(model.EmailAddress);
|
||||
emailData.Subject = $"BusinessMgr - {Localiser["caption.register.demo.account"]}";
|
||||
emailData.Subject = $"BusinessMgr - {Localiser["caption.demo.account.request"]}";
|
||||
emailData.MessageBody = SbmResourceHelper.GetResourceText(SbmResourceHelper.TextResource.Email_DemoAccountRequest_Html);
|
||||
emailData.HtmlBody = true;
|
||||
emailConsole.ReplaceDynamicEmailBodyTags(emailData, null);
|
||||
@@ -116,7 +117,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
public IActionResult Ajax_DemoAccountRegister(Model_Demo model)
|
||||
{
|
||||
AjaxResponse_DemoAccountRegister responseData = new AjaxResponse_DemoAccountRegister(model);
|
||||
String messageTitle = Localiser["caption.register.demo.account"];
|
||||
String messageTitle = Localiser["caption.demo.account.register"];
|
||||
|
||||
// Validate session and referrer.
|
||||
if (ValidUserSession) return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
@@ -187,7 +188,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Create User Account.
|
||||
|
||||
// Check that User Account doesn't already exist.
|
||||
SbmRepositoryPopulationData.UserAccount userAccount = new UserAccount()
|
||||
{
|
||||
AffiliateIdOwner = demoData.AffiliateIdOrganisation,
|
||||
@@ -199,6 +201,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
Password = model.Password,
|
||||
SecurityGroupCode = demoInstanceConsole.GetSecurityGroupCode(Net.Standard.Base.Core.ISbmDemoInstanceConsole.SecurityGroup.Standard)
|
||||
};
|
||||
if (demoInstanceConsole.UserAccountExists(userAccount))
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Demo User Account already exists. {model.EmailAddress}.");
|
||||
return Json(responseData.SetControlError(Model_Demo.GetFieldName(Model_Demo.ItemField.EmailAddress), Localiser["msg.validation.duplicate.value"]));
|
||||
}
|
||||
|
||||
// Create User Account.
|
||||
if (!SysId.IsValid(userAccount.AffiliateIdOwner))
|
||||
{
|
||||
// Owner Affiliate Id not populated as Demo Repository previously initlialised.
|
||||
@@ -216,6 +225,18 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Update Account Registration details.
|
||||
accountRegistration.FirstName = model.FirstName;
|
||||
accountRegistration.LastName = model.LastName;
|
||||
accountRegistration.RegisterAccountAt = DateTime.Now;
|
||||
accountRegistration.Status = SaStatus.Completed;
|
||||
if (!ControlAccountMgr.UpdateAccountRegistration(accountRegistration, DbUpdateInfo))
|
||||
{
|
||||
// Not critical but log problem.
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to update Account Registration. {ControlAccountMgr.ErrorStateMessage.TrimEnd('.')}.");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Construct email.
|
||||
SbmEmailConsole emailConsole = SbmApplication_Portal.Instance.CreateEmailConsole();
|
||||
@@ -224,7 +245,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home
|
||||
SaEmailData emailData = new SaEmailData();
|
||||
emailData.Config = App.EmailConfig;
|
||||
emailData.AddressesTo.Add(model.EmailAddress);
|
||||
emailData.Subject = $"BusinessMgr - {Localiser["caption.register.demo.account"]}";
|
||||
emailData.Subject = $"BusinessMgr - {Localiser["caption.demo.account.register"]}";
|
||||
emailData.MessageBody = SbmResourceHelper.GetResourceText(SbmResourceHelper.TextResource.Email_DemoAccountRegister_Html);
|
||||
emailData.HtmlBody = true;
|
||||
emailConsole.ReplaceDynamicEmailBodyTags(emailData, null);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div class="sbm-panel-form DemoRegister">
|
||||
|
||||
<div class="sbm-header"><div class="sbm-caption">@Localiser["caption.register.demo.account"]</div></div>
|
||||
<div class="sbm-header"><div class="sbm-caption">@Localiser["caption.demo.account.register"]</div></div>
|
||||
|
||||
<div class="sbm-content" style="max-height:none;">
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div class="sbm-panel-form DemoRequest">
|
||||
|
||||
<div class="sbm-header"><div class="sbm-caption">@Localiser["caption.request.demo.account"]</div></div>
|
||||
<div class="sbm-header"><div class="sbm-caption">@Localiser["caption.demo.account.request"]</div></div>
|
||||
|
||||
<div class="sbm-content" style="max-height:none;">
|
||||
|
||||
|
||||
@@ -161,12 +161,21 @@ ul.nav.sbm-burger .dropdown:hover
|
||||
opacity: .75;
|
||||
}
|
||||
|
||||
.navbar-light .navbar-toggler-icon {
|
||||
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(0, 0, 0, 0.8)' stroke-width='4' stroke-linecap='round' stroke-miterlimit='10' d='M4 6h22M4 14h22M4 22h22'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
ul.nav.sbm-burger.navbar-light .dropdown:hover
|
||||
{
|
||||
background-color: #f8f8f8;
|
||||
border-color: #606060;
|
||||
}
|
||||
|
||||
ul.nav.sbm-burger.navbar-dark .navbar-toggler-icon
|
||||
{
|
||||
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 1.0)' stroke-width='4' stroke-linecap='round' stroke-miterlimit='10' d='M4 6h22M4 14h22M4 22h22'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
ul.nav.sbm-burger.navbar-dark .dropdown:hover
|
||||
{
|
||||
border-color: #c0c0c0;
|
||||
|
||||
@@ -34,12 +34,12 @@ body
|
||||
{
|
||||
html
|
||||
{
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body.sbm-layout-flex
|
||||
{
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -259,10 +259,9 @@ a:focus
|
||||
{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
top: 7px;
|
||||
right: 48px;
|
||||
min-width: 180px;
|
||||
margin-top: 6px;
|
||||
z-index: 1000;
|
||||
border: 1px solid #808080;
|
||||
border-bottom-left-radius: 4px;
|
||||
|
||||
+10316
-7446
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user