76 lines
2.7 KiB
C#
76 lines
2.7 KiB
C#
using Sarand.BusinessMgr.Net.Core.Web.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
|
using Sarand.BusinessMgr.Net.Standard.Dbas.Consoles;
|
|
using Sarand.BusinessMgr.Web.Control.App;
|
|
using Sarand.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using Sarand.Net.Standard.Base.Security;
|
|
using Sarand.Net.Standard.Base.Utils;
|
|
using Sarand.Net.Standard.Dbas.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Sarand.BusinessMgr.Web.Control.Consoles
|
|
{
|
|
//=======================================================================
|
|
public class SbmCoreInstanceConsole_Control : SbmCoreInstanceConsole_Dbas
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private class DataMembers
|
|
{
|
|
public SysId OwnerId { get; set; }
|
|
public SysId RepositoryId { get; set; }
|
|
public SbmInternals Internals { get; set; }
|
|
}
|
|
private DataMembers mbr { get; }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmCoreInstanceConsole_Control(SbmSessionData_Control sessionData_Control, SbmcRepository repository)
|
|
{
|
|
mbr = new DataMembers();
|
|
mbr.OwnerId = repository.OwnerId;
|
|
mbr.RepositoryId = repository.Id;
|
|
this.SessionData_Control = sessionData_Control;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
if (mbr.Internals != null) mbr.Internals.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
private static SbmApplication_Control App_Control { get { return SbmApplication_Control.Instance; } }
|
|
private SbmSessionData_Control SessionData_Control { get; }
|
|
public override SbmInternals Internals { get { if (mbr.Internals == null) { mbr.Internals = CreateCoreInternals(); } return mbr.Internals; } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Utilities.
|
|
|
|
/// <summary>Core internals for accessing core managers etc.</summary>
|
|
protected SbmInternals CreateCoreInternals()
|
|
{
|
|
ushort sessionIndex = App_Control.GetCoreSessionIndexForControlRepository(mbr.OwnerId, mbr.RepositoryId);
|
|
SbmSessionContext sessionContext = App_Control.GetSessionContextByIndex(sessionIndex);
|
|
return new SbmInternals(sessionContext);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|