v1.1.1.0
This commit is contained in:
@@ -37,6 +37,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
public short ItemType { get; set; }
|
||||
public String ItemTypeClass { get; set; }
|
||||
public long ItemIdx { get; set; }
|
||||
public String Organisation { get; set; }
|
||||
public String Author { get; set; }
|
||||
public String Caption { get; set; }
|
||||
public String Blurb { get; set; }
|
||||
public String Sport { get; set; }
|
||||
@@ -49,6 +51,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
{
|
||||
public ActivityResponseData_Article(SaxController_Online controller, SaxModel_Online model, SaxJournalistArticle article)
|
||||
{
|
||||
Author = model.GetUserAccountDisplayName(article.UserAccountIdJournalist);
|
||||
Headline = article.Headline;
|
||||
Summary = article.Summary;
|
||||
Sport = model.GetSportCaption(article.SportIdPrimary);
|
||||
@@ -58,6 +61,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
foreach (SaxJournalistArticle.ContentData.SegmentData segment in content.Segments)
|
||||
Content.Segments.Add(new ContentData.SegmentData(controller, segment));
|
||||
}
|
||||
public String Organisation { get; set; }
|
||||
public String Author { get; set; }
|
||||
public String Headline { get; set; }
|
||||
public String Summary { get; set; }
|
||||
public String Sport { get; set; }
|
||||
@@ -100,12 +105,15 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
{
|
||||
public ActivityResponseData_Opportunity(SaxModel_Online model, SaxOrganisationOpportunity opportunity)
|
||||
{
|
||||
Organisation = model.GetOrganisationName(opportunity.OrganisationId);
|
||||
Position = opportunity.Position;
|
||||
Outline = opportunity.Outline;
|
||||
Sport = model.GetSportCaption(opportunity.SportIdPrimary);
|
||||
Region = model.GetRegionCaption(opportunity.RegionIdPrimary);
|
||||
PublishedOnFmt = model.Localiser.FormatDate(opportunity.PublishedAt);
|
||||
}
|
||||
public String Organisation { get; set; }
|
||||
public String Author { get; set; }
|
||||
public String Position { get; set; }
|
||||
public String Outline { get; set; }
|
||||
public String Sport { get; set; }
|
||||
|
||||
@@ -26,38 +26,6 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
base(localiser, logger)
|
||||
{}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Regions
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_RegionList : AjaxResponse_Base
|
||||
{
|
||||
public List<SaxModel_Online.RegionData> Regions { get; } = new List<SaxModel_Online.RegionData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Ajax/GetRegions")]
|
||||
public IActionResult Ajax_GetRegionList(Model_Reference model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetRegionList";
|
||||
String messageTitle = Localiser["reference.caption.regions"];
|
||||
AjaxResponse_RegionList responseData = new AjaxResponse_RegionList();
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer)
|
||||
return Forbid();
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Populate regions.
|
||||
foreach (SaxModel_Online.RegionData regionData in model.GetRegionDataList_Active())
|
||||
responseData.Regions.Add(regionData);
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Sports
|
||||
//-------------------------------------------------------------------
|
||||
@@ -77,8 +45,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer)
|
||||
return Forbid();
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
// User doesn't have to be logged in, eg. to register organisation.
|
||||
//if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Populate sports.
|
||||
foreach (SaxModel_Online.SportData sportData in model.GetSportDataList_Active())
|
||||
@@ -90,6 +58,38 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Regions
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_RegionList : AjaxResponse_Base
|
||||
{
|
||||
public List<SaxModel_Online.RegionData> Regions { get; } = new List<SaxModel_Online.RegionData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Ajax/GetRegions")]
|
||||
public IActionResult Ajax_GetRegionList(Model_Reference model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetRegionList";
|
||||
String messageTitle = Localiser["reference.caption.regions"];
|
||||
AjaxResponse_RegionList responseData = new AjaxResponse_RegionList();
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer)
|
||||
return Forbid();
|
||||
// User doesn't have to be logged in, eg. to register organisation.
|
||||
//if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Populate regions.
|
||||
foreach (SaxModel_Online.RegionData regionData in model.GetRegionDataList_Active())
|
||||
responseData.Regions.Add(regionData);
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -5,6 +5,7 @@ using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -37,6 +38,13 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation properties.
|
||||
public String OrganisationName { get; set; }
|
||||
public String OrganisationTypeValue { get; set; }
|
||||
public Sax.OrganisationType OrganisationType { get { return (Sax.OrganisationType)OrganisationTypeCodes.GetTypeForCode(OrganisationTypeValue); } }
|
||||
public String OrganisationCategoryValue { get; set; }
|
||||
public Sax.OrganisationCategory OrganisationCategory { get { return (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(OrganisationCategoryValue); } }
|
||||
public String OrganisationSportId { get; set; }
|
||||
public String OrganisationRegionId { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
|
||||
Reference in New Issue
Block a user