72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
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()
|
|
{
|
|
// Validate session.
|
|
if (!ValidUserSession)
|
|
return RedirectToAction("", "");
|
|
|
|
// Paging.
|
|
Model_Organisation model = new Model_Organisation(Localiser);
|
|
model.Paging.PageNo = 1;
|
|
model.Paging.PageLength = 6;
|
|
|
|
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)
|
|
return RedirectToAction("", "");
|
|
|
|
// Retrieve organisation.
|
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(model.Filter.OrganisationId.ToSysId());
|
|
if (organisation == null)
|
|
RedirectToAction("", "Organisation");
|
|
model.MemberOrganisationName = organisation?.Name;
|
|
|
|
// Paging.
|
|
model.Paging.PageNo = 1;
|
|
model.Paging.PageLength = 12;
|
|
|
|
return View(model);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|