92 lines
3.4 KiB
C#
92 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
|
|
namespace Sarand.Net.Standard.Base.UpdateLog
|
|
{
|
|
//=======================================================================
|
|
// Definitions.
|
|
|
|
//=======================================================================
|
|
public abstract class SaUpdateLogConsole : SacsDisposableStateItem
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Static initialisation
|
|
static SaUpdateLogConsole ()
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Protected construction - use derived classes.
|
|
protected SaUpdateLogConsole ()
|
|
{
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
public abstract bool DatabaseIsValid { get; }
|
|
public abstract bool CanUpdateDatabase { get; }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Utilities - retrieve application data.
|
|
public abstract Dictionary<SysId, String> GetNameForUserIds (List<SysId> userIds);
|
|
|
|
//-------------------------------------------------------------------
|
|
// Update Log Form.
|
|
public class ShowUpdateLogConfig
|
|
{
|
|
public ShowUpdateLogConfig(ItemId itemId, String itemCaption, DbUpdateInfo dbUpdateInfo)
|
|
{
|
|
ItemId = itemId;
|
|
ItemCaption = itemCaption;
|
|
DbUpdateInfo = dbUpdateInfo;
|
|
}
|
|
public ItemId ItemId { get; }
|
|
public String ItemCaption { get; }
|
|
public DbUpdateInfo DbUpdateInfo { get; }
|
|
}
|
|
public abstract bool ShowUpdateLogDialog (ShowUpdateLogConfig config);
|
|
|
|
//*******************************************************************
|
|
// U p d a t e L o g E n t r i e s
|
|
//*******************************************************************
|
|
// Log updates.
|
|
public abstract bool LogUpdates (SaUpdateLogItemMonitor updateLogItemMonitor);
|
|
|
|
//-------------------------------------------------------------------
|
|
// Retrieve list of updates that match the specified params:
|
|
public abstract bool ItemHasLogEntries (ItemId itemId);
|
|
public abstract bool LogEntriesExist (SaUpdateLogEntry.Params prmUpdateLog);
|
|
public abstract SaUpdateLogEntry GetLogEntry (ItemId itemId, String attrName, DateTime loggedAt);
|
|
public abstract long GetLogEntryCount (SaUpdateLogEntry.Params prmUpdateLog);
|
|
public abstract List<SaUpdateLogEntry> GetLogEntries (SaUpdateLogEntry.Params prmUpdateLog);
|
|
|
|
//-------------------------------------------------------------------
|
|
// Create a new item data.
|
|
public abstract SaUpdateLogEntry CreateLogEntry (ItemId itemId, String attrName);
|
|
|
|
//-------------------------------------------------------------------
|
|
// Store item data.
|
|
public abstract bool StoreLogEntry (SaUpdateLogEntry logEntry, DbUpdateInfo dbUpdateInfo);
|
|
public abstract bool RemoveLogEntry (SaUpdateLogEntry logEntry, DbUpdateInfo dbUpdateInfo);
|
|
public abstract bool ClearLogEntriesForItem (ItemId itemId, DbUpdateInfo dbUpdateInfo);
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|