v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Core.Web.Admin.Models;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class OrganisationController : SaxController_Admin
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OrganisationController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
base(localiser, logger)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
[HttpGet]
|
||||
public IActionResult Index(String sta)
|
||||
{
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Model.
|
||||
Model_Organisation model = new Model_Organisation(Localiser);
|
||||
|
||||
// Stored Sport filter.
|
||||
model.Filter.OrganisationSportId = SessionData_Admin.Filter.SportId?.ToString() ?? null;
|
||||
using (SaxSport filterSport = ReferenceMgr.GetSportById(SessionData_Admin.Filter.SportId))
|
||||
model.Filter.OrganisationSportName = Localiser.GetSportName(SessionData_Admin.Filter.SportId, filterSport?.Name ?? "");
|
||||
// Stored Region filter.
|
||||
model.Filter.OrganisationRegionId = SessionData_Admin.Filter.RegionId?.ToString() ?? null;
|
||||
using (SaxRegion filterRegion = ReferenceMgr.GetRegionById(SessionData_Admin.Filter.RegionId))
|
||||
model.Filter.OrganisationRegionName = Localiser.GetRegionName(SessionData_Admin.Filter.RegionId, filterRegion?.Name ?? "");
|
||||
|
||||
// Paging.
|
||||
model.Paging.PageNo = 1;
|
||||
model.Paging.PageLength = 8;
|
||||
|
||||
// Default status.
|
||||
if (sta.StartsWithCI("Awa"))
|
||||
model.Filter.OrganisationStatusCategoryCode = nameof(SaxOrganisation.StatusCat.AwaitingOnly);
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Organisation Members action.
|
||||
/// <para>- POST action to allow Organisation Id to be supplied, eg. from Organsiations page.</para>
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public IActionResult Members(Model_OrganisationMembers model)
|
||||
{
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Retrieve organisation.
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||
if (organisation == null)
|
||||
RedirectToAction("", "Organisation");
|
||||
model.Filter.OrganisationId= SysId.ToString(organisation.Id);
|
||||
model.Filter.OrganisationName = organisation.Name;
|
||||
|
||||
// Paging.
|
||||
model.Paging.PageNo = 1;
|
||||
model.Paging.PageLength = 12;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Organisation Associations action.
|
||||
/// <para>- POST action to allow Organisation Id to be supplied, eg. from Organsiations page.</para>
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public IActionResult Associations(Model_OrganisationAssociations model)
|
||||
{
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Retrieve organisation.
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||
if (organisation == null)
|
||||
RedirectToAction("", "Organisation");
|
||||
model.Filter.OrganisationId = SysId.ToString(organisation.Id);
|
||||
model.Filter.OrganisationName = organisation.Name;
|
||||
|
||||
// Paging.
|
||||
model.Paging.PageNo = 1;
|
||||
model.Paging.PageLength = 12;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user