Session data.
This commit is contained in:
@@ -16,9 +16,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SbmAccountMgr accountMgr = null;
|
||||
private SaInterfaceConsole interfaceConsole;
|
||||
private SaUpdateLogConsole updateLogConsole;
|
||||
private SbmInternals internals;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -30,8 +28,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (accountMgr != null) accountMgr.Dispose(); accountMgr = null;
|
||||
if (updateLogConsole != null) updateLogConsole.Dispose(); updateLogConsole = null;
|
||||
if (internals != null) internals.Dispose(); internals = null;
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
@@ -40,27 +37,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
// Properties.
|
||||
public ISbmUserOrganisationContext UserContext { get; set; }
|
||||
public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } }
|
||||
private SbmInternals Internals { get { if (internals == null) { internals = new SbmInternals(UserContext); } return internals; } }
|
||||
public override short ItemOptionDataType { get { return (short)Sbm.ItemType.ItemOption; } }
|
||||
private SbmAccountMgr AccountMgr { get { if (accountMgr == null) accountMgr = SbmGlobals.System.CreateAccountMgr(UserContext); return accountMgr; } }
|
||||
private SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
||||
// Consoles.
|
||||
public SaInterfaceConsole InterfaceConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (interfaceConsole == null)
|
||||
interfaceConsole = SbmGlobals.Application.CreateInterfaceConsole(UserContext);
|
||||
return interfaceConsole;
|
||||
}
|
||||
}
|
||||
public override SaUpdateLogConsole UpdateLogConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (updateLogConsole == null)
|
||||
updateLogConsole = SbmGlobals.Application.CreateUpdateLogConsole(UserContext);
|
||||
return updateLogConsole;
|
||||
}
|
||||
}
|
||||
public SaInterfaceConsole InterfaceConsole { get { return Internals.InterfaceConsole; } }
|
||||
public override SaUpdateLogConsole UpdateLogConsole { get { return Internals.UpdateLogConsole; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I t e m O p t i o n D e f i n i t i o n s
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SaUpdateLogConsole updateLogConsole;
|
||||
private SbmInternals internals;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -24,15 +24,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (updateLogConsole != null) updateLogConsole.Dispose(); updateLogConsole = null;
|
||||
if (internals != null) internals.Dispose(); internals = null;
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public SbmSessionContext SessionContext { get; }
|
||||
public ISbmUserOrganisationContext UserContext { get; }
|
||||
public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } }
|
||||
private SbmInternals Internals { get { if (internals == null) { internals = new SbmInternals(UserContext); } return internals; } }
|
||||
// Item types.
|
||||
public override short LanguageItemType { get { return (short)Sbm.ItemDataType.Unknown; } }
|
||||
public override short RegionItemType { get { return (short)Sbm.ItemDataType.Region; } }
|
||||
@@ -40,15 +41,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
public override short TaxCodeItemType { get { return (short)Sbm.ItemDataType.Unknown; } }
|
||||
public override short UnitMeasureItemType { get { return (short)Sbm.ItemDataType.Unknown; } }
|
||||
// Consoles.
|
||||
public override SaUpdateLogConsole UpdateLogConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (updateLogConsole == null)
|
||||
updateLogConsole = SbmGlobals.Application.CreateUpdateLogConsole(UserContext);
|
||||
return updateLogConsole;
|
||||
}
|
||||
}
|
||||
public override SaUpdateLogConsole UpdateLogConsole { get { return Internals.UpdateLogConsole; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
if ((fullList || bValidTransType) && SessionConsole.AllowTransactionType(transType))
|
||||
{
|
||||
// Retrieve status categories for transaction type:
|
||||
foreach (TypeCodeDesc transactionStatus in GetTransactionStatusCats(transType))
|
||||
foreach (TypeCodeDesc transactionStatus in SbmTransaction.GetTransactionStatusCats(transType))
|
||||
{
|
||||
SbmTransaction.StatusCat transStatusCat = (SbmTransaction.StatusCat)transactionStatus.Type;
|
||||
String sDesc = transactionType.Desc + " - " + transactionType.Desc;
|
||||
@@ -146,43 +146,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status Cats
|
||||
private List<TypeCodeDesc> GetTransactionStatusCats(Sbm.TransactionType eType)
|
||||
{
|
||||
List<TypeCodeDesc> transactionStatusCats = new List<TypeCodeDesc>();
|
||||
List<TypeCodeDesc> transactionStatusCatsAllowed = Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat);
|
||||
switch (eType)
|
||||
{
|
||||
// NB Changes here may also need to be made in SapTransaction::GetTaxEffectiveDate()
|
||||
// and SapphireConsole::UseInProgressTaxDateAsTaxPoint():
|
||||
// Transaction types that have no 'Pending' stage:
|
||||
case Sbm.TransactionType.SalesLead:
|
||||
transactionStatusCats.AddRange(transactionStatusCatsAllowed.Where(item => item.Type == (int)SbmTransaction.StatusCat.Open || item.Type == (int)SbmTransaction.StatusCat.Closed));
|
||||
break;
|
||||
// Transaction types that have no 'Open' stage:
|
||||
case Sbm.TransactionType.ProformaSalesOrder:
|
||||
case Sbm.TransactionType.SalesDispatch:
|
||||
case Sbm.TransactionType.ProformaPurchaseOrder:
|
||||
case Sbm.TransactionType.PurchaseDelivery:
|
||||
case Sbm.TransactionType.ProformaSalesInvoice:
|
||||
transactionStatusCats.AddRange(transactionStatusCatsAllowed.Where(item => item.Type == (int)SbmTransaction.StatusCat.Pending || item.Type == (int)SbmTransaction.StatusCat.Closed));
|
||||
break;
|
||||
default:
|
||||
// All other types have the complete set:
|
||||
transactionStatusCats = transactionStatusCatsAllowed;
|
||||
break;
|
||||
}
|
||||
return transactionStatusCats;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Status Id.
|
||||
// TRansaction Status Id.
|
||||
private SysId GetTransactionTypeStatusId(Sbm.TransactionType transactionType, SbmTransaction.StatusCat transactionStatusCat)
|
||||
{
|
||||
return new SysId(((int)transactionType * 100) + (int)transactionStatusCat);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// R e g i t e r S e c u r i t y R i g h t s
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SaSecurityConsole securityConsole;
|
||||
private SbmInternals internals;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -27,7 +27,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (securityConsole != null) securityConsole.Dispose(); securityConsole = null;
|
||||
if (internals != null) internals.Dispose(); internals = null;
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
@@ -36,16 +36,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles
|
||||
// Properties.
|
||||
public ISbmUserOrganisationContext UserContext { get; }
|
||||
public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } }
|
||||
private SbmInternals Internals { get { if (internals == null) { internals = new SbmInternals(UserContext); } return internals; } }
|
||||
// Consoles.
|
||||
public SaSecurityConsole SecurityConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (securityConsole == null)
|
||||
securityConsole = SbmGlobals.Application.CreateSecurityConsole(UserContext);
|
||||
return securityConsole;
|
||||
}
|
||||
}
|
||||
public SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get name for User Id.
|
||||
|
||||
Reference in New Issue
Block a user