v1.1.0.0
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation data.
|
||||
public class OrganisationData_List
|
||||
private class OrganisationData_List
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String Name { get; set; }
|
||||
@@ -40,7 +40,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
public class OrganisationData_Full : OrganisationData_List
|
||||
private class OrganisationData_Full : OrganisationData_List
|
||||
{
|
||||
}
|
||||
private void PopulateOrganisationResponseData(SaxOrganisation organisation, OrganisationData_List data)
|
||||
@@ -72,8 +72,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Organisation List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_OrganisationList : AjaxResponse_Data
|
||||
private class AjaxResponse_OrganisationList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_OrganisationList(SaxModel_Admin model) : base(model) { }
|
||||
// Organisation list.
|
||||
public List<OrganisationData_List> Organisations { get; } = new List<OrganisationData_List>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||
@@ -86,7 +89,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetList";
|
||||
String messageTitle = Localiser["organisation.caption.organisations"];
|
||||
AjaxResponse_OrganisationList responseData = new AjaxResponse_OrganisationList();
|
||||
AjaxResponse_OrganisationList responseData = new AjaxResponse_OrganisationList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -170,8 +173,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Organisation ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_Organisation : AjaxResponse_Data
|
||||
private class AjaxResponse_Organisation : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Organisation(SaxModel_Admin model) : base(model) { }
|
||||
// Organisation details.
|
||||
public OrganisationData_Full organisation { get; } = new OrganisationData_Full();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -181,7 +187,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetItem";
|
||||
String messageTitle = Localiser["organisation.caption.organisation"];
|
||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation();
|
||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -218,7 +224,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreItem";
|
||||
String messageTitle = Localiser["organisation.caption.organisation"];
|
||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation();
|
||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Member data.
|
||||
public class MemberData_List
|
||||
private class MemberData_List
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String UserAccountId { get; set; }
|
||||
@@ -34,7 +34,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
public class MemberData_Full : MemberData_List
|
||||
private class MemberData_Full : MemberData_List
|
||||
{
|
||||
}
|
||||
private void PopulateMemberResponseData(MemberData_List data, SaxUserOrganisation userOrganisation, SaxUserAccount userAccount, SaxOrganisation organisation)
|
||||
@@ -60,8 +60,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Organisation Member List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_MemberList : AjaxResponse_Data
|
||||
private class AjaxResponse_MemberList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_MemberList(SaxModel_Admin model) : base(model) { }
|
||||
// Member list.
|
||||
public List<MemberData_List> Members { get; } = new List<MemberData_List>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> MemberRoles { get; } = new List<CodeDesc>();
|
||||
@@ -75,7 +78,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetMemberList";
|
||||
String messageTitle = Localiser["organisation.caption.members"];
|
||||
AjaxResponse_MemberList responseData = new AjaxResponse_MemberList();
|
||||
AjaxResponse_MemberList responseData = new AjaxResponse_MemberList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -165,8 +168,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Organisation Member ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_Member : AjaxResponse_Data
|
||||
private class AjaxResponse_Member : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Member(SaxModel_Admin model) : base(model) { }
|
||||
// Member details.
|
||||
public MemberData_Full Member { get; } = new MemberData_Full();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -176,7 +182,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetItem";
|
||||
String messageTitle = Localiser["organisation.caption.member"];
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member();
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -226,7 +232,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreMember";
|
||||
String messageTitle = Localiser["organisation.caption.member"];
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member();
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Region data.
|
||||
public class RegionData_List
|
||||
private class RegionData_List
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String RegionTypeCode { get; set; }
|
||||
@@ -30,8 +30,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
public class RegionData_Full : RegionData_List
|
||||
private class RegionData_Full : RegionData_List
|
||||
{
|
||||
public int RegionIdParent { get; set; }
|
||||
}
|
||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_List data)
|
||||
{
|
||||
@@ -40,19 +41,27 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
data.RegionTypeDesc = RegionTypeCodes.GetDescForType(region.RegionType);
|
||||
data.CountryIso2Code = region.CountryIso2Code;
|
||||
data.Name = region.Name;
|
||||
using (SaxRegion parentRegion = ReferenceMgr.GetRegionById(region.RegionIdParent))
|
||||
{
|
||||
if (parentRegion != null) data.ParentName = parentRegion.Name;
|
||||
}
|
||||
data.StatusCode = region.StatusCode;
|
||||
data.StatusDesc = region.StatusDesc;
|
||||
}
|
||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_Full data)
|
||||
{
|
||||
PopulateRegionResponseData(region, data as RegionData_List);
|
||||
data.RegionIdParent = SysId.ToInt(region.RegionIdParent);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Region List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_RegionList : AjaxResponse_Data
|
||||
private class AjaxResponse_RegionList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_RegionList(SaxModel_Admin model) : base(model) { }
|
||||
// Region list.
|
||||
public List<RegionData_List> Regions { get; } = new List<RegionData_List>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||
@@ -65,7 +74,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetList";
|
||||
String messageTitle = Localiser["region.caption.regions"];
|
||||
AjaxResponse_RegionList responseData = new AjaxResponse_RegionList();
|
||||
AjaxResponse_RegionList responseData = new AjaxResponse_RegionList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -139,8 +148,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Region ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_Region : AjaxResponse_Data
|
||||
private class AjaxResponse_Region : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Region(SaxModel_Admin model) : base(model) { }
|
||||
// Region details.
|
||||
public RegionData_Full region { get; } = new RegionData_Full();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -150,7 +162,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetItem";
|
||||
String messageTitle = Localiser["region.caption.region"];
|
||||
AjaxResponse_Region responseData = new AjaxResponse_Region();
|
||||
AjaxResponse_Region responseData = new AjaxResponse_Region(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -187,7 +199,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreItem";
|
||||
String messageTitle = Localiser["region.caption.region"];
|
||||
AjaxResponse_Region responseData = new AjaxResponse_Region();
|
||||
AjaxResponse_Region responseData = new AjaxResponse_Region(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -212,10 +224,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
region = ReferenceMgr.CreateRegion();
|
||||
|
||||
// Populate item properties.
|
||||
if (model.RegionTypeCode != null)
|
||||
region.RegionType = model.RegionType;
|
||||
if (model.RegionCountryIso2Code != null)
|
||||
region.CountryIso2Code = model.RegionCountryIso2Code;
|
||||
if (model.RegionName != null)
|
||||
region.Name = model.RegionName;
|
||||
if (model.RegionIdParent != null)
|
||||
region.RegionIdParent = model.RegionIdParent.ToSysId();
|
||||
if (model.RegionStatusCode != null)
|
||||
region.Status = model.RegionStatus;
|
||||
|
||||
|
||||
@@ -29,7 +29,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Paging.
|
||||
Model_Region model = new Model_Region(Localiser);
|
||||
model.DataPageNo = 1;
|
||||
model.DataPageLength = 12;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Sign-in request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_Signin : AjaxResponse_Data
|
||||
private class AjaxResponse_Signin : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Signin(SaxModel_Admin model) : base(model) { }
|
||||
}
|
||||
// Ajax request.
|
||||
[HttpPost]
|
||||
@@ -35,7 +37,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public IActionResult Ajax_Signin(Model_Security model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_Signin";
|
||||
AjaxResponse_Signin responseData = new AjaxResponse_Signin();
|
||||
AjaxResponse_Signin responseData = new AjaxResponse_Signin(model);
|
||||
String messageTitle = Localiser["signin.caption"];
|
||||
|
||||
// Validate Sign-in data.
|
||||
@@ -63,7 +65,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Keep Logged In.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_KeepLoggedIn : AjaxResponse_Base
|
||||
private class AjaxResponse_KeepLoggedIn : AjaxResponse_Base
|
||||
{
|
||||
}
|
||||
// Ajax request.
|
||||
@@ -147,8 +149,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Sign-out request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_SignOut : AjaxResponse_Data
|
||||
private class AjaxResponse_SignOut : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_SignOut(SaxModel_Admin model) : base(model) { }
|
||||
}
|
||||
// Ajax request.
|
||||
[HttpPost]
|
||||
@@ -156,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public ActionResult Ajax_SignOut(Model_Security model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_SignOut";
|
||||
AjaxResponse_SignOut responseData = new AjaxResponse_SignOut();
|
||||
AjaxResponse_SignOut responseData = new AjaxResponse_SignOut(model);
|
||||
String messageTitle = Localiser["signin.caption.signout"];
|
||||
|
||||
// User must have a valid session.
|
||||
@@ -187,7 +191,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Password complexity request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_PasswordScore : AjaxResponse_Data
|
||||
private class AjaxResponse_PasswordScore : AjaxResponse_Base
|
||||
{
|
||||
public int Score { get; set; }
|
||||
}
|
||||
@@ -209,8 +213,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Change Password request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_ChangePassword : AjaxResponse_Data
|
||||
private class AjaxResponse_ChangePassword : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ChangePassword(SaxModel_Admin model) : base(model) { }
|
||||
}
|
||||
// Ajax request.
|
||||
[HttpPost]
|
||||
@@ -218,7 +224,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public ActionResult Ajax_StorePassword(Model_Security model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StorePassword";
|
||||
AjaxResponse_ChangePassword responseData = new AjaxResponse_ChangePassword();
|
||||
AjaxResponse_ChangePassword responseData = new AjaxResponse_ChangePassword(model);
|
||||
String messageTitle = Localiser["security.caption.change.password"];
|
||||
|
||||
// If 'Request Password' encrypted params (from email link) are present,
|
||||
@@ -300,8 +306,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Request Password request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_RequestPassword : AjaxResponse_Data
|
||||
private class AjaxResponse_RequestPassword : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_RequestPassword(SaxModel_Admin model) : base(model) { }
|
||||
/// <summary>Message to be displayed for the user to 'OK' before returning to the Sign-in page.</summary>
|
||||
public String SuccessMsg { get; set; }
|
||||
}
|
||||
@@ -311,7 +319,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public ActionResult Ajax_RequestNewPassword(Model_Security model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_RequestNewPassword";
|
||||
AjaxResponse_RequestPassword responseData = new AjaxResponse_RequestPassword();
|
||||
AjaxResponse_RequestPassword responseData = new AjaxResponse_RequestPassword(model);
|
||||
String messageTitle = Localiser["security.caption.request.password"];
|
||||
|
||||
// Validate data.
|
||||
@@ -391,7 +399,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
int expiresMinutes_Max = Sax.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Max;
|
||||
return Math.Max(expiresMinutes_Min, Math.Min(expiresMinutes_Max, expiresMinutes));
|
||||
}
|
||||
public class RequestPasswordParams
|
||||
private class RequestPasswordParams
|
||||
{
|
||||
public SysId UserAccountId { get; set; }
|
||||
public String EmailAddress { get; set; }
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Sport data.
|
||||
public class SportData_List
|
||||
private class SportData_List
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
public class SportData_Full : SportData_List
|
||||
private class SportData_Full : SportData_List
|
||||
{
|
||||
}
|
||||
private void PopulateSportResponseData(SaxSport sport, SportData_List data)
|
||||
@@ -44,8 +44,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Sport List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_SportList : AjaxResponse_Data
|
||||
private class AjaxResponse_SportList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_SportList(SaxModel_Admin model) : base(model) { }
|
||||
// Sport list.
|
||||
public List<SportData_List> Sports { get; } = new List<SportData_List>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||
@@ -58,7 +61,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetList";
|
||||
String messageTitle = Localiser["sport.caption.sports"];
|
||||
AjaxResponse_SportList responseData = new AjaxResponse_SportList();
|
||||
AjaxResponse_SportList responseData = new AjaxResponse_SportList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -119,8 +122,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Sport ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_Sport : AjaxResponse_Data
|
||||
private class AjaxResponse_Sport : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Sport(SaxModel_Admin model) : base(model) { }
|
||||
// Sport details.
|
||||
public SportData_Full sport { get; } = new SportData_Full();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -130,7 +136,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetItem";
|
||||
String messageTitle = Localiser["sport.caption.sport"];
|
||||
AjaxResponse_Sport responseData = new AjaxResponse_Sport();
|
||||
AjaxResponse_Sport responseData = new AjaxResponse_Sport(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -167,7 +173,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreItem";
|
||||
String messageTitle = Localiser["sport.caption.sport"];
|
||||
AjaxResponse_Sport responseData = new AjaxResponse_Sport();
|
||||
AjaxResponse_Sport responseData = new AjaxResponse_Sport(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Database data.
|
||||
public class DatabaseTableData
|
||||
private class DatabaseTableData
|
||||
{
|
||||
public String SchemaName { get; set; }
|
||||
public String TableName { get; set; }
|
||||
@@ -40,8 +40,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Database Table List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_DatabaseTableList : AjaxResponse_Data
|
||||
private class AjaxResponse_DatabaseTableList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_DatabaseTableList(SaxModel_Admin model) : base(model) { }
|
||||
// Table list.
|
||||
public List<DatabaseTableData> Tables { get; } = new List<DatabaseTableData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -51,7 +54,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetDatabaseTables";
|
||||
String messageTitle = Localiser["system.caption.database"];
|
||||
AjaxResponse_DatabaseTableList responseData = new AjaxResponse_DatabaseTableList();
|
||||
AjaxResponse_DatabaseTableList responseData = new AjaxResponse_DatabaseTableList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -101,7 +104,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Database Schema ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class DbSchemaItemResponseData
|
||||
private class DbSchemaItemResponseData
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public String TableName { get; set; }
|
||||
@@ -110,8 +113,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String IndexName { get; set; }
|
||||
public String Comment { get; set; }
|
||||
}
|
||||
public class AjaxResponse_ValidateDatabaseSchema : AjaxResponse_Data
|
||||
private class AjaxResponse_ValidateDatabaseSchema : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ValidateDatabaseSchema(SaxModel_Admin model) : base(model) { }
|
||||
// Schema validation list.
|
||||
public List<DbSchemaItemResponseData> Items { get; } = new List<DbSchemaItemResponseData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -121,7 +127,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetDatabaseTables";
|
||||
String messageTitle = Localiser["system.caption.database"];
|
||||
AjaxResponse_ValidateDatabaseSchema responseData = new AjaxResponse_ValidateDatabaseSchema();
|
||||
AjaxResponse_ValidateDatabaseSchema responseData = new AjaxResponse_ValidateDatabaseSchema(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Database data.
|
||||
public class LogFileData
|
||||
private class LogFileData
|
||||
{
|
||||
public String Name { get; set; }
|
||||
}
|
||||
@@ -28,8 +28,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get Database Table List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_LogFileList : AjaxResponse_Data
|
||||
private class AjaxResponse_LogFileList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_LogFileList(SaxModel_Admin model) : base(model) { }
|
||||
// Log file list.
|
||||
public List<LogFileData> Tables { get; } = new List<LogFileData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -39,7 +42,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetLogFileList";
|
||||
String messageTitle = Localiser["system.caption.logs"];
|
||||
AjaxResponse_LogFileList responseData = new AjaxResponse_LogFileList();
|
||||
AjaxResponse_LogFileList responseData = new AjaxResponse_LogFileList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// User data.
|
||||
public class UserData_List
|
||||
private class UserData_List
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String EmailAddress { get; set; }
|
||||
@@ -32,7 +32,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
public class UserData_Full : UserData_List
|
||||
private class UserData_Full : UserData_List
|
||||
{
|
||||
public List<String> userRoleCodes { get; } = new List<string>();
|
||||
}
|
||||
@@ -73,8 +73,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get User List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_UserList : AjaxResponse_Data
|
||||
private class AjaxResponse_UserList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_UserList(SaxModel_Admin model) : base(model) { }
|
||||
// User list.
|
||||
public List<UserData_List> Users { get; } = new List<UserData_List>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> UserRoles { get; } = new List<CodeDesc>();
|
||||
@@ -90,7 +93,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUserList";
|
||||
String messageTitle = Localiser["user.caption.users"];
|
||||
AjaxResponse_UserList responseData = new AjaxResponse_UserList();
|
||||
AjaxResponse_UserList responseData = new AjaxResponse_UserList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -167,8 +170,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Get User ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_User : AjaxResponse_Data
|
||||
private class AjaxResponse_User : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_User(SaxModel_Admin model) : base(model) { }
|
||||
// User details.
|
||||
public UserData_Full user { get; } = new UserData_Full();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -179,7 +185,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUser";
|
||||
String messageTitle = Localiser["user.caption.user"];
|
||||
AjaxResponse_User responseData = new AjaxResponse_User();
|
||||
AjaxResponse_User responseData = new AjaxResponse_User(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
@@ -213,7 +219,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUserByEmail";
|
||||
String messageTitle = Localiser["user.caption.user"];
|
||||
AjaxResponse_User responseData = new AjaxResponse_User();
|
||||
AjaxResponse_User responseData = new AjaxResponse_User(model);
|
||||
StoreSessionData = false;
|
||||
|
||||
// Validate session.
|
||||
@@ -251,7 +257,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreUser";
|
||||
String messageTitle = Localiser["user.caption.user"];
|
||||
AjaxResponse_User responseData = new AjaxResponse_User();
|
||||
AjaxResponse_User responseData = new AjaxResponse_User(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
}
|
||||
public String RegionCountryIso2Code { get; set; }
|
||||
public String RegionName { get; set; }
|
||||
public String RegionIdParent { get; set; }
|
||||
public String RegionStatusCode { get; set; }
|
||||
public SaStatus RegionStatus { get { return SacsSystem.GetStatusForCode(RegionStatusCode); } }
|
||||
|
||||
@@ -120,6 +121,20 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
}
|
||||
}
|
||||
|
||||
// Parent region.
|
||||
if (!StringUtil.IsEmpty(RegionIdParent))
|
||||
{
|
||||
SaxRegion parentRegion = ReferenceMgr.GetRegionById(RegionIdParent.ToSysId());
|
||||
if (parentRegion != null)
|
||||
{
|
||||
if (RegionType<= 0 || SaxRegion.IsValidParentRegionType(RegionType, parentRegion.RegionType))
|
||||
{
|
||||
}
|
||||
else responseData.SetControlError(nameof(RegionIdParent), Localiser["region.msg.parent.type.invalid"]);
|
||||
}
|
||||
else responseData.SetControlError(nameof(RegionIdParent), Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Region status.
|
||||
if (RegionStatusCode != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user