Add project files.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Win.Dbas.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSystem_WinDbas : OpnSystem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Static initialisation.
|
||||
public static void InitStatics ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSystem_WinDbas (PropertySet properties) : base(properties)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// D a t a M a n a g e r s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Win.Dbas.Base
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnDatabaseConsole : SacsDatabaseConsole
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly OpnSessionContext sessionContext;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnDatabaseConsole(OpnSessionContext sessionContext)
|
||||
{
|
||||
this.sessionContext = sessionContext;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// D a t a b a s e I n d i c e s
|
||||
//-------------------------------------------------------------------
|
||||
public bool CreateDbIndices (IndexStats indexStats)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.CodeTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnCodeTypeConsole_Dbas : SaCodeTypeConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnCodeTypeConsole_Dbas(SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnUserContext UserContext { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Interfaces;
|
||||
using Sarand.Core.ItemOptions;
|
||||
using Sarand.Core.UpdateLog;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnInterfaceConsole_Dbas : SaInterfaceConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnInterfaceConsole_Dbas (OpnUserContext userContext) : base(null)
|
||||
{
|
||||
UserContext = userContext;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnUserContext UserContext { get; }
|
||||
public OpnSessionContext SessionContext { get; }
|
||||
public override short InterfaceDataType => throw new NotImplementedException();
|
||||
public override SaItemOptionConsole ItemOptionConsole => throw new NotImplementedException();
|
||||
public override SaUpdateLogConsole UpdateLogConsole => throw new NotImplementedException();
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Utilities.
|
||||
public override String GetItemTypeDesc (short itemType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override string GetItemCaption (ItemId itemId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e g i s t e r I n t e r f a c e s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n t e r f a c e A c c e s s C o n t r o l
|
||||
//-------------------------------------------------------------------
|
||||
public override bool CanCreateInterfaces ()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCreateInterfaces (string context, SaInterfaceCategory interfaceCategory)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCreateInterface (string context, SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanUpdateInterface (SaInterface interfaceObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCopyInterfaces ()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCopyInterfaces (string context, SaInterfaceCategory interfaceCategory)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCopyInterface (string context, SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanCopyInterface (SaInterface interfaceObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool IsCompatibleForInterfaceCopy (string context, SaInterfaceCategory interfaceCategory, int typeFrom, int typeTo)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool CanRemoveInterface (SaInterface interfaceObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// I n t e r f a c e E v e n t s
|
||||
//---------------------------------------------------------------
|
||||
public override void OnInterfaceCreated (SysId interfaceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override void OnInterfaceUpdated (SysId interfaceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override void OnInterfaceRemoved (SysId interfaceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.ItemOptions;
|
||||
using Sarand.Core.UpdateLog;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.ItemOptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnItemOptionConsole_Dbas : SaItemOptionConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnItemOptionConsole_Dbas (SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnUserContext UserContext {get;set;}
|
||||
public override short ItemOptionDataType => throw new NotImplementedException();
|
||||
public override SaUpdateLogConsole UpdateLogConsole => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I t e m O p t i o n D e f i n i t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
public override List<SaItemOptionDfn> GetItemOptionDfnsForItem (ItemId itemId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Sarand.Core.UpdateLog;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.ReferenceData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnReferenceDataConsole_Dbas : SaReferenceDataConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnReferenceDataConsole_Dbas (OpnUserContext userContext ,SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
UserContext = userContext;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnUserContext UserContext { get; }
|
||||
public override SaUpdateLogConsole UpdateLogConsole => throw new NotImplementedException();
|
||||
// Item types.
|
||||
public override short LanguageItemType => throw new NotImplementedException();
|
||||
public override short RegionItemType => throw new NotImplementedException();
|
||||
public override short CurrencyItemType => throw new NotImplementedException();
|
||||
public override short TaxCodeItemType => throw new NotImplementedException();
|
||||
public override short UnitMeasureItemType => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using Sarand.Core.UpdateLog;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.Security;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnSecurityConsole_Dbas : SaSecurityConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnSecurityConsole_Dbas (SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public override short SecurityItemDataType => throw new NotImplementedException();
|
||||
public override short SecurityLinkDataType => throw new NotImplementedException();
|
||||
public override SaUpdateLogConsole UpdateLogConsole => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S e c u r i t y R i g h t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// R e g i t e r S e c u r i t y R i g h t s
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Register Security Rights.
|
||||
public override void RegisterSecurityRights ()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Register the security data item types.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Security;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.UpdateLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnUpdateLogConsole_Dbas : SaUpdateLogConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnUpdateLogConsole_Dbas (SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get name for User Id.
|
||||
public override Dictionary<SysId, String> GetNameForUserIds(List<SysId> userIds)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Win.Dbas.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Win.Dbas.Data
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract class OpnDbDataItem : DbDataItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
/// <summary>
|
||||
/// Database information - object supplied by main application.
|
||||
/// <para>NB Application may have multiple databases with schema differences.</para>
|
||||
/// <para>Each instance of a DbDataItem must be database specific.</para>
|
||||
/// </summary>
|
||||
public class OpnDatabaseInfo : IDatabaseInfo
|
||||
{
|
||||
// Data members.
|
||||
private readonly List<DbDfnTable> tables;
|
||||
private static readonly String defaultSchemaName = "dbo";
|
||||
// Construction.
|
||||
public OpnDatabaseInfo(String databaseName, List<DbDfnTable> tables)
|
||||
{
|
||||
}
|
||||
// Properties.
|
||||
public String DatabaseName { get; }
|
||||
public String Context { get { return StringUtil.OnEmpty(DatabaseName, "UnknownDb"); } }
|
||||
// Database schema.
|
||||
public DbDfnTable GetTableDefinition (String schemaName, String tableName)
|
||||
{
|
||||
foreach (DbDfnTable table in tables.FindAll(item => item.Name.EqualsCI(tableName)))
|
||||
{
|
||||
if (StringUtil.OnEmpty(table.Schema, defaultSchemaName).EqualsCI(StringUtil.OnEmpty(schemaName, defaultSchemaName)))
|
||||
return table;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public bool TableExists (String schemaName, String tableName)
|
||||
{
|
||||
return GetTableDefinition(schemaName, tableName) != null;
|
||||
}
|
||||
public bool ColumnExists (String schemaName, String tableName, String columnName)
|
||||
{
|
||||
DbDfnTable table = GetTableDefinition(schemaName, tableName);
|
||||
if (table == null) return false;
|
||||
return table.HasColumnByName(columnName);
|
||||
}
|
||||
public List<DbDfnColumn> GetColumnsForTable (String schemaName, String tableName)
|
||||
{
|
||||
DbDfnTable table = GetTableDefinition(schemaName, tableName);
|
||||
if (table != null) return table.Columns;
|
||||
return new List<DbDfnColumn>();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected OpnDbDataItem (IDatabaseInfo dbInfo) : base(dbInfo)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Win.Dbas.Utils
|
||||
{
|
||||
//=======================================================================
|
||||
public static class OpnDbDfnGenerator
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static string messageBoxTitle = "OperationsMgr database definition generator";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Generate database definitions.
|
||||
/// </summary>
|
||||
public static bool Generate(String connectionString)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private static bool GenerateDatabaseDefinition(SacsDatabase database, String directory)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public static String GetOutputFolder ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Win.Dbas.Utils
|
||||
{
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Static implementations of fucntions required by FileUtil.
|
||||
/// </summary>
|
||||
public class OpnFileUtil
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Initialise statics.
|
||||
public static void InitStatics ()
|
||||
{
|
||||
FileUtil.DirectoryExists = IsDirectory;
|
||||
FileUtil.DirectoryGetParent = GetParentDirectory;
|
||||
FileUtil.DirectoryCreateDirectory = CreateDirectory;
|
||||
FileUtil.FileExists = IsFile;
|
||||
FileUtil.FileReadAllLines = FileReadAllLines;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// D i r e c t o r y
|
||||
//-------------------------------------------------------------------
|
||||
public static bool IsDirectory (String directoryPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Directory.Exists(directoryPath);
|
||||
}
|
||||
catch (Exception exc) { Logger.Debug("SbmFileUtil.IsDirectory " + exc.GetType().Name + ": " + exc.Message); }
|
||||
return false;
|
||||
}
|
||||
public static String GetParentDirectory (String filepath)
|
||||
{
|
||||
try
|
||||
{
|
||||
DirectoryInfo parentDirectoryInfo = Directory.GetParent(filepath);
|
||||
if (parentDirectoryInfo != null)
|
||||
return parentDirectoryInfo.FullName;
|
||||
}
|
||||
catch (Exception exc) { Logger.Debug("SbmFileUtil.GetParentDirectory " + exc.GetType().Name + ": " + exc.Message); }
|
||||
return String.Empty;
|
||||
}
|
||||
public static bool CreateDirectory (String directoryPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
DirectoryInfo info = Directory.CreateDirectory(directoryPath);
|
||||
return info.Exists;
|
||||
}
|
||||
catch (Exception exc) { Logger.Debug("SbmFileUtil.CreateDirectory " + exc.GetType().Name + ": " + exc.Message); }
|
||||
return false;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// F i l e
|
||||
//-------------------------------------------------------------------
|
||||
public static bool IsFile (String filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.Exists(filePath);
|
||||
}
|
||||
catch (Exception exc) { Logger.Debug("SbmFileUtil.IsFile " + exc.GetType().Name + ": " + exc.Message); }
|
||||
return false;
|
||||
}
|
||||
public static String[] FileReadAllLines (String filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.ReadAllLines(filePath);
|
||||
}
|
||||
catch (Exception exc) { Logger.Debug("SbmFileUtil.FileReadAllLines " + exc.GetType().Name + ": " + exc.Message); }
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user