v1.2.2
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.1.1";
|
||||
private static String version { get; } = "1.2.2";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -40,6 +40,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Version history.
|
||||
//-------------------------------------------------------------------
|
||||
// 1.2.2 8-Dec-2021 Online Activities.
|
||||
// - Organisation Events.
|
||||
// 1.2.1 20-Nov-2021 Online Profile.
|
||||
// - Online Organisation edit.
|
||||
// 1.2.0 1-Nov-2021 'Admin' Organisation role
|
||||
|
||||
@@ -259,6 +259,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
/* Do not change the values or codes - tied to database. */
|
||||
Playing,
|
||||
Training,
|
||||
Organisation,
|
||||
Social,
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Sat 20-Nov-2021 14:44:06
|
||||
// Code generated by Sarand Database Utilities Wed 8-Dec-2021 14:16:53
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -165,7 +165,8 @@ namespace Saxonite.Base.App
|
||||
OrganisationEvent_RegionIdCountry,
|
||||
OrganisationEvent_EventAt,
|
||||
OrganisationEvent_EventTypeCode,
|
||||
OrganisationEvent_About,
|
||||
OrganisationEvent_Summary,
|
||||
OrganisationEvent_Details,
|
||||
OrganisationEvent_EventData,
|
||||
OrganisationEvent_PublishedAt,
|
||||
OrganisationEvent_ExpiresAt,
|
||||
@@ -356,7 +357,7 @@ namespace Saxonite.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 17;
|
||||
private static readonly int columnCount = 310;
|
||||
private static readonly int columnCount = 311;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -669,7 +670,8 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(7,"RegionIdCountry",4,4,false,10),
|
||||
new ColumnDfn(7,"EventAt",9,93,false,16),
|
||||
new ColumnDfn(7,"EventTypeCode",0,12,false,3),
|
||||
new ColumnDfn(7,"About",0,-9,false,2000),
|
||||
new ColumnDfn(7,"Summary",0,-9,false,200),
|
||||
new ColumnDfn(7,"Details",0,-9,false,2000),
|
||||
new ColumnDfn(7,"EventData",0,-9,false,0),
|
||||
new ColumnDfn(7,"PublishedAt",9,93,false,16),
|
||||
new ColumnDfn(7,"ExpiresAt",9,93,false,16),
|
||||
|
||||
@@ -154,8 +154,9 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//---------------------------------------------------------------
|
||||
// Event types.
|
||||
eventTypeCodes.Add(Sax.EventType.Playing, "PLG", "Playing");
|
||||
eventTypeCodes.Add(Sax.EventType.Playing, "TRN", "Training");
|
||||
eventTypeCodes.Add(Sax.EventType.Playing, "SCL", "Social");
|
||||
eventTypeCodes.Add(Sax.EventType.Training, "TRN", "Training");
|
||||
eventTypeCodes.Add(Sax.EventType.Organisation, "ORG", "Organisation");
|
||||
eventTypeCodes.Add(Sax.EventType.Social, "SCL", "Social");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Opportunity types.
|
||||
|
||||
@@ -32,7 +32,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
EventAt_DateTime,
|
||||
EventTypeCode,
|
||||
EventType_Desc,
|
||||
About,
|
||||
Summary,
|
||||
Details,
|
||||
PublishedAt_Date,
|
||||
PublishedAt_DateTime,
|
||||
ExpiresAt_Date,
|
||||
@@ -57,7 +58,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public SysId RegionIdCountry { get; set; }
|
||||
public DateTime EventAt { get; set; }
|
||||
public Sax.EventType EventType { get; set; }
|
||||
public String About { get; set; } = String.Empty;
|
||||
public String Summary { get; set; } = String.Empty;
|
||||
public String Details { get; set; } = String.Empty;
|
||||
public String EventData { get; set; } = String.Empty;
|
||||
public DateTime PublishedAt { get; set; }
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
@@ -100,10 +102,15 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.EventType; }
|
||||
set { CheckChanged((int)data.EventType, (int)value); data.EventType = value; }
|
||||
}
|
||||
public String About
|
||||
public String Summary
|
||||
{
|
||||
get { return data.About; }
|
||||
set { CheckChanged(data.About, value); data.About = value; }
|
||||
get { return data.Summary; }
|
||||
set { CheckChanged(data.Summary, value); data.Summary = value; }
|
||||
}
|
||||
public String Details
|
||||
{
|
||||
get { return data.Details; }
|
||||
set { CheckChanged(data.Details, value); data.Details = value; }
|
||||
}
|
||||
public String EventData
|
||||
{
|
||||
@@ -128,7 +135,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
RegionIdCountry = data.RegionIdCountry;
|
||||
EventAt = data.EventAt;
|
||||
EventType = data.EventType;
|
||||
About = data.About;
|
||||
Summary = data.Summary;
|
||||
Details = data.Details;
|
||||
EventData = data.EventData;
|
||||
PublishedAt = data.PublishedAt;
|
||||
ExpiresAt = data.ExpiresAt;
|
||||
@@ -152,7 +160,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public ValidValue RegionIdCountry { get; set; } = ValidValue.Valid;
|
||||
public ValidValue EventAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue EventType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue About { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Summary { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Details { get; set; } = ValidValue.Valid;
|
||||
public ValidValue EventData { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PublishedAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ExpiresAt { get; set; } = ValidValue.Valid;
|
||||
@@ -234,10 +243,15 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.EventType; }
|
||||
set { data.EventType = value; }
|
||||
}
|
||||
public String About
|
||||
public String Summary
|
||||
{
|
||||
get { return data.About; }
|
||||
set { data.About = value; }
|
||||
get { return data.Summary; }
|
||||
set { data.Summary = value; }
|
||||
}
|
||||
public String Details
|
||||
{
|
||||
get { return data.Details; }
|
||||
set { data.Details = value; }
|
||||
}
|
||||
public String EventData
|
||||
{
|
||||
@@ -289,7 +303,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public List<SysId> RegionIdsIncluded { get; } = new List<SysId>();
|
||||
public DateTime EventFrom { get; set; }
|
||||
public DateTime EventTo{ get; set; }
|
||||
public String AboutPartial { get; set; }
|
||||
public String SummaryPartial { get; set; }
|
||||
/// <summary>General filter value - position, outline, sport, body etc. </summary>
|
||||
public String EventFilter { get; set; }
|
||||
public String NotesPartial { get; set; }
|
||||
|
||||
@@ -356,6 +356,10 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public bool OrganisationMembersOnly { get; set; }
|
||||
public List<Sax.OrganisationRole> OrganisationRoles { get; } = new List<Sax.OrganisationRole>();
|
||||
public List<Sax.OrganisationRole> OrganisationRolesAny { get; } = new List<Sax.OrganisationRole>();
|
||||
/// <summary>Exact match on various user account properties including name, email etc.</summary>
|
||||
public String UserFilter { get; set; }
|
||||
/// <summary>Partial match on various user account properties including name, countries etc.</summary>
|
||||
public String UserFilterPartial { get; set; }
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
/// </summary>
|
||||
public class IndexContext
|
||||
{
|
||||
// ToDo Include Localiser.
|
||||
public IndexContext (SysId userAccountId)
|
||||
{
|
||||
UserAccountId = userAccountId;
|
||||
@@ -31,9 +32,9 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
public SysId UserAccountId { get; }
|
||||
public List<SysId> SportIds { get; } = new List<SysId>();
|
||||
public List<SysId> RegionIds { get; } = new List<SysId>();
|
||||
// Default period is ~3 months up to today.
|
||||
public DateTime EffectiveFrom { get; } = DateUtil.IncrementDate(DateTime.Today, -90);
|
||||
public DateTime EffectiveTo { get; } = DateTime.Today;
|
||||
// Default period is ~12 months ago up to ~3 months in the future.
|
||||
public DateTime EffectiveFrom { get; } = DateUtil.IncrementDate(DateTime.Today, -365);
|
||||
public DateTime EffectiveTo { get; } = DateUtil.IncrementDate(DateTime.Today, 30);
|
||||
public bool IsValid()
|
||||
{
|
||||
// Context must contain at least a sport, a region and a valid effective period.
|
||||
@@ -83,6 +84,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
private readonly List<Sax.DataItemType> validActivityItemTypes = new List<Sax.DataItemType>()
|
||||
{
|
||||
Sax.DataItemType.Article,
|
||||
Sax.DataItemType.OrganisationEvent,
|
||||
Sax.DataItemType.OrganisationOpportunity,
|
||||
};
|
||||
|
||||
@@ -148,6 +150,31 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
return ClearActivityIndex(article.GetItemId(), dbUpdateInfo);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Store the Activity Index for a Organisation Event.
|
||||
/// </summary>
|
||||
public bool StoreActivityIndex(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
// Only active opportunities have an activity index.
|
||||
if (!organisationEvent.IsStatusActive) ClearActivityIndex(organisationEvent.GetItemId(), dbUpdateInfo);
|
||||
|
||||
// NB There will be other rules as well, eg. whether published.
|
||||
|
||||
// Activity Index properties.
|
||||
IndexData indexData = new IndexData(organisationEvent.GetItemId());
|
||||
indexData.SportIds.Add(organisationEvent.SportIdPrimary);
|
||||
indexData.RegionIds.Add(organisationEvent.RegionIdCountry);
|
||||
indexData.EffectiveOn = DateUtil.OnInvalid(organisationEvent.PublishedAt.Date, organisationEvent.CreateStamp.On.Date);
|
||||
return StoreActivityIndexData(indexData, dbUpdateInfo);
|
||||
}
|
||||
public bool ClearActivityIndex(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
return ClearActivityIndex(organisationEvent.GetItemId(), dbUpdateInfo);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Store the Activity Index for a Organisation Opportunity.
|
||||
@@ -166,7 +193,6 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
indexData.SportIds.Add(opportunity.SportIdPrimary);
|
||||
indexData.RegionIds.Add(opportunity.RegionIdPrimary);
|
||||
indexData.EffectiveOn = DateUtil.OnInvalid(opportunity.PublishedAt.Date, opportunity.CreateStamp.On.Date);
|
||||
List<SysId> regionIds = new List<SysId>();
|
||||
return StoreActivityIndexData(indexData, dbUpdateInfo);
|
||||
}
|
||||
public bool ClearActivityIndex(SaxOrganisationOpportunity opportunity, DbUpdateInfo dbUpdateInfo)
|
||||
|
||||
@@ -91,10 +91,16 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.EventType = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Event type must be specified.");
|
||||
}
|
||||
// About.
|
||||
if (errField.About != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.About, "outline", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_About), true))
|
||||
// Summary.
|
||||
if (errField.Summary != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Summary, "outline", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Summary), true))
|
||||
{
|
||||
errField.About = SacsHierarchyItem.ValidValue.Invalid;
|
||||
errField.Summary = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Details.
|
||||
if (errField.Details != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Details, "details", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Details)))
|
||||
{
|
||||
errField.Details = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -207,7 +213,15 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Summary - limit to 200 chars.
|
||||
case SaxOrganisationEvent.Column.About:
|
||||
case SaxOrganisationEvent.Column.Summary:
|
||||
{
|
||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Details - limit to 200 chars.
|
||||
case SaxOrganisationEvent.Column.Details:
|
||||
{
|
||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user