Asset Categories

This commit is contained in:
Andy Howard
2025-01-27 10:01:32 +00:00
parent 03b3a81dab
commit a3ac029d55
130 changed files with 1809 additions and 1423 deletions
@@ -2,14 +2,17 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Consoles;
using Sarand.BusinessMgr.Web.Control.Consoles;
using Sarand.BusinessMgr.Net.Core.Web.Helpers;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control;
using Sarand.BusinessMgr.Net.Standard.Dbas.App;
using Sarand.BusinessMgr.Net.Standard.Dbas.Utils;
using Sarand.BusinessMgr.Web.Control.Consoles;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.IO;
@@ -18,14 +21,6 @@ using Sarand.Net.Standard.Dbas.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sarand.Net.Standard.Base.ReferenceData;
using Sarand.Net.Standard.Base.Bus;
using static Sarand.Net.Standard.Dbas.Base.SacsDatabaseConsole;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control;
using Sarand.Net.Standard.Base.Security;
using Sarand.BusinessMgr.Net.Standard.Dbas.App;
namespace Sarand.BusinessMgr.Web.Control.App
{
@@ -1,20 +1,14 @@
using Sarand.BusinessMgr.Net.Core.Web.App;
using Newtonsoft.Json;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Security;
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm.Config.Database;
using System.Collections.Generic;
using System;
using Newtonsoft.Json;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.BusinessMgr.Web.Control.Controllers;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Utils;
using DocumentFormat.OpenXml.Wordprocessing;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.BusinessMgr.Web.Control.Controllers;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Utils;
using System;
namespace Sarand.BusinessMgr.Web.Control.App
{
@@ -1,8 +1,5 @@
using Newtonsoft.Json.Serialization;
using NPOI.SS.Formula.Functions;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Consoles;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.BusinessMgr.Web.Control.Consoles;
@@ -17,7 +14,6 @@ using Sarand.Net.Standard.Base.ReferenceData;
using Sarand.Net.Standard.Base.Security;
using Sarand.Net.Standard.Base.UpdateLog;
using System;
using static Sarand.BusinessMgr.Net.Core.Web.App.SbmAppConfig;
namespace Sarand.BusinessMgr.Web.Control.App
{
@@ -86,7 +82,7 @@ namespace Sarand.BusinessMgr.Web.Control.App
public override SaReferenceDataConsole CreateReferenceDataConsole(ISbmUserOrganisationContext userContext)
{
throw new NotImplementedException();
return new SbmReferenceDataConsole_Control(userContext);
}
public override SbmEmailConsole CreateEmailConsole(ISbmUserOrganisationContext userContext, SbmEmailConfig emailConfig)
@@ -0,0 +1,33 @@
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.BusinessMgr.Net.Standard.Dbas.Consoles;
namespace Sarand.BusinessMgr.Web.Control.Consoles
{
//=======================================================================
public class SbmReferenceDataConsole_Control : SbmReferenceDataConsole_Dbas
{
//-------------------------------------------------------------------
// Data members.
//private SaUpdateLogConsole updateLogConsole;
//-------------------------------------------------------------------
// Construction.
public SbmReferenceDataConsole_Control(ISbmUserOrganisationContext userContext) :
base(userContext)
{
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -8,10 +8,8 @@ using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Utils;
using Sarand.Net.Standard.Dbas.Base;
using System;
using System.Collections.Generic;
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm.Config.Security;
namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
{
@@ -1,6 +1,4 @@
using DocumentFormat.OpenXml.InkML;
using DocumentFormat.OpenXml.Wordprocessing;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Web.Control.Models;
using Sarand.BusinessMgr.Web.Control.Models.Param;
@@ -11,7 +9,6 @@ using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Utils;
using System;
using System.Collections.Generic;
using static Sarand.BusinessMgr.Net.Standard.Base.App.SbmSysParamCache;
namespace Sarand.BusinessMgr.Web.Control.Controllers.Param
{
@@ -1,6 +1,6 @@
using Newtonsoft.Json;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
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.Net.Standard.Base.Consoles;
@@ -56,7 +56,6 @@ 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; } }
public override ISbmUserOrganisationContext UserContext_Core => throw new NotImplementedException();
protected override SbmSessionData_Web DeserializeSessionData(String sessionDataJson)
{
return JsonConvert.DeserializeObject<SbmSessionData_Control>(sessionDataJson, SessionDataJsonDeserializerSettings);
@@ -1,21 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions;
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Web.Control.Helpers;
using Sarand.BusinessMgr.Web.Control.Models;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Email;
using Sarand.Net.Standard.Base.Helpers;
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm.Config.Security.SignIn;
using Sarand.Net.Standard.Base.Utils;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web;
using System;
using Sarand.Net.Standard.Base.Utils;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Web.Control.Models;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Web.Control.Helpers;
namespace Sarand.BusinessMgr.Web.Control.Controllers
{
@@ -133,7 +130,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers
}
}
if (userAccount == null && !responseData.HasControlErrors())
responseData.SetControlError(nameof(model.EmailAddress), model.Localiser["security.msg.signin.invalid"]);
responseData.SetControlError(nameof(model.EmailAddress), Localiser["security.msg.signin.invalid"]);
}
return userAccount;
}
@@ -1,6 +1,4 @@
using DocumentFormat.OpenXml.Spreadsheet;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.Net.Standard.Base.App;
@@ -9,12 +7,11 @@ using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Utils;
using System;
using System.Diagnostics.Contracts;
namespace Sarand.BusinessMgr.Web.Control.Models.Account
{
//=======================================================================
public class Model_UserAccount : SbmModel_Control
//=======================================================================
public class Model_UserAccount : SbmModel_Control
{
//-------------------------------------------------------------------
// Construction.
@@ -1,6 +1,6 @@
using DocumentFormat.OpenXml.Spreadsheet;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
using Sarand.BusinessMgr.Net.Core.Web.Components;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.Net.Standard.Base.App;
@@ -1,6 +1,6 @@
using DocumentFormat.OpenXml.Spreadsheet;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
using Sarand.BusinessMgr.Net.Core.Web.Components;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.Net.Standard.Base.App;
@@ -1,7 +1,7 @@
using DocumentFormat.OpenXml.Spreadsheet;
using NPOI.OpenXml4Net.Exceptions;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
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;
@@ -1,4 +1,5 @@
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
namespace Sarand.BusinessMgr.Web.Control.Models
{
@@ -12,7 +13,34 @@ namespace Sarand.BusinessMgr.Web.Control.Models
{
}
//-------------------------------------------------------------------
}
//=======================================================================
//-------------------------------------------------------------------
// Home page statictics.
public long GetUserAccountCount()
{
SbmcUserAccount.Params prmUserAccount = new SbmcUserAccount.Params();
prmUserAccount.StatusCat = SbmcUserAccount.StatusCat.NotDeleted;
return ControlAccountMgr.GetUserAccountCount(prmUserAccount);
}
public long GetOwnerCount()
{
SbmcOwner.Params prmOwner = new SbmcOwner.Params();
prmOwner.StatusCat = SbmcOwner.StatusCat.NotDeleted;
return ControlInstanceMgr.GetOwnerCount(prmOwner);
}
public long GetRepositoryCount()
{
SbmcRepository.Params prmRepository = new SbmcRepository.Params();
prmRepository.StatusCat = SbmcRepository.StatusCat.NotDeleted;
return ControlInstanceMgr.GetRepositoryCount(prmRepository);
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -1,5 +1,5 @@
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
using Sarand.BusinessMgr.Net.Core.Web.Components;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Helpers;
@@ -8,8 +8,8 @@ using System;
namespace Sarand.BusinessMgr.Web.Control.Models
{
//=======================================================================
public class Model_Security : SbmModel_Control
//=======================================================================
public class Model_Security : SbmModel_Control
{
//-------------------------------------------------------------------
// Construction.
@@ -1,19 +1,14 @@
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Spreadsheet;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Rendering;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Controllers;
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.CodeTypes;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Utils;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
namespace Sarand.BusinessMgr.Web.Control.Models.Param
{
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc.Rendering;
using Sarand.BusinessMgr.Net.Core.Web.App;
using Sarand.BusinessMgr.Net.Core.Web.Models;
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.Net.Standard.Base.Core;
@@ -24,8 +24,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models
//-------------------------------------------------------------------
// Properties.
protected SbmApplication_Control App_Control { get { return SbmApplication_Control.Instance; } }
public SbmSessionData_Control SessionData_Control { get { return SessionData as SbmSessionData_Control; } }
public override ISbmUserOrganisationContext UserContext_Core => throw new NotImplementedException();
protected SbmSessionData_Control SessionData_Control { get { return SessionData_Web as SbmSessionData_Control; } }
//-------------------------------------------------------------------
public IEnumerable<SelectListItem> GetInstanceContextsForSelect()
@@ -459,4 +459,16 @@
<data name="caption.vehicle.create" xml:space="preserve">
<value>Create Vehicle</value>
</data>
<data name="label.active" xml:space="preserve">
<value>Active</value>
</data>
<data name="label.total" xml:space="preserve">
<value>Total</value>
</data>
<data name="label.deleted" xml:space="preserve">
<value>Deleted</value>
</data>
<data name="label.count" xml:space="preserve">
<value>Count</value>
</data>
</root>
@@ -1,9 +1,56 @@
@model Model_Home
@inject SbmLocaliser Localiser
@{
ViewData["Title"] = "Home Page";
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<h1 class="display-4">Welcome</h1>
</div>
<style>
#tblWelcome
{
margin: 0 auto;
font-size: 20px;
border-spacing: 0;
}
#tblWelcome tr:hover
{
background-color: lightyellow;
}
#tblWelcome tr th
{
padding: 4px 4px;
font-size: 20px;
}
#tblWelcome tr td
{
padding: 4px 4px;
font-size: 16px;
}
</style>
<div class="">
<table id="tblWelcome" class="table-hover">
<tr style="font-weight:bold;background-color:lightsteelblue;">
<th style="min-width:200px;">@Localiser["label.context"]</th>
<th class="center" style="min-width:80px;">@Localiser["label.count"]</th>
</tr>
<tr>
<td class="">Owners</td>
<td class="center sbc-action-text" onclick="sbc.navigateTo('Instance/Owner')">@Model.GetOwnerCount()</td>
</tr>
<tr>
<td class="">Repositories</td>
<td class="center sbc-action-text" onclick="sbc.navigateTo('Instance/Repository')">@Model.GetRepositoryCount()</td>
</tr>
<tr>
<td class="">Users</td>
<td class="center sbc-action-text" onclick="sbc.navigateTo('Account/UserAccount')">@Model.GetUserAccountCount()</td>
</tr>
</table>
</div>
@@ -71,9 +71,9 @@ body
/* Responsive */
body > .container, header > .container, footer > .container
#sbc-page-body > .container, header > .container, footer > .container
{
padding: 0 0.5%;
padding: 0 4px;
}
@media (min-width: 992px)