v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// ItemSport.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemProcess : SaxDisposableHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
// Item.
|
||||
ItemType,
|
||||
ItemType_Code,
|
||||
ItemType_Desc,
|
||||
ItemId,
|
||||
Item_Caption,
|
||||
// Process.
|
||||
ProcessType,
|
||||
ProcessType_Desc,
|
||||
// Associated data.
|
||||
// Common.
|
||||
Notes,
|
||||
Flags,
|
||||
Status,
|
||||
Status_Desc,
|
||||
Status_Ind,
|
||||
CreateOn_Date,
|
||||
UpdateOn_Date,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public ItemId ItemId { get; set; } = new ItemId();
|
||||
public Sax.SupportItemProcessType ProcessType { get; set; }
|
||||
public String ProcessData { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public ItemId ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
set { CheckChanged(data.ItemId, value); data.ItemId = value; }
|
||||
}
|
||||
public Sax.SupportItemProcessType ProcessType
|
||||
{
|
||||
get { return data.ProcessType; }
|
||||
set { CheckChanged((int)data.ProcessType, (int)value); data.ProcessType = value; }
|
||||
}
|
||||
public String ProcessData
|
||||
{
|
||||
get { return data.ProcessData; }
|
||||
set { CheckChanged(data.ProcessData, value); data.ProcessData = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemId = data.ItemId;
|
||||
ProcessType = data.ProcessType;
|
||||
ProcessData = data.ProcessData;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue ItemId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ProcessType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ProcessData { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemProcess(SysId id, ItemId itemId, Sax.SupportItemProcessType processType) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemId = itemId;
|
||||
ProcessType = processType;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Active,
|
||||
SaStatus.Inactive,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Active; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Active) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Inactive) return DataValue.TriStateType.Red;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public ItemId GetItemId()
|
||||
{
|
||||
return new ItemId((short)Sax.DataItemType.SupportItemProcess, Id);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public ItemId ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
protected set { data.ItemId = value; }
|
||||
}
|
||||
public Sax.SupportItemProcessType ProcessType
|
||||
{
|
||||
get { return data.ProcessType; }
|
||||
set { data.ProcessType = value; }
|
||||
}
|
||||
public String ProcessData
|
||||
{
|
||||
get { return data.ProcessData; }
|
||||
set { data.ProcessData = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
ActiveOnly,
|
||||
InactiveOnly,
|
||||
NotDeleted,
|
||||
DeletedOnly,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<ItemId> ItemIdsIncluded { get; } = new HashSet<ItemId>();
|
||||
public HashSet<Sax.SupportItemProcessType> ProcessTypesIncluded { get; } = new HashSet<Sax.SupportItemProcessType>();
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxItemProcessList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// ItemSport.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemProcessInstance : SaxDisposableHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
// Item process.
|
||||
ItemProcessId,
|
||||
// Process instance.
|
||||
Started_DateTime,
|
||||
Started_Date,
|
||||
Started_Time,
|
||||
Completed_DateTime,
|
||||
Completed_Date,
|
||||
Completed_Time,
|
||||
// Associated data.
|
||||
// Common.
|
||||
Notes,
|
||||
Flags,
|
||||
Status,
|
||||
Status_Desc,
|
||||
Status_Ind,
|
||||
CreateOn_Date,
|
||||
UpdateOn_Date,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public SysId ItemProcessId { get; set; }
|
||||
public DateTime? StartedAt { get; set; }
|
||||
public DateTime? CompletedAt { get; set; }
|
||||
public String ProcessingData { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public SysId ItemProcessId
|
||||
{
|
||||
get { return data.ItemProcessId; }
|
||||
set { CheckChanged(data.ItemProcessId, value); data.ItemProcessId = value; }
|
||||
}
|
||||
public DateTime? StartedAt
|
||||
{
|
||||
get { return data.StartedAt; }
|
||||
set { CheckChangedNullable(data.StartedAt, value); data.StartedAt = value; }
|
||||
}
|
||||
public DateTime? CompletedAt
|
||||
{
|
||||
get { return data.CompletedAt; }
|
||||
set { CheckChangedNullable(data.CompletedAt, value); data.CompletedAt = value; }
|
||||
}
|
||||
public String ProcessingData
|
||||
{
|
||||
get { return data.ProcessingData; }
|
||||
set { CheckChanged(data.ProcessingData, value); data.ProcessingData = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemProcessId = data.ItemProcessId;
|
||||
StartedAt = data.StartedAt;
|
||||
CompletedAt = data.CompletedAt;
|
||||
ProcessingData = data.ProcessingData;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue ItemProcessId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue StartedAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue CompletedAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ProcessingData { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemProcessInstance(SysId id, SysId itemProcessId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemProcessId = itemProcessId;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Active,
|
||||
SaStatus.Inactive,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Active; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Active) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Inactive) return DataValue.TriStateType.Red;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||
if (SysId.IsValid(ItemProcessId) && SysId.ToInt(ItemProcessId) != SysId.ToInt(data.ItemProcessId))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Process Id cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public SysId ItemProcessId
|
||||
{
|
||||
get { return data.ItemProcessId; }
|
||||
protected set { data.ItemProcessId = value; }
|
||||
}
|
||||
public DateTime? StartedAt
|
||||
{
|
||||
get { return data.StartedAt; }
|
||||
set { data.StartedAt = value; }
|
||||
}
|
||||
public DateTime? CompletedAt
|
||||
{
|
||||
get { return data.CompletedAt; }
|
||||
set { data.CompletedAt = value; }
|
||||
}
|
||||
public String ProcessingData
|
||||
{
|
||||
get { return data.ProcessingData; }
|
||||
set { data.ProcessingData = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
ActiveOnly,
|
||||
InactiveOnly,
|
||||
NotDeleted,
|
||||
DeletedOnly,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> ItemProcessIdsIncluded { get; } = new HashSet<SysId>();
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxItemProcessInstanceList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// ItemSport.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemProcessMessage : SaxDisposableHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
// Item process.
|
||||
ItemProcessInstanceId,
|
||||
// Process message.
|
||||
MessageType,
|
||||
MessageType_Desc,
|
||||
Message,
|
||||
Recorded_DateTime,
|
||||
Recorded_Date,
|
||||
Recorded_Time,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public SysId ItemProcessInstanceId { get; set; }
|
||||
public DateTime? RecordedAt { get; set; }
|
||||
public SaMessageLevel MessageType { get; set; }
|
||||
public String Message { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public SysId ItemProcessInstanceId
|
||||
{
|
||||
get { return data.ItemProcessInstanceId; }
|
||||
set { CheckChanged(data.ItemProcessInstanceId, value); data.ItemProcessInstanceId = value; }
|
||||
}
|
||||
public DateTime? RecordedAt
|
||||
{
|
||||
get { return data.RecordedAt; }
|
||||
set { CheckChangedNullable(data.RecordedAt, value); data.RecordedAt = value; }
|
||||
}
|
||||
public SaMessageLevel MessageType
|
||||
{
|
||||
get { return data.MessageType; }
|
||||
set { CheckChanged((int)data.MessageType, (int)value); data.MessageType = value; }
|
||||
}
|
||||
public String Message
|
||||
{
|
||||
get { return data.Message; }
|
||||
set { CheckChanged(data.Message, value); data.Message = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemProcessInstanceId = data.ItemProcessInstanceId;
|
||||
RecordedAt = data.RecordedAt;
|
||||
MessageType = data.MessageType;
|
||||
Message = data.Message;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue ItemProcessInstanceId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RecordedAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue MessageType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Message { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemProcessMessage(SysId id, SysId itemProcessId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemProcessInstanceId = itemProcessId;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Active,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Active; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Active) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||
if (SysId.IsValid(ItemProcessInstanceId) && SysId.ToInt(ItemProcessInstanceId) != SysId.ToInt(data.ItemProcessInstanceId))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Process Id cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public SysId ItemProcessInstanceId
|
||||
{
|
||||
get { return data.ItemProcessInstanceId; }
|
||||
protected set { data.ItemProcessInstanceId = value; }
|
||||
}
|
||||
public DateTime? RecordedAt
|
||||
{
|
||||
get { return data.RecordedAt; }
|
||||
set { data.RecordedAt = value; }
|
||||
}
|
||||
public SaMessageLevel MessageType
|
||||
{
|
||||
get { return data.MessageType; }
|
||||
set { data.MessageType = value; }
|
||||
}
|
||||
public String Message
|
||||
{
|
||||
get { return data.Message; }
|
||||
set { data.Message = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
ActiveOnly,
|
||||
InactiveOnly,
|
||||
NotDeleted,
|
||||
DeletedOnly,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> ItemProcessInstanceIdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SaMessageLevel> MessageTypesIncluded { get; } = new HashSet<SaMessageLevel>();
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxItemProcessMessageList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using static Sarand.Net.Standard.Base.Bus.SacsHierarchyItem;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// UserReport.
|
||||
//=======================================================================
|
||||
public abstract class SaxUserReport : SaxDisposableHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
UserAccountId,
|
||||
ReportType,
|
||||
ReportType_Desc,
|
||||
Title,
|
||||
Report,
|
||||
RecordedOn,
|
||||
// Associated data.
|
||||
// Common.
|
||||
Notes,
|
||||
Flags,
|
||||
Status,
|
||||
Status_Desc,
|
||||
Status_Ind,
|
||||
CreateOn_Date,
|
||||
UpdateOn_Date,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public SysId UserAccountId { get; set; }
|
||||
public Sax.UserReportType ReportType { get; set; }
|
||||
public String Title { get; set; } = String.Empty;
|
||||
public String Report { get; set; } = String.Empty;
|
||||
public DateTime RecordedOn { get; set; }
|
||||
public String ReportData { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public SysId UserAccountId
|
||||
{
|
||||
get { return data.UserAccountId; }
|
||||
set { CheckChanged(data.UserAccountId, value); data.UserAccountId = value; }
|
||||
}
|
||||
public Sax.UserReportType ReportType
|
||||
{
|
||||
get { return data.ReportType; }
|
||||
set { CheckChanged((short)data.ReportType, (short)value); data.ReportType = value; }
|
||||
}
|
||||
public String Title
|
||||
{
|
||||
get { return data.Title; }
|
||||
set { CheckChanged(data.Title, value); data.Title = value; }
|
||||
}
|
||||
public String Report
|
||||
{
|
||||
get { return data.Report; }
|
||||
set { CheckChanged(data.Report, value); data.Report = value; }
|
||||
}
|
||||
public DateTime RecordedOn
|
||||
{
|
||||
get { return data.RecordedOn; }
|
||||
set { CheckChanged(data.RecordedOn, value); data.RecordedOn = value; }
|
||||
}
|
||||
public String ReportData
|
||||
{
|
||||
get { return data.ReportData; }
|
||||
set { CheckChanged(data.ReportData, value); data.ReportData = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
UserAccountId = data.UserAccountId;
|
||||
ReportType = data.ReportType;
|
||||
Title = data.Title;
|
||||
Report = data.Report;
|
||||
RecordedOn = data.RecordedOn;
|
||||
ReportData = data.ReportData;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue UserAccountId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ReportType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Title { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Report { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RecordedOn { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ReportData { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxUserReport(SysId id, SysId userAccountId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
this.UserAccountId = userAccountId;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Preparation,
|
||||
SaStatus.InProgress,
|
||||
SaStatus.Cancelled,
|
||||
SaStatus.Closed,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Preparation; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Preparation) return DataValue.TriStateType.Yellow;
|
||||
if (status == SaStatus.InProgress) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Completed) return DataValue.TriStateType.Blue;
|
||||
if (status == SaStatus.Cancelled) return DataValue.TriStateType.Red;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public ItemId GetItemId()
|
||||
{
|
||||
return new ItemId((short)Sax.DataItemType.UserReport, Id);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} UserAccountId cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public SysId UserAccountId
|
||||
{
|
||||
get { return data.UserAccountId; }
|
||||
protected set { data.UserAccountId = value; }
|
||||
}
|
||||
public Sax.UserReportType ReportType
|
||||
{
|
||||
get { return data.ReportType; }
|
||||
set { data.ReportType = value; }
|
||||
}
|
||||
public String Title
|
||||
{
|
||||
get { return data.Title; }
|
||||
set { data.Title = value; }
|
||||
}
|
||||
public String Report
|
||||
{
|
||||
get { return data.Report; }
|
||||
set { data.Report = value; }
|
||||
}
|
||||
public DateTime RecordedOn
|
||||
{
|
||||
get { return data.RecordedOn; }
|
||||
set { data.RecordedOn = value; }
|
||||
}
|
||||
public String ReportData
|
||||
{
|
||||
get { return data.ReportData; }
|
||||
set { data.ReportData = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
Preparation,
|
||||
Open,
|
||||
Completed,
|
||||
Cancelled,
|
||||
Closed,
|
||||
NotDeleted,
|
||||
Deleted,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public List<SysId> IdsIncluded { get; } = new List<SysId>();
|
||||
public List<SysId> IdsExcluded { get; } = new List<SysId>();
|
||||
public List<SysId> UserAccountIdsIncluded { get; } = new List<SysId>();
|
||||
public List<Sax.UserReportType> ReportTypesIncluded { get; } = new List<Sax.UserReportType>();
|
||||
/// <summary>Generic filter - caption, report, or other matching value (tbd).</summary>
|
||||
public String UserReportFilter { get; set; }
|
||||
public String TitlePartial { get; set; }
|
||||
public String ReportPartial { get; set; }
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.Open;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxUserReportList
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public static SaxUserReport GetUserReportById(this IEnumerable<SaxUserReport> values, SysId userReportId)
|
||||
{
|
||||
if (!SysId.IsValid(userReportId)) return null;
|
||||
foreach (SaxUserReport userReport in values)
|
||||
if (userReport.Id.Equals(userReportId)) return userReport;
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user