92 lines
3.4 KiB
C#
92 lines
3.4 KiB
C#
using Sarand.Net.Standard.Proc.Procs;
|
|
using Saxonite.Net.Standard.Base.Mgr.Support;
|
|
using Saxonite.Net.Standard.Base.Mgr;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Saxonite.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Proc.Excel;
|
|
using Saxonite.Net.Standard.Base.Mgr.Reference;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
|
|
namespace Saxonite.Net.Standard.Base.Procs
|
|
{
|
|
//=======================================================================
|
|
public abstract class SaxProcess_Base : SaProcess
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
public new class Config : SaProcess.Config
|
|
{
|
|
protected Config(SaxSessionContext sessionContext, DbUpdateInfo dbUpdateInfo) : base(dbUpdateInfo)
|
|
{
|
|
this.SessionContext = sessionContext;
|
|
}
|
|
public SaxSessionContext SessionContext { get; }
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private SaxInternals internals;
|
|
private Config config;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
protected SaxProcess_Base(Config config) : base(config)
|
|
{
|
|
this.config = config;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
if (internals != null) internals.Dispose();
|
|
internals = null;
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
public SaxInternals Internals { get { if (internals == null) internals = new SaxInternals(config.SessionContext); return internals; } }
|
|
// Managers.
|
|
public SaxReferenceMgr ReferenceMgr { get { return Internals.ReferenceMgr; } }
|
|
public SaxAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
|
public SaxActivityMgr ActivityMgr { get { return Internals.ActivityMgr; } }
|
|
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
|
|
public SaxReferenceGolfMgr ReferenceGolfMgr { get { return Internals.ReferenceGolfMgr; } }
|
|
public SaxSupportMgr SupportMgr { get { return Internals.SupportMgr; } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Excel Spreadsheet utilities.
|
|
//-------------------------------------------------------------------
|
|
protected virtual SaMsExcelColumnHeading_Config GetExcelColumnHeadingConfig()
|
|
{
|
|
SaMsExcelColumnHeading_Config configHeading = new SaMsExcelColumnHeading_Config();
|
|
configHeading.FontAttr.Name = "Arial";
|
|
configHeading.FontAttr.HeightInPoints = 10;
|
|
configHeading.FontAttr.ColourIndex = SaXlColourIndex.DarkBlue;
|
|
configHeading.FontAttr.Bold = true;
|
|
configHeading.HeadingTextWrap = true;
|
|
configHeading.ForegroundColourIndex = SaXlColourIndex.LightYellow;
|
|
configHeading.BorderWeight = SaXlBorderWeight.Medium;
|
|
return configHeading;
|
|
}
|
|
|
|
protected virtual SaMsExcelStyleAttr GetExcelDefaultWorkbookStyle()
|
|
{
|
|
SaMsExcelStyleAttr styleAttr = new SaMsExcelStyleAttr();
|
|
styleAttr.FontAttr.Name = "Arial";
|
|
styleAttr.FontAttr.HeightInPoints = 9;
|
|
styleAttr.FontAttr.ColourIndex = SaXlColourIndex.Black;
|
|
styleAttr.HorizontalAlignment = (short)XlHAlign.xlHAlignLeft;
|
|
styleAttr.VerticalAlignment = (short)XlVAlign.xlVAlignTop;
|
|
styleAttr.WrapText = true;
|
|
return styleAttr;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|