55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using Sarand.Net.Standard.Base.Bus;
|
|
using Saxonite.Net.Core.Web.Admin.App;
|
|
using Saxonite.Net.Core.Web.Base.App;
|
|
using Saxonite.Net.Core.Web.Base.Models;
|
|
using Saxonite.Net.Standard.Base.Bus;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Saxonite.Net.Core.Web.Admin.Models
|
|
{
|
|
//=======================================================================
|
|
public class SaxModel_Admin : SaxModel_Base
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Protected construction.
|
|
protected SaxModel_Admin(SaxLocaliser localiser) :
|
|
base(localiser)
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
//-------------------------------------------------------------------
|
|
// Session.
|
|
public SaxSessionData_Admin SessionData_Admin { get { return SessionData as SaxSessionData_Admin; } }
|
|
public SysId SessionUserAccountId { get { return SessionData_Admin?.User?.UserAccountId ?? null; } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Reference data.
|
|
//-------------------------------------------------------------------
|
|
public String GetSportName(SysId sportId)
|
|
{
|
|
using (SaxSport sport = ReferenceMgr.GetSportById(sportId))
|
|
{
|
|
if (sport != null) return sport.Name;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
public String GetRegionName(SysId regionId)
|
|
{
|
|
using (SaxRegion region = ReferenceMgr.GetRegionById(regionId))
|
|
{
|
|
if (region != null) return region.Name;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|