v1.0.3.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.0.3.1";
|
||||
private static String version { get; } = "1.0.4.0";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -31,7 +31,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
String[] versionElements = version.Split('.');
|
||||
return String.Join(".", versionElements.Take(3));
|
||||
}
|
||||
catch (Exception exc) { SaLogger.Warn("Sax.VersionData.ToString " + ExceptionUtil.GetErrorStateMessage(exc)); }
|
||||
catch (Exception exc) { SaLogger.Warn("Sax.Version.ToString " + ExceptionUtil.GetErrorStateMessage(exc)); }
|
||||
}
|
||||
return version;
|
||||
}
|
||||
@@ -39,8 +39,11 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Version history.
|
||||
// 1.0.4 ?-May-2021 Online Profile Organisation
|
||||
// - Admin Organisation Region & Sport.
|
||||
// 1.0.3 11-May-2021 Admin Organisation Members
|
||||
// - Admin data filters & styling, organisation members.
|
||||
// - Online Profile Organisations - simple list with name.
|
||||
// - Online region and sport popups sorted and OK working.
|
||||
// 1.0.2 6-May-2021 Online bug fix.
|
||||
// - Resolve Online region & sport popup issue.
|
||||
|
||||
@@ -25,6 +25,12 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
OrganisationCategory_Desc,
|
||||
PhoneMain,
|
||||
PhoneAlt,
|
||||
// Region.
|
||||
RegionId,
|
||||
Region_Name,
|
||||
// Sport.
|
||||
SportId,
|
||||
Sport_Name,
|
||||
// Associated data.
|
||||
/// <summary>Number of users with an active interest in the organisation.</summary>
|
||||
User_Count,
|
||||
@@ -49,6 +55,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public Sax.OrganisationCategory OrganisationCategory { get; set; }
|
||||
public String PhoneMain { get; set; } = String.Empty;
|
||||
public String PhoneAlt { get; set; } = String.Empty;
|
||||
public SysId RegionIdPrimary { get; set; }
|
||||
public SysId SportIdPrimary { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -88,6 +96,16 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.PhoneAlt; }
|
||||
set { CheckChanged(data.PhoneAlt, value); data.PhoneAlt = value; }
|
||||
}
|
||||
public SysId RegionIdPrimary
|
||||
{
|
||||
get { return data.RegionIdPrimary; }
|
||||
set { CheckChanged(data.RegionIdPrimary, value); data.RegionIdPrimary = value; }
|
||||
}
|
||||
public SysId SportIdPrimary
|
||||
{
|
||||
get { return data.SportIdPrimary; }
|
||||
set { CheckChanged(data.SportIdPrimary, value); data.SportIdPrimary = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom (Data data)
|
||||
{
|
||||
@@ -96,6 +114,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
OrganisationCategory = data.OrganisationCategory;
|
||||
PhoneMain = data.PhoneMain;
|
||||
PhoneAlt = data.PhoneAlt;
|
||||
RegionIdPrimary = data.RegionIdPrimary;
|
||||
SportIdPrimary = data.SportIdPrimary;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone ()
|
||||
@@ -116,6 +136,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public ValidValue OrganisationCategory { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneMain { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneAlt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RegionIdPrimary { get; set; } = ValidValue.Valid;
|
||||
public ValidValue SportIdPrimary { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -193,6 +215,16 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.PhoneAlt; }
|
||||
set { data.PhoneAlt = value; }
|
||||
}
|
||||
public SysId RegionIdPrimary
|
||||
{
|
||||
get { return data.RegionIdPrimary; }
|
||||
set { data.RegionIdPrimary = value; }
|
||||
}
|
||||
public SysId SportIdPrimary
|
||||
{
|
||||
get { return data.SportIdPrimary; }
|
||||
set { data.SportIdPrimary = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
@@ -224,6 +256,9 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public String NamePartial { get; set; }
|
||||
/// <summary>Partial match on a number of fields, including name, sport, address, etc.</summary>
|
||||
public String OrganisationFilter { get; set; }
|
||||
public List<SysId> RegionIdsIncluded { get; } = new List<SysId>();
|
||||
public List<SysId> SportIdsIncluded { get; } = new List<SysId>();
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.ActiveOnly;
|
||||
}
|
||||
@@ -234,6 +269,16 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
// Company list methods.
|
||||
public static class SaxOrganisationList
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Extract the first Organisation in list with the specified Id.
|
||||
/// </summary>
|
||||
public static SaxOrganisation GetOrganisationById(this List<SaxOrganisation> values, SysId organisationId)
|
||||
{
|
||||
return values.Find(item => item.Id.Equals(organisationId));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus
|
||||
@@ -262,6 +263,21 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public static class SaxUserOrganisationList
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Extract list of unique Organisation Ids from the list.
|
||||
/// </summary>
|
||||
public static List<SysId> GetOrganisationIds(this List<SaxUserOrganisation> values)
|
||||
{
|
||||
return new HashSet<SysId>(values.Select(item => item.OrganisationId)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract list of unique User Account Ids from the list.
|
||||
/// </summary>
|
||||
public static List<SysId> GetUserAccountIds(this List<SaxUserOrganisation> values)
|
||||
{
|
||||
return new HashSet<SysId>(values.Select(item => item.UserAccountId)).ToList();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
// Account Mgr - Organisation
|
||||
//*******************************************************************
|
||||
// Utilities.
|
||||
public long GetOrganisationMemberCount (SysId organisationId)
|
||||
public long GetOrganisationMemberCount(SysId organisationId)
|
||||
{
|
||||
if (!SysId.IsValid(organisationId)) return 0;
|
||||
SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params();
|
||||
@@ -30,11 +30,11 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public abstract SaxOrganisation CreateOrganisation ();
|
||||
public abstract SaxOrganisation CreateOrganisation();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
public bool OrganisationExistsById (SysId id)
|
||||
public bool OrganisationExistsById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
@@ -43,7 +43,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
||||
return GetOrganisationCount(prmOrganisation) == 1;
|
||||
}
|
||||
public bool OrganisationExistsByName (String name)
|
||||
public bool OrganisationExistsByName(String name)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (StringUtil.IsEmpty(name)) return false;
|
||||
@@ -55,8 +55,8 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve individual items.
|
||||
public abstract SaxOrganisation GetOrganisation (SaxOrganisation.Params prmOrganisation);
|
||||
public SaxOrganisation GetOrganisationById (SysId id)
|
||||
public abstract SaxOrganisation GetOrganisation(SaxOrganisation.Params prmOrganisation);
|
||||
public SaxOrganisation GetOrganisationById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
@@ -65,7 +65,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
||||
return GetOrganisation(prmOrganisation);
|
||||
}
|
||||
public SaxOrganisation GetOrganisationByName (String name)
|
||||
public SaxOrganisation GetOrganisationByName(String name)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (StringUtil.IsEmpty(name)) return null;
|
||||
@@ -77,13 +77,13 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item data.
|
||||
public bool IsValidOrganisation (SaxOrganisation organisation)
|
||||
public bool IsValidOrganisation(SaxOrganisation organisation)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (organisation == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
||||
return IsValidOrganisationData(organisation.GetData(), new SaxOrganisation.ErrField());
|
||||
}
|
||||
public virtual bool IsValidOrganisationData (SaxOrganisation.Data data, SaxOrganisation.ErrField errField)
|
||||
public virtual bool IsValidOrganisationData(SaxOrganisation.Data data, SaxOrganisation.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
// Name.
|
||||
@@ -116,6 +116,15 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.PhoneAlt = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Region.
|
||||
if (errField.RegionIdPrimary != SacsHierarchyItem.ValidValue.Ignore)
|
||||
{
|
||||
}
|
||||
// Sport.
|
||||
if (errField.SportIdPrimary != SacsHierarchyItem.ValidValue.Ignore)
|
||||
{
|
||||
}
|
||||
|
||||
// Common properties.
|
||||
if (errField.Notes != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Notes, "notes", (long)SaxDbDfn.GetColTextLen(SaxDbDfn.ColumnIdx.Organisation_Notes)))
|
||||
{
|
||||
@@ -136,34 +145,54 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
}
|
||||
}
|
||||
|
||||
// Region.
|
||||
if (errField.RegionIdPrimary != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.RegionIdPrimary))
|
||||
{
|
||||
if (!ReferenceMgr.RegionExistsById(data.RegionIdPrimary))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Invalid region specified");
|
||||
}
|
||||
}
|
||||
|
||||
// Sport.
|
||||
if (errField.SportIdPrimary != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.SportIdPrimary))
|
||||
{
|
||||
if (!ReferenceMgr.SportExistsById(data.SportIdPrimary))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Invalid sport specified");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation database interface.
|
||||
public abstract bool InsertOrganisation (SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateOrganisation (SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool OrganisationCanBeDeleted (SaxOrganisation organisation)
|
||||
public abstract bool InsertOrganisation(SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateOrganisation(SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool OrganisationCanBeDeleted(SaxOrganisation organisation)
|
||||
{
|
||||
ClearErrorState();
|
||||
return true;
|
||||
}
|
||||
public abstract bool DeleteOrganisation (SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool DeleteOrganisation(SaxOrganisation organisation, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation list:
|
||||
public abstract ColumnDfn GetOrganisationColumnDfn (SaxOrganisation.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetOrganisationQueryFilter (SaxOrganisation.Params prmOrganisation);
|
||||
public abstract long GetOrganisationCount (SaxOrganisation.Params prmOrganisation);
|
||||
public abstract List<SaxOrganisation> GetOrganisationList (SaxOrganisation.Params prmOrganisation);
|
||||
public abstract DbResultSet ExecuteOrganisationQuery (List<ColumnDfn> columns, SaxOrganisation.Params prmOrganisation);
|
||||
public abstract ColumnDfn GetOrganisationColumnDfn(SaxOrganisation.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetOrganisationQueryFilter(SaxOrganisation.Params prmOrganisation);
|
||||
public abstract long GetOrganisationCount(SaxOrganisation.Params prmOrganisation);
|
||||
public abstract List<SaxOrganisation> GetOrganisationList(SaxOrganisation.Params prmOrganisation);
|
||||
public abstract DbResultSet ExecuteOrganisationQuery(List<ColumnDfn> columns, SaxOrganisation.Params prmOrganisation);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Extract and format result set data value where specific handling is required.
|
||||
/// <para>Where response is an invalid data value, format value using column.FormatValue(values).</para>
|
||||
/// </summary>
|
||||
public virtual DataValue GetOrganisationDataValue (ColumnDfn column, NamedValue.Map values)
|
||||
public virtual DataValue GetOrganisationDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxOrganisation.Column)column.Id)
|
||||
@@ -194,17 +223,17 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
// Status.
|
||||
case SaxOrganisation.Column.Status_Desc:
|
||||
case SaxOrganisation.Column.Status_Ind:
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxOrganisation.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxOrganisation.Column.Status_Ind)
|
||||
value = new DataValue(SaxOrganisation.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxOrganisation.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxOrganisation.Column.Status_Ind)
|
||||
value = new DataValue(SaxOrganisation.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user