Add project files.
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.852
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOperationsMgrService", "SaOperationsMgrService\SaOperationsMgrService.csproj", "{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOperationsMgr", "SaOperationsMgr\SaOperationsMgr.csproj", "{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOpnMgrCore", "SaOpnMgrCore\SaOpnMgrCore.csproj", "{9EAC4DD6-D3C8-4966-B1BE-B0D2CE17F012}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOpnMgrProcs", "SaOpnMgrProcs\SaOpnMgrProcs.csproj", "{12783700-F1BA-4D24-9B0E-9C8A7C5FF621}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOpnMgrUnitTests", "SaOpnMgrUnitTests\SaOpnMgrUnitTests.csproj", "{9D35BDDA-C694-4F92-BFE0-37A3328B8E34}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOpnMgrWinDbas", "SaOpnMgrWinDbas\SaOpnMgrWinDbas.csproj", "{69618253-2FBF-4E3D-9E33-A4FF262B8989}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOpnMgrWinForms", "SaOpnMgrWinForms\SaOpnMgrWinForms.csproj", "{8ABE1772-7B75-46FB-9615-0E595081C362}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SacsCoreBase", "..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj", "{3311B502-54F1-457A-9108-6F33C83B9EB1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SacsWinDbas", "..\..\Common-C#\Workspace\SacsWinDbas\SacsWinDbas.csproj", "{86E11448-66DF-4EB6-922F-C84E220608AD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SacsWinForms", "..\..\Common-C#\Workspace\SacsWinForms\SacsWinForms.csproj", "{18353651-1F1A-4B23-91FB-BDB9AA56BC57}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SacsWinOffice", "..\..\Common-C#\Workspace\SacsWinOffice\SacsWinOffice.csproj", "{E9106099-66B4-42DB-AF28-C34CF1AFF2AA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaOperationsMgrWeb", "SaOperationsMgrWeb\SaOperationsMgrWeb.csproj", "{BAEA9717-20F8-4519-93CB-19F4B75D5913}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9EAC4DD6-D3C8-4966-B1BE-B0D2CE17F012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9EAC4DD6-D3C8-4966-B1BE-B0D2CE17F012}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EAC4DD6-D3C8-4966-B1BE-B0D2CE17F012}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9EAC4DD6-D3C8-4966-B1BE-B0D2CE17F012}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{12783700-F1BA-4D24-9B0E-9C8A7C5FF621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{12783700-F1BA-4D24-9B0E-9C8A7C5FF621}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{12783700-F1BA-4D24-9B0E-9C8A7C5FF621}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{12783700-F1BA-4D24-9B0E-9C8A7C5FF621}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9D35BDDA-C694-4F92-BFE0-37A3328B8E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9D35BDDA-C694-4F92-BFE0-37A3328B8E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9D35BDDA-C694-4F92-BFE0-37A3328B8E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9D35BDDA-C694-4F92-BFE0-37A3328B8E34}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{69618253-2FBF-4E3D-9E33-A4FF262B8989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{69618253-2FBF-4E3D-9E33-A4FF262B8989}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69618253-2FBF-4E3D-9E33-A4FF262B8989}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69618253-2FBF-4E3D-9E33-A4FF262B8989}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8ABE1772-7B75-46FB-9615-0E595081C362}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8ABE1772-7B75-46FB-9615-0E595081C362}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8ABE1772-7B75-46FB-9615-0E595081C362}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8ABE1772-7B75-46FB-9615-0E595081C362}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3311B502-54F1-457A-9108-6F33C83B9EB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3311B502-54F1-457A-9108-6F33C83B9EB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3311B502-54F1-457A-9108-6F33C83B9EB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3311B502-54F1-457A-9108-6F33C83B9EB1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86E11448-66DF-4EB6-922F-C84E220608AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86E11448-66DF-4EB6-922F-C84E220608AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86E11448-66DF-4EB6-922F-C84E220608AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86E11448-66DF-4EB6-922F-C84E220608AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{18353651-1F1A-4B23-91FB-BDB9AA56BC57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{18353651-1F1A-4B23-91FB-BDB9AA56BC57}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{18353651-1F1A-4B23-91FB-BDB9AA56BC57}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{18353651-1F1A-4B23-91FB-BDB9AA56BC57}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E9106099-66B4-42DB-AF28-C34CF1AFF2AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E9106099-66B4-42DB-AF28-C34CF1AFF2AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E9106099-66B4-42DB-AF28-C34CF1AFF2AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E9106099-66B4-42DB-AF28-C34CF1AFF2AA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BAEA9717-20F8-4519-93CB-19F4B75D5913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BAEA9717-20F8-4519-93CB-19F4B75D5913}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BAEA9717-20F8-4519-93CB-19F4B75D5913}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BAEA9717-20F8-4519-93CB-19F4B75D5913}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {88D59C77-AD23-4FCA-9184-F23FBEB75FF9}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.CodeTypes;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnCodeTypeConsole_App : OpnCodeTypeConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnCodeTypeConsole_App(SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Code Types dialog.
|
||||
protected override MaintainCodeTypesFunction MaintainCodeTypesFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Interfaces;
|
||||
using Sarand.Core.ItemOptions;
|
||||
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 class OpnInterfaceConsole_App : OpnInterfaceConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnInterfaceConsole_App (OpnUserContext userContext) : base(userContext)
|
||||
{
|
||||
}
|
||||
|
||||
// Method to display Interfaces dialog.
|
||||
protected override MaintainInterfacesFunction MaintainInterfacesFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Interface item option definitions.
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SysId interfaceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool AreMultipleInterfaceInstancesAllowed (string context, SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool AreMultipleActiveInterfacesAllowed (string context, SaInterfaceCategory interfaceCategory)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P r o c e s s i n g O p t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P r o c e s s I n t e r f a c e
|
||||
//-------------------------------------------------------------------
|
||||
public override bool CanProcessInterface (SaInterface interfaceObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool ProcessInterface (SaInterface interfaceObj, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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 class OpnItemOptionConsole_App : OpnItemOptionConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnItemOptionConsole_App(SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowItemOptionsDialogFunction ShowItemOptionsDialogFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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 class OpnReferenceDataConsole_App : OpnReferenceDataConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnReferenceDataConsole_App(OpnUserContext userContext, SacsDatabase database) : base (userContext, database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Reference Data dialog.
|
||||
protected override MaintainReferenceDataFunction MaintainReferenceDataFn => throw new NotImplementedException();
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using Sarand.Win.Dbas.Security;
|
||||
|
||||
namespace Sarand.OperationsMgr.App.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSecurityConsole_App : OpnSecurityConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSecurityConsole_App(SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security events.
|
||||
protected override bool OnLogin (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
protected override void OnLogout ()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management form.
|
||||
protected override ShowManageSecurityDialogFunction ShowManageSecurityDialogFn => throw new NotImplementedException();
|
||||
// Method to display User Login form.
|
||||
protected override ShowUserLoginFormFunction ShowUserLoginFormFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public override bool OnUserModified (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool OnSecurityGroupModified (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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 class OpnUpdateLogConsole_App : OpnUpdateLogConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnUpdateLogConsole_App(SacsDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowUpdateLogDialogFunction ShowUpdateLogDialogFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSessionContext_Desktop : OpnSessionContext
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSessionContext_Desktop (ushort index) :
|
||||
base(index)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SaOperationsMgr
|
||||
{
|
||||
//=======================================================================
|
||||
static class Program
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main ()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Sarand.Core.Base;
|
||||
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.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaOperationsMgrApp : SacsStateItem, IDisposable
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static SaOperationsMgrApp app = null;
|
||||
private readonly PropertySet properties;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaOperationsMgrApp(String initialLogMessage)
|
||||
{
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnSessionContext SessionContext { get; private set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n s t a n c e
|
||||
//-------------------------------------------------------------------
|
||||
public static SaOperationsMgrApp getInstance ()
|
||||
{
|
||||
return app;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e f r e s h
|
||||
//-------------------------------------------------------------------
|
||||
public void RefreshFrontEnd()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// G l o b a l s
|
||||
//-------------------------------------------------------------------
|
||||
private void InitGlobals ()
|
||||
{
|
||||
}
|
||||
private SacsDatabase OpenDatabase ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void DeinitGlobals()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
namespace SaOperationsMgr
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent ()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SaOperationsMgr
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1 ()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SaOperationsMgr")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SaOperationsMgr")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f59f6aeb-6611-4f71-a211-d64f98a1a8ac")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Sarand.OperationsMgr.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sarand.OperationsMgr.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Sarand.OperationsMgr.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F59F6AEB-6611-4F71-A211-D64F98A1A8AC}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Sarand.OperationsMgr</RootNamespace>
|
||||
<AssemblyName>SaOperationsMgr</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App\Consoles\OpnUpdateLogConsole_App.cs" />
|
||||
<Compile Include="App\Consoles\OpnSecurityConsole_App.cs" />
|
||||
<Compile Include="App\Consoles\OpnReferenceDataConsole_App.cs" />
|
||||
<Compile Include="App\Consoles\OpnItemOptionConsole_App.cs" />
|
||||
<Compile Include="App\Consoles\OpnInterfaceConsole_App.cs" />
|
||||
<Compile Include="App\Consoles\OpnCodeTypeConsole_App.cs" />
|
||||
<Compile Include="App\OpnSessionContext_Desktop.cs" />
|
||||
<Compile Include="App\SaOperationsMgrApp.cs" />
|
||||
<Compile Include="Forms\SaOperationsMgrForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\SaOperationsMgrForm.Designer.cs">
|
||||
<DependentUpon>SaOperationsMgrForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="App\Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Docs\" />
|
||||
<Folder Include="Forms\Panels\" />
|
||||
<Folder Include="Resources\ico\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj">
|
||||
<Project>{3311b502-54f1-457a-9108-6f33c83b9eb1}</Project>
|
||||
<Name>SacsCoreBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsWinDbas\SacsWinDbas.csproj">
|
||||
<Project>{86e11448-66df-4eb6-922f-c84e220608ad}</Project>
|
||||
<Name>SacsWinDbas</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsWinForms\SacsWinForms.csproj">
|
||||
<Project>{18353651-1f1a-4b23-91fb-bdb9aa56bc57}</Project>
|
||||
<Name>SacsWinForms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsWinOffice\SacsWinOffice.csproj">
|
||||
<Project>{e9106099-66b4-42db-af28-c34cf1aff2aa}</Project>
|
||||
<Name>SacsWinOffice</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrCore\SaOpnMgrCore.csproj">
|
||||
<Project>{9eac4dd6-d3c8-4966-b1be-b0d2ce17f012}</Project>
|
||||
<Name>SaOpnMgrCore</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrProcs\SaOpnMgrProcs.csproj">
|
||||
<Project>{12783700-f1ba-4d24-9b0e-9c8a7c5ff621}</Project>
|
||||
<Name>SaOpnMgrProcs</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrWinDbas\SaOpnMgrWinDbas.csproj">
|
||||
<Project>{69618253-2fbf-4e3d-9e33-a4ff262b8989}</Project>
|
||||
<Name>SaOpnMgrWinDbas</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrWinForms\SaOpnMgrWinForms.csproj">
|
||||
<Project>{8abe1772-7b75-46fb-9615-0e595081c362}</Project>
|
||||
<Name>SaOpnMgrWinForms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if not exist "$(SolutionDir)..\Bin" (
|
||||
echo Creating '$(SolutionDir)..\Bin' folder.
|
||||
mkdir "$(SolutionDir)..\Bin"
|
||||
)
|
||||
if not exist "$(SolutionDir)..\Bin\$(ConfigurationName)" (
|
||||
echo Creating '$(SolutionDir)..\Bin\$(ConfigurationName)' folder.
|
||||
mkdir "$(SolutionDir)..\Bin\$(ConfigurationName)"
|
||||
)
|
||||
copy /y "$(TargetDir)*.dll" "$(SolutionDir)..\Bin\$(ConfigurationName)\"
|
||||
copy /y "$(TargetDir)*.exe" "$(SolutionDir)..\Bin\$(ConfigurationName)\"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SaOperationsMgrService")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SaOperationsMgrService")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("cf3ef668-a2e2-43a9-b341-9be4dc6dc6af")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{CF3EF668-A2E2-43A9-B341-9BE4DC6DC6AF}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Sarand.OperationsMgr</RootNamespace>
|
||||
<AssemblyName>SaOperationsMgrService</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Service\App\OpnServiceApp.cs" />
|
||||
<Compile Include="Service\App\OpnServiceConfig.cs" />
|
||||
<Compile Include="Service\App\OpnSessionContext_Service.cs" />
|
||||
<Compile Include="Service\App\OpnSystem_Service.cs" />
|
||||
<Compile Include="Service\App\SaOperationsMgrService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Service\App\SaOperationsMgrService.Designer.cs">
|
||||
<DependentUpon>SaOperationsMgrService.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\App\Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Service\Consoles\OpnCodeTypeConsole_Service.cs" />
|
||||
<Compile Include="Service\Consoles\OpnInterfaceConsole_Service.cs" />
|
||||
<Compile Include="Service\Consoles\OpnItemOptionConsole_Service.cs" />
|
||||
<Compile Include="Service\Consoles\OpnReferenceDataConsole_Service.cs" />
|
||||
<Compile Include="Service\Consoles\OpnSecurityConsole_Service.cs" />
|
||||
<Compile Include="Service\Consoles\OpnUpdateLogConsole_Service.cs" />
|
||||
<Compile Include="Service\Data\OpnHttpRequestData.cs" />
|
||||
<Compile Include="Service\Data\OpnHttpResponseData.cs" />
|
||||
<Compile Include="Service\Data\OpnRequestConfigData.cs" />
|
||||
<Compile Include="Service\Data\OpnWebServiceData.cs" />
|
||||
<Compile Include="Service\Handlers\OpnHttpRequestHandler.cs" />
|
||||
<Compile Include="Service\Handlers\OpnWebServiceRequestHandler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\ico\" />
|
||||
<Folder Include="Service\Action\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsCoreBase\SacsCoreBase.csproj">
|
||||
<Project>{3311b502-54f1-457a-9108-6f33c83b9eb1}</Project>
|
||||
<Name>SacsCoreBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsWinDbas\SacsWinDbas.csproj">
|
||||
<Project>{86e11448-66df-4eb6-922f-c84e220608ad}</Project>
|
||||
<Name>SacsWinDbas</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common-C#\Workspace\SacsWinOffice\SacsWinOffice.csproj">
|
||||
<Project>{e9106099-66b4-42db-af28-c34cf1aff2aa}</Project>
|
||||
<Name>SacsWinOffice</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrCore\SaOpnMgrCore.csproj">
|
||||
<Project>{9eac4dd6-d3c8-4966-b1be-b0d2ce17f012}</Project>
|
||||
<Name>SaOpnMgrCore</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrProcs\SaOpnMgrProcs.csproj">
|
||||
<Project>{12783700-f1ba-4d24-9b0e-9c8a7c5ff621}</Project>
|
||||
<Name>SaOpnMgrProcs</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SaOpnMgrWinDbas\SaOpnMgrWinDbas.csproj">
|
||||
<Project>{69618253-2fbf-4e3d-9e33-a4ff262b8989}</Project>
|
||||
<Name>SaOpnMgrWinDbas</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if not exist "$(SolutionDir)..\Bin" (
|
||||
echo Creating '$(SolutionDir)..\Bin' folder.
|
||||
mkdir "$(SolutionDir)..\Bin"
|
||||
)
|
||||
if not exist "$(SolutionDir)..\Bin\Service" (
|
||||
echo Creating '$(SolutionDir)..\Bin\Service' folder.
|
||||
mkdir "$(SolutionDir)..\Bin\Service"
|
||||
)
|
||||
if not exist "$(SolutionDir)..\Bin\Service\$(ConfigurationName)" (
|
||||
echo Creating '$(SolutionDir)..\Bin\Service\$(ConfigurationName)' folder.
|
||||
mkdir "$(SolutionDir)..\Bin\Service\$(ConfigurationName)"
|
||||
)
|
||||
copy /y "$(TargetDir)*.dll" "$(SolutionDir)..\Bin\Service\$(ConfigurationName)\"
|
||||
copy /y "$(TargetDir)*.exe" "$(SolutionDir)..\Bin\Service\$(ConfigurationName)\"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,61 @@
|
||||
using Sarand.Core.Base;
|
||||
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.Service.App
|
||||
{
|
||||
//======================================================================
|
||||
public class OpnServiceApp : SacsStateItem, IDisposable
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static OpnServiceApp app;
|
||||
private PropertySet properties;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnServiceApp (String initialLogMessage)
|
||||
{
|
||||
}
|
||||
public void Dispose ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnSessionContext SessionContext { get; }
|
||||
public SacsDatabase Database { get; private set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n s t a n c e
|
||||
//-------------------------------------------------------------------
|
||||
public static OpnServiceApp GetInstance ()
|
||||
{
|
||||
return app;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// G l o b a l s
|
||||
//-------------------------------------------------------------------
|
||||
private void InitGlobals ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void DeinitGlobals ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// D a t a b a s e
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//======================================================================
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using Sarand.Core.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnServiceConfig
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public class ProcessSchedule
|
||||
{
|
||||
public int TimerMins { get; set; } = 0;
|
||||
public String TimeFrom { get; set; } = "";
|
||||
public String TimeTo { get; set; } = "";
|
||||
}
|
||||
public enum WebServiceType { Internal = 10, External = 20 };
|
||||
public class WebService
|
||||
{
|
||||
public WebService (WebServiceType type)
|
||||
{
|
||||
this.ServiceType = type;
|
||||
}
|
||||
public WebServiceType ServiceType { get; }
|
||||
public bool Enabled { get; set; }
|
||||
public int HttpListenerPort { get; set; } = 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly String logTab = " ";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Load configuration.
|
||||
public void LoadFromProperties (PropertySet properties)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void ConfigureWebService (WebService webService, PropertySet properties)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
//=======================================================================
|
||||
class OpnSessionContext_Service : OpnSessionContext
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSessionContext_Service (ushort sessionContentIndex) :
|
||||
base(sessionContentIndex)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Win.Dbas.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSystem_Service : OpnSystem_WinDbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSystem_Service (PropertySet properties) :
|
||||
base(properties)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
//=======================================================================
|
||||
static class Program
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Service entry point</summary>
|
||||
static void Main ()
|
||||
{
|
||||
ServiceBase[] ServicesToRun;
|
||||
ServicesToRun = new ServiceBase[]
|
||||
{
|
||||
new SaOperationsMgrService()
|
||||
};
|
||||
ServiceBase.Run(ServicesToRun);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
partial class SaOperationsMgrService
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent ()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
this.ServiceName = "Service1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.App
|
||||
{
|
||||
public partial class SaOperationsMgrService : ServiceBase
|
||||
{
|
||||
public SaOperationsMgrService ()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnStart (string[] args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnStop ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnCodeTypeConsole_Service : OpnCodeTypeConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnCodeTypeConsole_Service (SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Code Types dialog.
|
||||
protected override MaintainCodeTypesFunction MaintainCodeTypesFn { get { return null; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Interfaces;
|
||||
using Sarand.Core.ItemOptions;
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnInterfaceConsole_Service : OpnInterfaceConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnInterfaceConsole_Service (OpnUserContext userContext, SacsDatabase database) :
|
||||
base(userContext)
|
||||
{
|
||||
Database = database;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
internal SacsDatabase Database { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Interface management form.
|
||||
protected override MaintainInterfacesFunction MaintainInterfacesFn { get { return null; } }
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Interface item option definitions.
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SysId interfaceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n t e r f a c e A c c e s s C o n t r o l
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// P r o c e s s i n g O p t i o n s
|
||||
//---------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// P r o c e s s I n t e r f a c e
|
||||
//---------------------------------------------------------------
|
||||
/// <summary>Interface can only be 'processed' if it defines processing options.</summary>
|
||||
public override bool CanProcessInterface (SaInterface interfaceObj)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
/// <summary>Popup form to select options for processing interface.</summary>
|
||||
public override bool ProcessInterface (SaInterface interfaceObj, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool AreMultipleInterfaceInstancesAllowed (string context, SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool AreMultipleActiveInterfacesAllowed (string context, SaInterfaceCategory interfaceCategory)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnItemOptionConsole_Service : OpnItemOptionConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnItemOptionConsole_Service (OpnUserContext userContext, SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowItemOptionsDialogFunction ShowItemOptionsDialogFn { get { return null; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnReferenceDataConsole_Service : OpnReferenceDataConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnReferenceDataConsole_Service (OpnUserContext userContext, SacsDatabase database) :
|
||||
base(userContext, database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Reference Data Maintenance form.
|
||||
protected override MaintainReferenceDataFunction MaintainReferenceDataFn { get { return null; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
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.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSecurityConsole_Service : OpnSecurityConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSecurityConsole_Service(OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security events.
|
||||
protected override bool OnLogin (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
protected override void OnLogout ()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to show User Login form.
|
||||
protected override ShowUserLoginFormFunction ShowUserLoginFormFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management form.
|
||||
protected override ShowManageSecurityDialogFunction ShowManageSecurityDialogFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public override bool OnUserModified (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool OnSecurityGroupModified (SysId userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Service.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnUpdateLogConsole_Service : OpnUpdateLogConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnUpdateLogConsole_Service(OpnUserContext userContext, SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowUpdateLogDialogFunction ShowUpdateLogDialogFn => throw new NotImplementedException();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Data
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnHttpRequestData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnHttpRequestData (long instanceId, HttpListenerRequest request)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Data
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnHttpResponseData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public void Reset ()
|
||||
{
|
||||
}
|
||||
public void SetStatus (HttpStatusCode httpStatus, String description = "")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Data
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnRequestConfigData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
public class ContextData
|
||||
{
|
||||
}
|
||||
public class FilterData
|
||||
{
|
||||
}
|
||||
public class SortColumnData
|
||||
{
|
||||
}
|
||||
public class ListData
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// F i l t e r
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
// Filter SysId lists.
|
||||
//-------------------------------------------------------------------
|
||||
// Filter StatusCat.
|
||||
//-------------------------------------------------------------------
|
||||
// Filter Results paging.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I t e m C o l u m n s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S o r t C o l u m n s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Sort Column list extensions methods.
|
||||
/// </summary>
|
||||
public static class SortColumnList
|
||||
{
|
||||
/// <summary>
|
||||
/// Convert each sort column to its string representation: [ColumnName] [ASC|DESC]
|
||||
/// </summary>
|
||||
public static List<String> GetSortColumns ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Office.Xml;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Data
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnWebServiceData : SacsDisposable
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SaMsXmlDocument requestDoc = null;
|
||||
private SaMsXmlDocument responseDataDoc = null;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnWebServiceData (OpnSessionContext sessionContext)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
}
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (requestDoc != null) requestDoc.Dispose();
|
||||
if (responseDataDoc != null) responseDataDoc.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnSessionContext SessionContext { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e s p o n s e D o c
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// M e s s a g e s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Handlers
|
||||
{
|
||||
//=======================================================================
|
||||
// Ref. http://stackoverflow.com/questions/5895063/asynchronous-httplistener-problem-each-request-is-received-twice
|
||||
//=======================================================================
|
||||
public class HttpListenerCallbackState
|
||||
{
|
||||
public HttpListenerCallbackState (HttpListener listener)
|
||||
{
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
public class OpnHttpRequestHandler
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Configure the listener.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Start the listener.
|
||||
public void ListenAsynchronously ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Stop the listener.
|
||||
public void StopListening ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void Listen (object state)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// L i s t e n e r E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
private void ListenerCallback (IAsyncResult ar)
|
||||
{
|
||||
}
|
||||
private void HandleHttpRequest (HttpListenerContext context, long requestNumber)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Intercept requests for static resources and respond with 'Not Found'.</summary>
|
||||
private bool IsStaticResourceUnavailable (HttpListenerRequest request)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Sarand.OperationsMgr.Service.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Service.Handlers
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnWebServiceRequestHandler
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnWebServiceRequestHandler ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// W e b S e r v i c e R e q u e s t
|
||||
//-------------------------------------------------------------------
|
||||
public bool DoWebServiceRequest (long requestNumber, HttpListenerContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// H a n d l e R e q u e s t
|
||||
//-------------------------------------------------------------------
|
||||
private void HandleRequest (OpnHttpRequestData requestData, String logPrefix)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<packages>
|
||||
<package id="CsvHelper" version="12.1.2" targetFramework="net46" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net46" />
|
||||
</packages>
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"directory": "wwwroot/lib"
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:56463/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"SaOperationsMgrWeb": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:56464/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,38 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net46</TargetFramework>
|
||||
<RootNamespace>Sarand.OperationsMgr</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CsvHelper" Version="12.1.2" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SaOpnMgrCore\SaOpnMgrCore.csproj" />
|
||||
<ProjectReference Include="..\SaOpnMgrProcs\SaOpnMgrProcs.csproj" />
|
||||
<ProjectReference Include="..\SaOpnMgrWinDbas\SaOpnMgrWinDbas.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\PublishProfiles\" />
|
||||
<Folder Include="wwwroot\css\images\" />
|
||||
<Folder Include="wwwroot\img\icon\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
|
||||
"Version": "7.18.214.2",
|
||||
"GettingStartedDocument": {
|
||||
"Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
@model Sarand.OperationsMgr.Web.Models.Model_Home_Index
|
||||
@inject Sarand.OperationsMgr.Web.App.OpnLocaliser Localiser
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
@if (Model.AwaitingLogin)
|
||||
{
|
||||
<div class="opn-form login">
|
||||
<div class="caption">@Localiser["form.caption.login"]</div>
|
||||
<form id="frmLogin" action="" method="post">
|
||||
<div class="body">
|
||||
<div class="spacer4"></div>
|
||||
<div class="col-xs-4">@Localiser["label.instance"]</div>
|
||||
<div class="col-xs-8">@Html.DropDownListFor(x => x.InstanceIdx, Model.Instances, new { @id = "cbInstance" })</div>
|
||||
<div class="clearb"></div>
|
||||
<div class="spacer2"></div>
|
||||
<div class="col-xs-4">@Localiser["label.user"]</div>
|
||||
<div class="col-xs-8">@Html.TextBox("UserCode", null, new { @id = "ifUserCode", @maxlength = "64" })</div>
|
||||
<div class="clearb"></div>
|
||||
<div class="spacer2"></div>
|
||||
<div class="col-xs-4">@Localiser["label.password"]</div>
|
||||
<div class="col-xs-8">@Html.Password("UserPwrd", null, new { @id = "ifUserPwrd", @maxlength = "64" })</div>
|
||||
<div class="clearb"></div>
|
||||
<div class="spacer4"></div>
|
||||
<div class="col-xs-4"></div>
|
||||
<div class="col-xs-8"><button type="submit" id="pbLogin" name="FormAction" value='@Localiser["form.action.login"]'>@Localiser["button.login"]</button></div>
|
||||
<div class="clearb"></div>
|
||||
<div class="spacer4"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div></div>
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
@page
|
||||
@model ErrorModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
|
||||
</p>
|
||||
@@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - SaOperationsMgrWeb</title>
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
</environment>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a asp-page="/Index" class="navbar-brand">SaOperationsMgrWeb</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a asp-page="/Index">Home</a></li>
|
||||
<li><a asp-page="/About">About</a></li>
|
||||
<li><a asp-page="/Contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container body-content">
|
||||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2017 - SaOperationsMgrWeb</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
|
||||
</script>
|
||||
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,3 @@
|
||||
@using Sarand.OperationsMgr.Web
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@inject Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration TelemetryConfiguration
|
||||
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using Microsoft.AspNetCore.Mvc.Localization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr
|
||||
{
|
||||
// <summary>
|
||||
/// Dummy class to group shared resources - named as per '.resx' file in root namespace.
|
||||
/// <para>Required to create the IStringLocalizer instance using the type from the class.</para>
|
||||
/// <para>Name of the class is used as the prefix for localisation filenames.</para>
|
||||
/// <para>Resource files are in the Localization ResourcesPath in Startup.cs.</para>
|
||||
/// </summary>
|
||||
public class OpnProperties { }
|
||||
// Class must be in Root/Default Namespace to reference properties with same name.
|
||||
// NB 'Assembly name' must be the same as 'Default Namespace' until 'Root Namespace' can be set (.Net Core 2.1?).
|
||||
// Ref. Project Properties - Application.
|
||||
}
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnLocaliser
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly IStringLocalizer<OpnProperties> opnLocalizer;
|
||||
private readonly IHtmlLocalizer<OpnProperties> opnHtmlLocalizer;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Localisers are supplied using construction injection.
|
||||
/// </summary>
|
||||
public OpnLocaliser (IStringLocalizer<OpnProperties> opnLocalizer, IHtmlLocalizer<OpnProperties> opnHtmlLocalizer)
|
||||
{
|
||||
this.opnLocalizer = opnLocalizer;
|
||||
this.opnHtmlLocalizer = opnHtmlLocalizer;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Retrieve localised text.</summary>
|
||||
public LocalizedString GetText (string key)
|
||||
{
|
||||
return GetText(key, new object[] { });
|
||||
}
|
||||
public LocalizedString GetText (string key, string param)
|
||||
{
|
||||
return GetText(key, new object[] { param });
|
||||
}
|
||||
public LocalizedString GetText (string key, string param1, string param2)
|
||||
{
|
||||
return GetText(key, new object[] { param1, param2 });
|
||||
}
|
||||
public LocalizedString GetText (string key, object[] parameters)
|
||||
{
|
||||
return opnLocalizer.GetString(key, parameters);
|
||||
}
|
||||
public LocalizedString this[String key]
|
||||
{
|
||||
get { return GetText(key); }
|
||||
}
|
||||
public LocalizedString this[String key, String param]
|
||||
{
|
||||
get { return GetText(key, param); }
|
||||
}
|
||||
public LocalizedString this[String key, String param1, String param2]
|
||||
{
|
||||
get { return GetText(key, param1, param2); }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Localised HTML text.
|
||||
/// <para>Line delimiters changed to '<br/>'.</para>
|
||||
/// </summary>
|
||||
public LocalizedString GetHtmlText (string key)
|
||||
{
|
||||
LocalizedString localisedText = GetText(key);
|
||||
String value = localisedText.Value;
|
||||
// Replace all line delimiters.
|
||||
value = value.Replace("\r\n", "\n").Replace("\n", "<br/>").Replace("\r", "<br/>");
|
||||
return new LocalizedString(localisedText, value, localisedText.ResourceNotFound);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Localised javascript string.
|
||||
/// <para>All quotes are escaped.</para>
|
||||
/// </summary>
|
||||
public LocalizedString GetJavascriptText (string key)
|
||||
{
|
||||
LocalizedString localisedText = GetText(key);
|
||||
return new LocalizedString(localisedText, EscapeJavascriptText(localisedText.Value), localisedText.ResourceNotFound);
|
||||
}
|
||||
public String EscapeJavascriptText (string value)
|
||||
{
|
||||
// Escape all quotes.
|
||||
value = value.Replace("'", "\\'").Replace("\"", "\\\"");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class Program
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
var host = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
host.Run();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.Consoles;
|
||||
using Sarand.OperationsMgr.Win.Dbas.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaOperationsMgrWebApp : SacsStateItem, IDisposable
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
internal class OpnSessionContext_Web : OpnSessionContext
|
||||
{
|
||||
public OpnSessionContext_Web (ushort sesionContextIndex, Opn.Instance instance) :
|
||||
base(sesionContextIndex)
|
||||
{
|
||||
Instance = instance;
|
||||
}
|
||||
}
|
||||
public class SessionContextConfig
|
||||
{
|
||||
public OpnSessionContext SessionContext { get; internal set; }
|
||||
public String Caption { get; internal set; }
|
||||
public SacsDatabase Database { get; internal set; } = null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static SaOperationsMgrWebApp app;
|
||||
private PropertySet properties;
|
||||
private Dictionary<ushort, SessionContextConfig> sessionContexts = new Dictionary<ushort, SessionContextConfig>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaOperationsMgrWebApp (IHostingEnvironment env, IConfigurationSection instanceConfig, String initialLogMessage)
|
||||
{
|
||||
app = this;
|
||||
}
|
||||
public void Dispose ()
|
||||
{
|
||||
app = null;
|
||||
DeinitGlobals();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public String ContentRootPath { get; }
|
||||
public String LoggingRootFolder { get; }
|
||||
public bool IsDevelopment { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n s t a n c e
|
||||
//-------------------------------------------------------------------
|
||||
public static SaOperationsMgrWebApp GetInstance ()
|
||||
{
|
||||
return app;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S e s s i o n C o n t e x t C o n f i g u r a t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
public List<ushort> GetSessionContextIndices ()
|
||||
{
|
||||
List<ushort> indices = new List<ushort>();
|
||||
foreach (ushort index in sessionContexts.Keys)
|
||||
indices.Add(index);
|
||||
indices.Sort();
|
||||
return indices;
|
||||
}
|
||||
public SessionContextConfig GetSessionContextConfig (ushort sessionContextIndex)
|
||||
{
|
||||
if (sessionContexts.ContainsKey(sessionContextIndex))
|
||||
return sessionContexts[sessionContextIndex];
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// G l o b a l s
|
||||
//-------------------------------------------------------------------
|
||||
private void InitGlobals (IConfigurationSection sessionContextsConfig)
|
||||
{
|
||||
GetSessionContextConfigurations(sessionContextsConfig);
|
||||
OpnGlobals.System = new OpnSystem_WinDbas(properties);
|
||||
OpnGlobals.ConsoleHelper = new OpnConsoleHelper_Web();
|
||||
}
|
||||
private void GetSessionContextConfigurations (IConfigurationSection sessionContextsConfig)
|
||||
{
|
||||
// Retrieve Session Context configurations.
|
||||
ushort sessionContextConfigIdx = 0;
|
||||
foreach (IConfigurationSection sessionContextCfg in sessionContextsConfig.GetChildren())
|
||||
{
|
||||
sessionContextConfigIdx++;
|
||||
// Extract instance code.
|
||||
String instanceCode = sessionContextCfg.GetSection("Instance").Value;
|
||||
Opn.Instance instance = OpnSystem.GetInstanceForCode(instanceCode);
|
||||
if ((int)instance < 1)
|
||||
{
|
||||
Logger.Warn("Unrecognised instance code '" + instanceCode + "' in configuration.");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Configure Session Context.
|
||||
SessionContextConfig sessionContextConfig = new SessionContextConfig();
|
||||
sessionContextConfig.SessionContext = new OpnSessionContext_Web((ushort)(sessionContextConfigIdx * 100u), instance);
|
||||
sessionContextConfig.Caption = sessionContextCfg.GetSection("Caption").Value;
|
||||
if (StringUtil.IsEmpty(sessionContextConfig.Caption))
|
||||
sessionContextConfig.Caption = OpnSystem.GetInstanceDesc(instance);
|
||||
|
||||
// Retrieve database configuration.
|
||||
IConfigurationSection stockDatabaseCfg = sessionContextCfg.GetSection("StockDatabase");
|
||||
String instanceDbLocation = stockDatabaseCfg.GetSection("Location").Value;
|
||||
Logger.Debug("Instance: " + instanceCode + ". Db location: " + instanceDbLocation);
|
||||
if (StringUtil.IsEmpty(instanceDbLocation))
|
||||
{
|
||||
Logger.Warn("Blank database location for instance '" + instanceCode + "' in configuration.");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Configure database connection.
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = instanceDbLocation;
|
||||
config.user = stockDatabaseCfg.GetSection("User").Value;
|
||||
config.pword = stockDatabaseCfg.GetSection("Pword").Value;
|
||||
sessionContextConfig.Database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
//OpnGlobals.DbConsole.VerifyDatabaseSchema();
|
||||
|
||||
// Add session context to list.
|
||||
sessionContexts.Add(sessionContextConfig.SessionContext.Index, sessionContextConfig);
|
||||
}
|
||||
}
|
||||
private void DeinitGlobals ()
|
||||
{
|
||||
OpnGlobals.clear();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.App
|
||||
{
|
||||
//=======================================================================
|
||||
// Sarand OperationsMgr Web user session data.
|
||||
// NB private setters are required for JSON deserialisation.
|
||||
//=======================================================================
|
||||
public class SessionData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SessionData (OpnSessionContext sessionContext, SysId userId, String userCode, String userName)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
User = new UserData(userId, userCode, userName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public OpnSessionContext SessionContext { get; }
|
||||
public Opn.Instance Instance { get { return SessionContext.Instance; } }
|
||||
public String InstanceCode { get { return OpnSystem.GetInstanceCode(Instance); } }
|
||||
public String InstanceDesc { get { return OpnSystem.GetInstanceDesc(Instance); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// User data.
|
||||
public class UserData
|
||||
{
|
||||
public UserData (SysId userId, String userCode, String userName)
|
||||
{
|
||||
Id = userId;
|
||||
Code = userCode;
|
||||
Name = userName;
|
||||
}
|
||||
public SysId Id { get; private set; }
|
||||
public String Code { get; private set; }
|
||||
public String Name { get; private set; }
|
||||
}
|
||||
public UserData User { get; private set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.System;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class Startup
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SaOperationsMgrWebApp app = null;
|
||||
// Localisation.
|
||||
private static RequestCulture defaultRequestCulture = new RequestCulture("en-GB", "en-GB");
|
||||
private static List<CultureInfo> supportedCultures = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("en-GB"),
|
||||
new CultureInfo("en-US"),
|
||||
new CultureInfo("en"),
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public Startup (IHostingEnvironment env)
|
||||
{
|
||||
String fn = "SaOperationsMgrWeb.Startup";
|
||||
|
||||
// Load server configuration.
|
||||
String machineName = Environment.MachineName;
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile($"appsettings.machine.{machineName}.json", optional: false, reloadOnChange: true)
|
||||
.AddEnvironmentVariables();
|
||||
Logger.Info(fn + " EnvironmentName: " + env.EnvironmentName + ". MachineName: " + machineName + ".");
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
// This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
|
||||
builder.AddApplicationInsightsSettings(developerMode: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Staging, Production.
|
||||
}
|
||||
Configuration = builder.Build();
|
||||
|
||||
// Avoid automatic binding of model properties.
|
||||
// Ref. https://stackoverflow.com/questions/2211829/why-does-asp-net-mvc-care-about-my-read-only-properties-during-databinding
|
||||
//DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;
|
||||
|
||||
// Initialise application:
|
||||
app = new SaOperationsMgrWebApp(env, Configuration.GetSection("SessionContexts"), Opn.ApplicationCaption + " Startup");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public IConfigurationRoot Configuration { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices (IServiceCollection services)
|
||||
{
|
||||
// Add framework services.
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
// Aug-2017 Added to support memory caching of sessions.
|
||||
services.AddMemoryCache();
|
||||
//services.AddDistributedMemoryCache(); - for multiple web servers.
|
||||
services.AddSession
|
||||
(options =>
|
||||
{
|
||||
/* Default cookie name: '.AspNetCore.Session' */
|
||||
options.CookieName = "SaOperationsMgr.Session";
|
||||
options.IdleTimeout = SacsSystem.DebugMode ? TimeSpan.FromMinutes(15) : TimeSpan.FromMinutes(30);
|
||||
options.CookieHttpOnly = true;
|
||||
}
|
||||
);
|
||||
|
||||
// Application localisation.
|
||||
services.AddSingleton<OpnLocaliser>();
|
||||
// Lovalisation properties folder.
|
||||
String resourcesPath = "Localisation";
|
||||
services.AddLocalization(opts => { opts.ResourcesPath = resourcesPath; });
|
||||
|
||||
services.AddMvc
|
||||
(options =>
|
||||
{
|
||||
// Model binding - intercepting form values being bound to models.
|
||||
options.ModelBinderProviders.Insert(0, new OpnModelBinderProvider());
|
||||
}
|
||||
)
|
||||
// View and data annotation localisations.
|
||||
.AddViewLocalization(
|
||||
LanguageViewLocationExpanderFormat.Suffix,
|
||||
opts => { opts.ResourcesPath = resourcesPath; })
|
||||
.AddDataAnnotationsLocalization();
|
||||
|
||||
// Configure localisation middleware.
|
||||
services.Configure<RequestLocalizationOptions>
|
||||
(opts =>
|
||||
{
|
||||
// Default culture to use for requests.
|
||||
opts.DefaultRequestCulture = defaultRequestCulture;
|
||||
// Cultures supported by the application. Formatting numbers, dates, etc.
|
||||
opts.SupportedCultures = supportedCultures;
|
||||
// UI cultures supported by the application. UI strings that have been localized.
|
||||
opts.SupportedUICultures = supportedCultures;
|
||||
}
|
||||
);
|
||||
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure (IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||
loggerFactory.AddDebug();
|
||||
|
||||
// Application insights telemetry for requests.
|
||||
//app.UseApplicationInsightsRequestTelemetry();
|
||||
//app.UseApplicationInsightsExceptionTelemetry();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
//app.UseBrowserLink();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
}
|
||||
|
||||
// Enable static file serving.
|
||||
app.UseStaticFiles();
|
||||
|
||||
// Localisation.
|
||||
var localisationOptions = app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>();
|
||||
app.UseRequestLocalization(localisationOptions.Value);
|
||||
|
||||
// Initialise session handling.
|
||||
app.UseSession();
|
||||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnCodeTypeConsole_Web : OpnCodeTypeConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnCodeTypeConsole_Web(OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base (database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Code Types dialog.
|
||||
protected override MaintainCodeTypesFunction MaintainCodeTypesFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
using Sarand.Core.CodeTypes;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Interfaces;
|
||||
using Sarand.Core.ItemOptions;
|
||||
using Sarand.Core.ReferenceData;
|
||||
using Sarand.Core.Security;
|
||||
using Sarand.Core.UpdateLog;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Sarand.OperationsMgr.Web.App.SaOperationsMgrWebApp;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnConsoleHelper_Web : OpnConsoleHelper
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Session console data.
|
||||
private class ConsoleData
|
||||
{
|
||||
public OpnSecurityConsole_Web SecurityConsole { get; set; }
|
||||
public OpnCodeTypeConsole_Web CodeTypeConsole { get; set; }
|
||||
public OpnReferenceDataConsole_Web ReferenceDataConsole { get; set; }
|
||||
public OpnItemOptionConsole_Web ItemOptionConsole { get; set; }
|
||||
public OpnInterfaceConsole_Web InterfaceConsole { get; set; }
|
||||
public OpnUpdateLogConsole_Web UpdateLogConsole { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Dictionary<ushort, ConsoleData> sessionConsoleData = new Dictionary<ushort, ConsoleData>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnConsoleHelper_Web ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
private SaOperationsMgrWebApp App { get { return SaOperationsMgrWebApp.GetInstance(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Session context configuration.
|
||||
private SessionContextConfig GetSessionContextConfig (OpnSessionContext sessionContext)
|
||||
{
|
||||
return App.GetSessionContextConfig(sessionContext.Index);
|
||||
}
|
||||
private ConsoleData GetConsoleData (OpnSessionContext sessionContext)
|
||||
{
|
||||
// Add console data for this session if not already defined.
|
||||
if (!sessionConsoleData.ContainsKey(sessionContext.Index))
|
||||
sessionConsoleData[sessionContext.Index] = new ConsoleData();
|
||||
return sessionConsoleData[sessionContext.Index];
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Database.
|
||||
public override ISacsDatabase GetDatabase (OpnSessionContext sessionContext)
|
||||
{
|
||||
SessionContextConfig sessionContextConfig = GetSessionContextConfig(sessionContext);
|
||||
if (sessionContextConfig != null)
|
||||
return sessionContextConfig.Database;
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security console.
|
||||
public override SaSecurityConsole GetSecurityConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.SecurityConsole == null)
|
||||
{
|
||||
consoleData.SecurityConsole = new OpnSecurityConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
consoleData.SecurityConsole.LogSecurityProfile = OpnGlobals.System.IsExtendedLogging(OpnSystem.ExtendedLogginOption.SecurityProfile);
|
||||
consoleData.SecurityConsole.RegisterSecurityRights();
|
||||
}
|
||||
return consoleData.SecurityConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Code Type console.
|
||||
public override SaCodeTypeConsole GetCodeTypeConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.CodeTypeConsole == null)
|
||||
{
|
||||
consoleData.CodeTypeConsole = new OpnCodeTypeConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
OpnSystem.RegisterCodeTypes(consoleData.CodeTypeConsole, sessionContext.Instance);
|
||||
}
|
||||
return consoleData.CodeTypeConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Reference Data console.
|
||||
public override SaReferenceDataConsole GetReferenceDataConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.ReferenceDataConsole == null)
|
||||
{
|
||||
consoleData.ReferenceDataConsole = new OpnReferenceDataConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
}
|
||||
return consoleData.ReferenceDataConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item option console.
|
||||
public override SaItemOptionConsole GetItemOptionConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.ItemOptionConsole == null)
|
||||
{
|
||||
consoleData.ItemOptionConsole = new OpnItemOptionConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
}
|
||||
return consoleData.ItemOptionConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Interface console.
|
||||
public override SaInterfaceConsole GetInterfaceConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.InterfaceConsole == null)
|
||||
{
|
||||
consoleData.InterfaceConsole = new OpnInterfaceConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
//consoleData.InterfaceConsole.RegisterInterfaces(sessionContext.Instance);
|
||||
}
|
||||
return consoleData.InterfaceConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Log console.
|
||||
public override SaUpdateLogConsole GetUpdateLogConsole (OpnSessionContext sessionContext)
|
||||
{
|
||||
ConsoleData consoleData = GetConsoleData(sessionContext);
|
||||
if (consoleData.UpdateLogConsole == null)
|
||||
{
|
||||
consoleData.UpdateLogConsole = new OpnUpdateLogConsole_Web(sessionContext, GetDatabase(sessionContext) as SacsDatabase);
|
||||
}
|
||||
return consoleData.UpdateLogConsole;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.Core.Interfaces;
|
||||
using Sarand.Core.ItemOptions;
|
||||
using Sarand.Core.Procs;
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Win.Consoles;
|
||||
using Sarand.OperationsMgr.Win.Interfaces;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnInterfaceConsole_Web : OpnInterfaceConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
//private List<TypeCodeDesc> dataItemTypes = OpnSystem.GetCodesOfType(Opn.SystemCode.DataItemType);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnInterfaceConsole_Web (OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base(null)
|
||||
{
|
||||
Database = database;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
internal Opn.Instance Instance { get { return SessionContext.Instance; } }
|
||||
internal SacsDatabase Database { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Interface management form.
|
||||
protected override MaintainInterfacesFunction MaintainInterfacesFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Interface item option definitions.
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
return OpnProcessConsole.GetInterfaceItemOptionDfns(interfaceCategory, interfaceType);
|
||||
}
|
||||
public override List<SaItemOptionDfn> GetInterfaceItemOptionDfns (SysId interfaceId)
|
||||
{
|
||||
SaInterface interfaceObj = GetInterfaceById(interfaceId);
|
||||
if (interfaceObj != null)
|
||||
return OpnProcessConsole.GetInterfaceItemOptionDfns(interfaceObj.Category, interfaceObj.Type);
|
||||
return new List<SaItemOptionDfn>();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n t e r f a c e A c c e s s C o n t r o l
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// P r o c e s s i n g O p t i o n s
|
||||
//---------------------------------------------------------------
|
||||
private List<SacsProcess.GroupData> GetProcessingOptions (SaInterface interfaceObj)
|
||||
{
|
||||
if (interfaceObj != null && SysId.IsValid(interfaceObj.Id))
|
||||
{
|
||||
switch (interfaceObj.Category)
|
||||
{
|
||||
case SaInterfaceCategory.System:
|
||||
return GetProcessingOptions_System(interfaceObj);
|
||||
}
|
||||
}
|
||||
return new List<SacsProcess.GroupData>();
|
||||
}
|
||||
private List<SacsProcess.GroupData> GetProcessingOptions_System (SaInterface interfaceObj)
|
||||
{
|
||||
if (interfaceObj.Category != SaInterfaceCategory.System) throw new NotSupportedException("Invalid interface category: " + interfaceObj.Category.ToString() + ". Expected: System");
|
||||
List<SacsProcess.GroupData> optionGroups = null;
|
||||
//switch ((Opn.InterfaceType)interfaceObj.Type)
|
||||
//{
|
||||
//}
|
||||
return optionGroups ?? new List<SacsProcess.GroupData>();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// P r o c e s s I n t e r f a c e
|
||||
//---------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Interface can only be 'processed' if it defines processing options.
|
||||
/// </summary>
|
||||
/// <param name="interfaceObj"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanProcessInterface (SaInterface interfaceObj)
|
||||
{
|
||||
return (GetProcessingOptions(interfaceObj).Count > 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// Popup form to select options for processing interface.
|
||||
/// </summary>
|
||||
/// <param name="interfaceObj"></param>
|
||||
/// <returns></returns>
|
||||
public override bool ProcessInterface (SaInterface interfaceObj, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private OpnInterfaceProcess ConfigureProcess (SaInterface interfaceObj, SacsProcess.GroupData processGroup, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
switch (interfaceObj.Category)
|
||||
{
|
||||
case SaInterfaceCategory.System:
|
||||
return ConfigureProcess_System(interfaceObj, processGroup, dbUpdateInfo);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private OpnInterfaceProcess ConfigureProcess_System (SaInterface interfaceObj, SacsProcess.GroupData processGroup, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
if (interfaceObj.Category != SaInterfaceCategory.System) throw new NotSupportedException("Invalid interface category: " + interfaceObj.Category.ToString() + ". Expected: System");
|
||||
//switch ((Opn.InterfaceType)interfaceObj.Type)
|
||||
//{
|
||||
//}
|
||||
return null;
|
||||
}
|
||||
public override bool AreMultipleInterfaceInstancesAllowed (string context, SaInterfaceCategory interfaceCategory, short interfaceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override bool AreMultipleActiveInterfacesAllowed (string context, SaInterfaceCategory interfaceCategory)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnItemOptionConsole_Web : OpnItemOptionConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnItemOptionConsole_Web (OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base (database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowItemOptionsDialogFunction ShowItemOptionsDialogFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
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.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnReferenceDataConsole_Web : OpnReferenceDataConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnReferenceDataConsole_Web (OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base(null, database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Reference Data Maintenance form.
|
||||
protected override MaintainReferenceDataFunction MaintainReferenceDataFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnSecurityConsole_Web : OpnSecurityConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
//private List<TypeCodeDesc> securityRights = OpnSystem.GetCodesOfType(Opn.SystemCode.SecurityRight);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnSecurityConsole_Web(OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base (database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security events.
|
||||
protected override bool OnLogin (SysId userId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
protected override void OnLogout ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to show User Login form.
|
||||
protected override ShowUserLoginFormFunction ShowUserLoginFormFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management form.
|
||||
protected override ShowManageSecurityDialogFunction ShowManageSecurityDialogFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public override bool OnUserModified (SysId userId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool OnSecurityGroupModified (SysId secGroupId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Sarand.OperationsMgr.App.Consoles;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Consoles
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnUpdateLogConsole_Web : OpnUpdateLogConsole_Dbas
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnUpdateLogConsole_Web (OpnSessionContext sessionContext, SacsDatabase database) :
|
||||
base(database)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Method to display Security management dialog.
|
||||
protected override ShowUpdateLogDialogFunction ShowUpdateLogDialogFn
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
using Microsoft.AspNetCore.Html;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.Core.CodeTypes;
|
||||
using Sarand.Core.Security;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.App;
|
||||
using Sarand.OperationsMgr.Web.Models;
|
||||
using Sarand.OperationsMgr.Web.System;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
public class Controller_Base : Controller
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private List<TypeCodeDesc> assetTypes;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Protected construction - use derived classes.
|
||||
protected Controller_Base (OpnLocaliser localiser) : base()
|
||||
{
|
||||
Localiser = localiser;
|
||||
|
||||
// Initialise console (debug) logging listener.
|
||||
if (Directory.Exists(App.LoggingRootFolder))
|
||||
OpnConsoleListener.ConfigureDebugListener(App.LoggingRootFolder);
|
||||
if (SacsSystem.DebugMode) Logger.Trace(GetType().Name + ".CTR");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
protected SaOperationsMgrWebApp App { get { return SaOperationsMgrWebApp.GetInstance(); } }
|
||||
public OpnLocaliser Localiser { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C u l t u r e
|
||||
//-------------------------------------------------------------------
|
||||
private string LanguageIso2
|
||||
{
|
||||
get
|
||||
{
|
||||
var feature = HttpContext.Features.Get<IRequestCultureFeature>();
|
||||
return feature.RequestCulture.UICulture.TwoLetterISOLanguageName.ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// R e d i r e c t i o n L o c a t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
protected enum RedirectLocation
|
||||
{
|
||||
Home,
|
||||
Home_SessionExpired,
|
||||
}
|
||||
protected String GetRedirectLocation (RedirectLocation redirectLocation)
|
||||
{
|
||||
switch (redirectLocation)
|
||||
{
|
||||
case RedirectLocation.Home:
|
||||
return "/Home";
|
||||
case RedirectLocation.Home_SessionExpired:
|
||||
return "/Home?SessionExpired";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A c t i o n E v e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public override void OnActionExecuting (ActionExecutingContext context)
|
||||
{
|
||||
//if (SacsSystem.DebugMode) Logger.Trace(GetType().Name + ".OnActionExecuting");
|
||||
base.OnActionExecuting(context);
|
||||
}
|
||||
public override void OnActionExecuted (ActionExecutedContext context)
|
||||
{
|
||||
//if (SacsSystem.DebugMode) Logger.Trace(GetType().Name + ".OnActionExecuted");
|
||||
ViewData["CopyrightNotice"] = new HtmlString(OpnSystem.GetCopyrightNotice(true));
|
||||
|
||||
// Refreh model properties.
|
||||
Model_Base baseModel = ViewData.Model as Model_Base;
|
||||
if (baseModel != null)
|
||||
{
|
||||
// Session data.
|
||||
baseModel.SessionData = SessionData;
|
||||
baseModel.AwaitingLogin = !ValidSession;
|
||||
|
||||
// Redirect locations.
|
||||
baseModel.RedirectLocation.Home = GetRedirectLocation(RedirectLocation.Home);
|
||||
baseModel.RedirectLocation.Home_SessionExpired = GetRedirectLocation(RedirectLocation.Home_SessionExpired);
|
||||
}
|
||||
|
||||
// Store session data if present - as potentially modfied.
|
||||
if (sessionData != null)
|
||||
{
|
||||
String sessionDataJson = JsonConvert.SerializeObject(sessionData);
|
||||
HttpContext.Session.Set(SessionKey_SessionConfig, sessionDataEncoding.GetBytes(sessionDataJson));
|
||||
if (baseModel != null)
|
||||
baseModel.SessionIdx = SessionData.SessionContext.Index;
|
||||
}
|
||||
|
||||
base.OnActionExecuted(context);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// M o d e l
|
||||
//-------------------------------------------------------------------
|
||||
protected void InitModel (Model_Base model)
|
||||
{
|
||||
model.AwaitingLogin = !ValidSession;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S e s s i o n
|
||||
//-------------------------------------------------------------------
|
||||
private SessionData sessionData;
|
||||
public static readonly String SessionKey_SessionConfig = "OpnUserSessionConfig";
|
||||
private static readonly Encoding sessionDataEncoding = Encoding.UTF8;
|
||||
private class OpnSessionDataContractResolver : DefaultContractResolver
|
||||
{
|
||||
// To allow private properties to be deserialised.
|
||||
protected override List<MemberInfo> GetSerializableMembers (Type objectType)
|
||||
{
|
||||
var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
|
||||
MemberInfo[] fields = objectType.GetFields(flags);
|
||||
return fields
|
||||
.Concat(objectType.GetProperties(flags).Where(propInfo => propInfo.CanWrite))
|
||||
.ToList();
|
||||
}
|
||||
protected override IList<JsonProperty> CreateProperties (Type type, MemberSerialization memberSerialization)
|
||||
{
|
||||
return base.CreateProperties(type, MemberSerialization.Fields);
|
||||
}
|
||||
};
|
||||
JsonSerializerSettings OpnSessionDataJsonSerializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
ContractResolver = new OpnSessionDataContractResolver()
|
||||
};
|
||||
public bool ValidSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return (SessionData != null && SysId.IsValid(SessionData.User.Id));
|
||||
}
|
||||
}
|
||||
public SessionData SessionData
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve session data if not already in controller.
|
||||
if (sessionData == null)
|
||||
{
|
||||
byte[] sessionDataBytes = null;
|
||||
HttpContext.Session.TryGetValue(SessionKey_SessionConfig, out sessionDataBytes);
|
||||
if (sessionDataBytes != null)
|
||||
{
|
||||
String sessionDataJson = sessionDataEncoding.GetString(sessionDataBytes);
|
||||
sessionData = JsonConvert.DeserializeObject<SessionData>(sessionDataJson, OpnSessionDataJsonSerializerSettings);
|
||||
}
|
||||
}
|
||||
return sessionData;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Warn(GetType().Name + ".SessionData " + exc.GetType().Name + " - " + exc.Message + exc.GetStackEntries().Concat("", "\n\t"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
protected bool OpenUserSession (OpnSessionContext sessioContext, SysId userId, String userCode, String userName)
|
||||
{
|
||||
// Validate user properties.
|
||||
if (!SysId.IsValid(userId)) return false;
|
||||
if (StringUtil.IsEmpty(userCode)) return false;
|
||||
if (StringUtil.IsEmpty(userName)) return false;
|
||||
|
||||
// Close previous session.
|
||||
CloseUserSession();
|
||||
|
||||
// Open session.
|
||||
sessionData = new SessionData(sessioContext, userId, userCode, userName);
|
||||
|
||||
return true;
|
||||
}
|
||||
protected void CloseUserSession ()
|
||||
{
|
||||
HttpContext.Session.Clear();
|
||||
sessionData = null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A j a x A c t i o n s
|
||||
//-------------------------------------------------------------------
|
||||
protected static readonly Encoding ajaxResponseEncoding = Encoding.UTF8;
|
||||
public class AjaxResponse
|
||||
{
|
||||
// Response status.
|
||||
public bool Success { get; set; } = false;
|
||||
public bool SessionExpired { get; private set; } = false;
|
||||
public bool GoHome { get; private set; } = false;
|
||||
public AjaxResponse SetSessionExpired (String title, String text)
|
||||
{
|
||||
SessionExpired = true;
|
||||
return SetMessage(title, text);
|
||||
}
|
||||
public AjaxResponse SetGoHome (String title, String text)
|
||||
{
|
||||
GoHome = true;
|
||||
return SetMessage(title, text);
|
||||
}
|
||||
// Message - displays alert popup.
|
||||
public class MessageData
|
||||
{
|
||||
public String Title { get; set; }
|
||||
public String Text { get; set; }
|
||||
}
|
||||
public MessageData Message { get; private set; }
|
||||
public AjaxResponse SetMessage (String title, String text)
|
||||
{
|
||||
Message = new MessageData() { Title = title, Text = text };
|
||||
return this;
|
||||
}
|
||||
// Notification - briefly displays after response received.
|
||||
public class NotificationData
|
||||
{
|
||||
public String Title { get; set; }
|
||||
public String Message { get; set; }
|
||||
}
|
||||
public NotificationData Notification { get; private set; }
|
||||
public bool HasNotification { get { return Notification != null; } }
|
||||
public AjaxResponse SetNotification (String title, String message)
|
||||
{
|
||||
Notification = new NotificationData() { Title = title, Message = message };
|
||||
return this;
|
||||
}
|
||||
// Paged data.
|
||||
public class PagingData
|
||||
{
|
||||
public bool Paged { get { return (PageNo > 0 && PageLength > 0 && ItemTotal > PageLength); } }
|
||||
public uint PageNo { get; set; } = 0;
|
||||
public ushort PageLength { get; set; } = 0;
|
||||
public uint PageCount { get { return (PageLength > 0 ? (uint)Math.Ceiling((decimal)ItemTotal / PageLength) : 0); } }
|
||||
public uint ItemCount { get; set; } = 0;
|
||||
public uint ItemTotal { get; set; } = 0;
|
||||
}
|
||||
public PagingData Paging { get; private set; }
|
||||
public void SetPaging (uint pageNo, ushort pageLength, uint itemCount, uint itemTotal)
|
||||
{
|
||||
Paging = new PagingData() { PageNo = pageNo, PageLength = pageLength, ItemCount = itemCount, ItemTotal = itemTotal };
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// S e s s i o n C o n t e x t
|
||||
//-------------------------------------------------------------------
|
||||
protected OpnSessionContext GetSessionContext ()
|
||||
{
|
||||
if (SessionData != null)
|
||||
return SessionData.SessionContext;
|
||||
Logger.Warn(GetType().Name + ".GetSessionContext() Session data is not available.");
|
||||
return null;
|
||||
}
|
||||
protected OpnSessionContext GetSessionContext (ushort index)
|
||||
{
|
||||
try
|
||||
{
|
||||
return App.GetSessionContextConfig(index).SessionContext;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Warn(GetType().Name + ".GetSessionContext(" + index + ") " + exc.GetType().Name + " - " + exc.Message + exc.GetStackEntries().Concat("", "\n\t"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// D a t a b a s e
|
||||
//-------------------------------------------------------------------
|
||||
private OpnSessionContext databaseSessionContext;
|
||||
private SacsDatabase database = null;
|
||||
protected SacsDatabase GetDatabase ()
|
||||
{
|
||||
try
|
||||
{
|
||||
return GetDatabase(GetSessionContext());
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Warn(GetType().Name + ".GetDatabase() " + exc.GetType().Name + " - " + exc.Message + exc.GetStackEntries().Concat("", "\n\t"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
protected SacsDatabase GetDatabase (OpnSessionContext sessionContext)
|
||||
{
|
||||
if (databaseSessionContext != null && databaseSessionContext.Equals(sessionContext)) return database;
|
||||
try
|
||||
{
|
||||
database = App.GetSessionContextConfig(sessionContext.Index).Database;
|
||||
databaseSessionContext = sessionContext;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logger.Warn(GetType().Name + ".GetDatabase(" + sessionContext.Index + "," + OpnSystem.GetInstanceCode(sessionContext.Instance) + ") " + exc.GetType().Name + " - " + exc.Message + exc.GetStackEntries().Concat("", "\n\t"));
|
||||
}
|
||||
return database;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Managers.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security console.
|
||||
private SaSecurityConsole securityConsole;
|
||||
protected SaSecurityConsole SecurityConsole { get { if (securityConsole == null) securityConsole = OpnGlobals.ConsoleHelper.GetSecurityConsole(GetSessionContext()); return securityConsole; } }
|
||||
// Code Type console.
|
||||
private SaCodeTypeConsole codeTypeConsole;
|
||||
protected SaCodeTypeConsole CodeTypeConsole { get { if (codeTypeConsole == null) codeTypeConsole = OpnGlobals.ConsoleHelper.GetCodeTypeConsole(GetSessionContext()); return codeTypeConsole; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o n s o l e s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Security;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
public class HomeController : Controller_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public HomeController (OpnLocaliser localiser) : base(localiser)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Home - Index.
|
||||
public IActionResult Index (Models.Model_Home_Index model)
|
||||
{
|
||||
Logger.Debug(GetType().Name + ".Index");
|
||||
if (HttpContext.Session != null)
|
||||
{
|
||||
foreach (var sessionKey in HttpContext.Session.Keys)
|
||||
{
|
||||
Logger.Debug(GetType().Name + ".Index Session key: " + sessionKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Actions.
|
||||
if (model.FormAction.EqualsCI(Localiser.GetText("form.action.login")))
|
||||
{
|
||||
// Validate login properties.
|
||||
if (StringUtil.IsEmpty(model.UserCode))
|
||||
model.AddWarningMessage(Localiser.GetHtmlText("msg.warn.login.userCode.missing"));
|
||||
|
||||
// Retrieve session context.
|
||||
OpnSessionContext sessionContext = null;
|
||||
if (model.OK)
|
||||
{
|
||||
sessionContext = GetSessionContext(model.InstanceIdx);
|
||||
if (sessionContext == null)
|
||||
{
|
||||
model.AddWarningMessage(Localiser.GetHtmlText("msg.warn.sessionContext.unknown"));
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve security console.
|
||||
SaSecurityConsole securityConsole = null;
|
||||
if (model.OK)
|
||||
{
|
||||
securityConsole = OpnGlobals.ConsoleHelper.GetSecurityConsole(sessionContext);
|
||||
if (securityConsole == null)
|
||||
model.AddWarningMessage(Localiser.GetHtmlText("msg.warn.securityConsole.unavailable"));
|
||||
}
|
||||
|
||||
// Retrieve and validate user.
|
||||
SaSecurityItem secItemUser = null;
|
||||
if (model.OK)
|
||||
{
|
||||
secItemUser = securityConsole.GetUserByCode(model.UserCode);
|
||||
if (secItemUser == null)
|
||||
model.AddWarningMessage(Localiser.GetHtmlText("msg.warn.login.credentials.invalid"));
|
||||
}
|
||||
// Start user session.
|
||||
if (model.OK)
|
||||
{
|
||||
if (OpenUserSession(sessionContext, secItemUser.Id, secItemUser.Code, secItemUser.Description))
|
||||
Logger.Info("User logged in: " + secItemUser.Description + ". Instance: " + sessionContext.InstanceCode);
|
||||
}
|
||||
}
|
||||
else if (model.FormAction.EqualsCI(Localiser.GetText("form.action.logout")))
|
||||
{
|
||||
// Make a note of the session index for the login form.
|
||||
model.InstanceIdx = model.SessionIdx;
|
||||
|
||||
// Clear user session.
|
||||
// NB Session Data may not be available, eg. if session has timed out.
|
||||
if (SessionData != null)
|
||||
{
|
||||
String userName = SessionData.User.Name;
|
||||
String instanceCode = OpnSystem.GetInstanceCode(SessionData.Instance);
|
||||
Logger.Info("User logging out: " + userName + ". Instance: " + instanceCode);
|
||||
}
|
||||
else Logger.Warn("User logging out - session has expired.");
|
||||
CloseUserSession();
|
||||
}
|
||||
else if (model.SessionExpired != null)
|
||||
model.AddWarningMessage(Localiser.GetHtmlText("msg.warn.session.expired"));
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public IActionResult Error ()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Dbas.Base;
|
||||
using Sarand.OperationsMgr.Web.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Models
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly List<String> infoMessages = new List<string>();
|
||||
private readonly List<String> warningMessages = new List<string>();
|
||||
private readonly List<String> errorMessages = new List<string>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Protected construction - use derived class.
|
||||
protected Model_Base ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Application properties.
|
||||
protected SaOperationsMgrWebApp App { get { return SaOperationsMgrWebApp.GetInstance(); } }
|
||||
public bool OK { get { return !HasMessages; } }
|
||||
public bool AwaitingLogin { get; set; } = true;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Session profile.
|
||||
public SessionData SessionData { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Business Object Managers.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Version parameter for includes.
|
||||
public String HrefVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime versionDate = SacsSystem.AssemblyBuildAt;
|
||||
if (!DateUtil.IsValid(versionDate) || SacsSystem.DebugMode)
|
||||
versionDate = DateTime.Now;
|
||||
return DateUtil.Format(versionDate, "yyyyMMdd" /*+ (SacsSystem.Debug ? "HHmm" : "")*/);
|
||||
}
|
||||
}
|
||||
// Additional includes.
|
||||
public List<String> AdditionalFiles_CSS { get; set; } = new List<string>();
|
||||
public List<String> AdditionalFiles_JS { get; set; } = new List<string>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Redirection locations.
|
||||
public class RedirectLocationData
|
||||
{
|
||||
// Properties populated in Controller_Base.OnActionExecuted.
|
||||
public String Home { get; internal set; }
|
||||
public String Home_SessionExpired { get; internal set; }
|
||||
}
|
||||
public RedirectLocationData RedirectLocation { get; } = new RedirectLocationData();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Paging properties.
|
||||
private readonly DbQuery.Paging dataPaging = new DbQuery.Paging();
|
||||
public bool DataPaged { get { return dataPaging.Paged; } }
|
||||
public uint DataPageNo { get { return dataPaging.PageNo; } set { dataPaging.PageNo = value; } }
|
||||
public ushort DataPageLength { get { return dataPaging.PageLength; } set { dataPaging.PageLength = value; } }
|
||||
public uint DataPageCount { get { return (DataPageLength > 0 ? (uint)Math.Ceiling((decimal)DataItemTotal / DataPageLength) : 0); } }
|
||||
public uint DataItemCount { get; set; }
|
||||
public uint DataItemTotal { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form properties.
|
||||
/// <summary>
|
||||
/// User session index to identify the site resources, eg. database.
|
||||
/// <para>Equivalent to the Site index on the login form.</para>
|
||||
/// <para>Populates value on logout form to identify default site for next login.</para>
|
||||
/// </summary>
|
||||
public ushort SessionIdx { get; set; }
|
||||
public String FormAction { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Message properties.
|
||||
public virtual bool ShowMessagesAtTopOfBody { get; } = true;
|
||||
public bool HasMessages { get { return (infoMessages.Count > 0 || warningMessages.Count > 0 || errorMessages.Count > 0); } }
|
||||
public List<String> InfoMessages { get { return new List<string>(infoMessages); } }
|
||||
public List<String> WarningMessages { get { return new List<string>(warningMessages); } }
|
||||
public List<String> ErrorMessages { get { return new List<string>(errorMessages); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form messages.
|
||||
public void AddInfoMessage (String message)
|
||||
{
|
||||
if (StringUtil.IsEmpty(StringUtil.TrimAll(message))) return;
|
||||
infoMessages.Add(message);
|
||||
}
|
||||
public void AddWarningMessage (String message)
|
||||
{
|
||||
if (StringUtil.IsEmpty(StringUtil.TrimAll(message))) return;
|
||||
warningMessages.Add(message);
|
||||
}
|
||||
public void AddErrorMessage (String message)
|
||||
{
|
||||
if (StringUtil.IsEmpty(StringUtil.TrimAll(message))) return;
|
||||
errorMessages.Add(message);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.Core.App;
|
||||
using Sarand.Core.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Sarand.OperationsMgr.Web.App.SaOperationsMgrWebApp;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Models
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_Home_Index : Model_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private List<SelectListItem> instances = null;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form properties.
|
||||
public ushort InstanceIdx { get; set; } = 0;
|
||||
public String UserCode { get; set; }
|
||||
public String UserPwrd { get; set; }
|
||||
public String SessionExpired { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// I n s t a n c e s
|
||||
//-------------------------------------------------------------------
|
||||
public IEnumerable<SelectListItem> Instances
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SacsSystem.DebugMode) Logger.Trace(GetType().Name + ".GetInstances()");
|
||||
if (instances == null)
|
||||
{
|
||||
// Populate list of instances.
|
||||
instances = new List<SelectListItem>();
|
||||
foreach (ushort sessionContextConfigIndex in App.GetSessionContextIndices())
|
||||
{
|
||||
SessionContextConfig sessionContextConfig = App.GetSessionContextConfig(sessionContextConfigIndex);
|
||||
if (sessionContextConfig != null)
|
||||
{
|
||||
instances.Add(new SelectListItem() { Value = sessionContextConfig.SessionContext.Index.ToString(), Text = sessionContextConfig.Caption });
|
||||
}
|
||||
}
|
||||
Logger.Debug(GetType().Name + ".Instances Populated instances: " + instances.Count);
|
||||
}
|
||||
return instances;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.System
|
||||
{
|
||||
//=======================================================================
|
||||
public class OpnConsoleListener : TextWriterTraceListener
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnConsoleListener() : base()
|
||||
{
|
||||
base.Name = DefaultName;
|
||||
base.Writer = null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public static String DefaultName { get; } = "SaOperationssMgr_Console";
|
||||
public String OutputPath { get; private set; } = "";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Configure Debug listener.
|
||||
public static bool ConfigureDebugListener (String logsRootFolder)
|
||||
{
|
||||
// Locate existing console listener.
|
||||
OpnConsoleListener consoleListener = null;
|
||||
foreach (TraceListener listener in global::System.Diagnostics.Debug.Listeners)
|
||||
{
|
||||
consoleListener = listener as OpnConsoleListener;
|
||||
if (consoleListener != null)
|
||||
break;
|
||||
}
|
||||
// If no console listener found, add one to the list.
|
||||
if (consoleListener == null)
|
||||
{
|
||||
consoleListener = new OpnConsoleListener();
|
||||
global::System.Diagnostics.Debug.Listeners.Add(consoleListener);
|
||||
}
|
||||
// Set the console listener's output file.
|
||||
if (consoleListener != null)
|
||||
consoleListener.RefreshOutputFile(logsRootFolder);
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Output file.
|
||||
public bool RefreshOutputFile (String logsRootFolder)
|
||||
{
|
||||
// Take the opportunity to flush existing output.
|
||||
Flush();
|
||||
|
||||
// Generate complete log folder path.
|
||||
String logsFolder = logsRootFolder + Path.DirectorySeparatorChar + DateUtil.Format(DateTime.Now, "yyyy") + Path.DirectorySeparatorChar + DateUtil.Format(DateTime.Now, "yyyyMM");
|
||||
if (!FileUtil.ValidateDirectory(logsFolder, true))
|
||||
return false;
|
||||
|
||||
// Generate log filename.
|
||||
String outputPath = logsFolder + Path.DirectorySeparatorChar + "OPN-Web-" + DateUtil.Format(DateTime.Now, "yyyyMMdd") + "-Console.log";
|
||||
if (Writer != null && !OutputPath.EqualsCI(outputPath))
|
||||
{
|
||||
// Close existing writer.
|
||||
Writer.Close();
|
||||
Writer.Dispose();
|
||||
Writer = null;
|
||||
}
|
||||
// Assign new writer.
|
||||
if (Writer == null)
|
||||
Writer = new StreamWriter(OutputPath = outputPath, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.Core.Base;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.System
|
||||
{
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Maps a browser request to a data object. Default class provides a base implementation of a model binder.
|
||||
/// <para>Overridden to trim whitespace from input values.</para>
|
||||
/// </summary>
|
||||
public class OpnModelBinder : IModelBinder
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public OpnModelBinder ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public Task BindModelAsync (ModelBindingContext bindingContext)
|
||||
{
|
||||
// Ignore selected properties by name.
|
||||
var modelName = bindingContext.ModelName;
|
||||
if (modelName == "RetainAllWhiteSpace")
|
||||
return Task.CompletedTask;
|
||||
|
||||
ValueProviderResult valueProviderResult = bindingContext.ValueProvider.GetValue(modelName);
|
||||
if (valueProviderResult == ValueProviderResult.None)
|
||||
return Task.CompletedTask;
|
||||
|
||||
// Trim text values.
|
||||
bindingContext.Result = ModelBindingResult.Success(valueProviderResult.FirstValue.TrimAll());
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.System
|
||||
{
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Maps a browser request to a data object. Default class provides a base implementation of a model binder.
|
||||
/// <para>Overridden to trim whitespace from input values.</para>
|
||||
/// </summary>
|
||||
public class OpnModelBinderProvider : IModelBinderProvider
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public OpnModelBinderProvider ()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public IModelBinder GetBinder (ModelBinderProviderContext context)
|
||||
{
|
||||
if (context == null) throw new ArgumentNullException(nameof(context));
|
||||
|
||||
// Intercept String form values.
|
||||
if (context.Metadata.ModelType == typeof(string))
|
||||
return new BinderTypeModelBinder(typeof(OpnModelBinder));
|
||||
|
||||
// Default - return null so that default binding provider is used.
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<gcServer enabled="true"/>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "asp.net",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "3.3.6",
|
||||
"jquery": "2.2.0",
|
||||
"jquery-validation": "1.14.0",
|
||||
"jquery-validation-unobtrusive": "3.2.6"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Configure bundling and minification for the project.
|
||||
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
|
||||
[
|
||||
{
|
||||
"outputFileName": "wwwroot/css/site.min.css",
|
||||
// An array of relative input file paths. Globbing patterns supported
|
||||
"inputFiles": [
|
||||
"wwwroot/css/site.css"
|
||||
]
|
||||
},
|
||||
{
|
||||
"outputFileName": "wwwroot/js/site.min.js",
|
||||
"inputFiles": [
|
||||
"wwwroot/js/site.js"
|
||||
],
|
||||
// Optionally specify minification options
|
||||
"minify": {
|
||||
"enabled": true,
|
||||
"renameLocals": true
|
||||
},
|
||||
// Optionally generate .map file
|
||||
"sourceMap": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
</configuration>
|
||||
@@ -0,0 +1,35 @@
|
||||
body {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Wrapping element */
|
||||
/* Set some basic padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
/* Carousel */
|
||||
.carousel-caption p {
|
||||
font-size: 20px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* Make .svg files in the carousel display properly in older browsers */
|
||||
.carousel-inner .item img[src$=".svg"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* QR code generator */
|
||||
#qrCode {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
/* Hide/rearrange for smaller screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
/* Hide captions */
|
||||
.carousel-caption {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 9.5 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 8.2 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 11 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1 @@
|
||||
// Write your Javascript code.
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "bootstrap",
|
||||
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
|
||||
"keywords": [
|
||||
"css",
|
||||
"js",
|
||||
"less",
|
||||
"mobile-first",
|
||||
"responsive",
|
||||
"front-end",
|
||||
"framework",
|
||||
"web"
|
||||
],
|
||||
"homepage": "http://getbootstrap.com",
|
||||
"license": "MIT",
|
||||
"moduleType": "globals",
|
||||
"main": [
|
||||
"less/bootstrap.less",
|
||||
"dist/js/bootstrap.js"
|
||||
],
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"_config.yml",
|
||||
"CNAME",
|
||||
"composer.json",
|
||||
"CONTRIBUTING.md",
|
||||
"docs",
|
||||
"js/tests",
|
||||
"test-infra"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "1.9.1 - 2"
|
||||
},
|
||||
"version": "3.3.6",
|
||||
"_release": "3.3.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v3.3.6",
|
||||
"commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a"
|
||||
},
|
||||
"_source": "https://github.com/twbs/bootstrap.git",
|
||||
"_target": "3.3.6",
|
||||
"_originalSource": "bootstrap"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Bootstrap uses [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for its changelogs.
|
||||
|
||||
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap.
|
||||
|
||||
Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
|
||||
@@ -0,0 +1,533 @@
|
||||
/*!
|
||||
* Bootstrap's Gruntfile
|
||||
* http://getbootstrap.com
|
||||
* Copyright 2013-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
// Force use of Unix newlines
|
||||
grunt.util.linefeed = '\n';
|
||||
|
||||
RegExp.quote = function (string) {
|
||||
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||
};
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var npmShrinkwrap = require('npm-shrinkwrap');
|
||||
var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');
|
||||
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
|
||||
var getLessVarsData = function () {
|
||||
var filePath = path.join(__dirname, 'less/variables.less');
|
||||
var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
|
||||
var parser = new BsLessdocParser(fileContent);
|
||||
return { sections: parser.parseFile() };
|
||||
};
|
||||
var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
|
||||
var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js');
|
||||
var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' });
|
||||
|
||||
Object.keys(configBridge.paths).forEach(function (key) {
|
||||
configBridge.paths[key].forEach(function (val, i, arr) {
|
||||
arr[i] = path.join('./docs/assets', val);
|
||||
});
|
||||
});
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
|
||||
// Metadata.
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
banner: '/*!\n' +
|
||||
' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
|
||||
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
|
||||
' * Licensed under the <%= pkg.license %> license\n' +
|
||||
' */\n',
|
||||
jqueryCheck: configBridge.config.jqueryCheck.join('\n'),
|
||||
jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'),
|
||||
|
||||
// Task configuration.
|
||||
clean: {
|
||||
dist: 'dist',
|
||||
docs: 'docs/dist'
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: 'js/.jshintrc'
|
||||
},
|
||||
grunt: {
|
||||
options: {
|
||||
jshintrc: 'grunt/.jshintrc'
|
||||
},
|
||||
src: ['Gruntfile.js', 'package.js', 'grunt/*.js']
|
||||
},
|
||||
core: {
|
||||
src: 'js/*.js'
|
||||
},
|
||||
test: {
|
||||
options: {
|
||||
jshintrc: 'js/tests/unit/.jshintrc'
|
||||
},
|
||||
src: 'js/tests/unit/*.js'
|
||||
},
|
||||
assets: {
|
||||
src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
|
||||
}
|
||||
},
|
||||
|
||||
jscs: {
|
||||
options: {
|
||||
config: 'js/.jscsrc'
|
||||
},
|
||||
grunt: {
|
||||
src: '<%= jshint.grunt.src %>'
|
||||
},
|
||||
core: {
|
||||
src: '<%= jshint.core.src %>'
|
||||
},
|
||||
test: {
|
||||
src: '<%= jshint.test.src %>'
|
||||
},
|
||||
assets: {
|
||||
options: {
|
||||
requireCamelCaseOrUpperCaseIdentifiers: null
|
||||
},
|
||||
src: '<%= jshint.assets.src %>'
|
||||
}
|
||||
},
|
||||
|
||||
concat: {
|
||||
options: {
|
||||
banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>',
|
||||
stripBanners: false
|
||||
},
|
||||
bootstrap: {
|
||||
src: [
|
||||
'js/transition.js',
|
||||
'js/alert.js',
|
||||
'js/button.js',
|
||||
'js/carousel.js',
|
||||
'js/collapse.js',
|
||||
'js/dropdown.js',
|
||||
'js/modal.js',
|
||||
'js/tooltip.js',
|
||||
'js/popover.js',
|
||||
'js/scrollspy.js',
|
||||
'js/tab.js',
|
||||
'js/affix.js'
|
||||
],
|
||||
dest: 'dist/js/<%= pkg.name %>.js'
|
||||
}
|
||||
},
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
compress: {
|
||||
warnings: false
|
||||
},
|
||||
mangle: true,
|
||||
preserveComments: 'some'
|
||||
},
|
||||
core: {
|
||||
src: '<%= concat.bootstrap.dest %>',
|
||||
dest: 'dist/js/<%= pkg.name %>.min.js'
|
||||
},
|
||||
customize: {
|
||||
src: configBridge.paths.customizerJs,
|
||||
dest: 'docs/assets/js/customize.min.js'
|
||||
},
|
||||
docsJs: {
|
||||
src: configBridge.paths.docsJs,
|
||||
dest: 'docs/assets/js/docs.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
qunit: {
|
||||
options: {
|
||||
inject: 'js/tests/unit/phantom.js'
|
||||
},
|
||||
files: 'js/tests/index.html'
|
||||
},
|
||||
|
||||
less: {
|
||||
compileCore: {
|
||||
options: {
|
||||
strictMath: true,
|
||||
sourceMap: true,
|
||||
outputSourceFiles: true,
|
||||
sourceMapURL: '<%= pkg.name %>.css.map',
|
||||
sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
|
||||
},
|
||||
src: 'less/bootstrap.less',
|
||||
dest: 'dist/css/<%= pkg.name %>.css'
|
||||
},
|
||||
compileTheme: {
|
||||
options: {
|
||||
strictMath: true,
|
||||
sourceMap: true,
|
||||
outputSourceFiles: true,
|
||||
sourceMapURL: '<%= pkg.name %>-theme.css.map',
|
||||
sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map'
|
||||
},
|
||||
src: 'less/theme.less',
|
||||
dest: 'dist/css/<%= pkg.name %>-theme.css'
|
||||
}
|
||||
},
|
||||
|
||||
autoprefixer: {
|
||||
options: {
|
||||
browsers: configBridge.config.autoprefixerBrowsers
|
||||
},
|
||||
core: {
|
||||
options: {
|
||||
map: true
|
||||
},
|
||||
src: 'dist/css/<%= pkg.name %>.css'
|
||||
},
|
||||
theme: {
|
||||
options: {
|
||||
map: true
|
||||
},
|
||||
src: 'dist/css/<%= pkg.name %>-theme.css'
|
||||
},
|
||||
docs: {
|
||||
src: ['docs/assets/css/src/docs.css']
|
||||
},
|
||||
examples: {
|
||||
expand: true,
|
||||
cwd: 'docs/examples/',
|
||||
src: ['**/*.css'],
|
||||
dest: 'docs/examples/'
|
||||
}
|
||||
},
|
||||
|
||||
csslint: {
|
||||
options: {
|
||||
csslintrc: 'less/.csslintrc'
|
||||
},
|
||||
dist: [
|
||||
'dist/css/bootstrap.css',
|
||||
'dist/css/bootstrap-theme.css'
|
||||
],
|
||||
examples: [
|
||||
'docs/examples/**/*.css'
|
||||
],
|
||||
docs: {
|
||||
options: {
|
||||
ids: false,
|
||||
'overqualified-elements': false
|
||||
},
|
||||
src: 'docs/assets/css/src/docs.css'
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
options: {
|
||||
// TODO: disable `zeroUnits` optimization once clean-css 3.2 is released
|
||||
// and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly
|
||||
compatibility: 'ie8',
|
||||
keepSpecialComments: '*',
|
||||
sourceMap: true,
|
||||
advanced: false
|
||||
},
|
||||
minifyCore: {
|
||||
src: 'dist/css/<%= pkg.name %>.css',
|
||||
dest: 'dist/css/<%= pkg.name %>.min.css'
|
||||
},
|
||||
minifyTheme: {
|
||||
src: 'dist/css/<%= pkg.name %>-theme.css',
|
||||
dest: 'dist/css/<%= pkg.name %>-theme.min.css'
|
||||
},
|
||||
docs: {
|
||||
src: [
|
||||
'docs/assets/css/ie10-viewport-bug-workaround.css',
|
||||
'docs/assets/css/src/pygments-manni.css',
|
||||
'docs/assets/css/src/docs.css'
|
||||
],
|
||||
dest: 'docs/assets/css/docs.min.css'
|
||||
}
|
||||
},
|
||||
|
||||
csscomb: {
|
||||
options: {
|
||||
config: 'less/.csscomb.json'
|
||||
},
|
||||
dist: {
|
||||
expand: true,
|
||||
cwd: 'dist/css/',
|
||||
src: ['*.css', '!*.min.css'],
|
||||
dest: 'dist/css/'
|
||||
},
|
||||
examples: {
|
||||
expand: true,
|
||||
cwd: 'docs/examples/',
|
||||
src: '**/*.css',
|
||||
dest: 'docs/examples/'
|
||||
},
|
||||
docs: {
|
||||
src: 'docs/assets/css/src/docs.css',
|
||||
dest: 'docs/assets/css/src/docs.css'
|
||||
}
|
||||
},
|
||||
|
||||
copy: {
|
||||
fonts: {
|
||||
expand: true,
|
||||
src: 'fonts/*',
|
||||
dest: 'dist/'
|
||||
},
|
||||
docs: {
|
||||
expand: true,
|
||||
cwd: 'dist/',
|
||||
src: [
|
||||
'**/*'
|
||||
],
|
||||
dest: 'docs/dist/'
|
||||
}
|
||||
},
|
||||
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 3000,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
jekyll: {
|
||||
options: {
|
||||
config: '_config.yml'
|
||||
},
|
||||
docs: {},
|
||||
github: {
|
||||
options: {
|
||||
raw: 'github: true'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
htmlmin: {
|
||||
dist: {
|
||||
options: {
|
||||
collapseWhitespace: true,
|
||||
conservativeCollapse: true,
|
||||
minifyCSS: true,
|
||||
minifyJS: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true
|
||||
},
|
||||
expand: true,
|
||||
cwd: '_gh_pages',
|
||||
dest: '_gh_pages',
|
||||
src: [
|
||||
'**/*.html',
|
||||
'!examples/**/*.html'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
jade: {
|
||||
options: {
|
||||
pretty: true,
|
||||
data: getLessVarsData
|
||||
},
|
||||
customizerVars: {
|
||||
src: 'docs/_jade/customizer-variables.jade',
|
||||
dest: 'docs/_includes/customizer-variables.html'
|
||||
},
|
||||
customizerNav: {
|
||||
src: 'docs/_jade/customizer-nav.jade',
|
||||
dest: 'docs/_includes/nav/customize.html'
|
||||
}
|
||||
},
|
||||
|
||||
htmllint: {
|
||||
options: {
|
||||
ignore: [
|
||||
'Attribute "autocomplete" not allowed on element "button" at this point.',
|
||||
'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".',
|
||||
'Element "img" is missing required attribute "src".'
|
||||
]
|
||||
},
|
||||
src: '_gh_pages/**/*.html'
|
||||
},
|
||||
|
||||
watch: {
|
||||
src: {
|
||||
files: '<%= jshint.core.src %>',
|
||||
tasks: ['jshint:core', 'qunit', 'concat']
|
||||
},
|
||||
test: {
|
||||
files: '<%= jshint.test.src %>',
|
||||
tasks: ['jshint:test', 'qunit']
|
||||
},
|
||||
less: {
|
||||
files: 'less/**/*.less',
|
||||
tasks: 'less'
|
||||
}
|
||||
},
|
||||
|
||||
sed: {
|
||||
versionNumber: {
|
||||
pattern: (function () {
|
||||
var old = grunt.option('oldver');
|
||||
return old ? RegExp.quote(old) : old;
|
||||
})(),
|
||||
replacement: grunt.option('newver'),
|
||||
exclude: [
|
||||
'dist/fonts',
|
||||
'docs/assets',
|
||||
'fonts',
|
||||
'js/tests/vendor',
|
||||
'node_modules',
|
||||
'test-infra'
|
||||
],
|
||||
recursive: true
|
||||
}
|
||||
},
|
||||
|
||||
'saucelabs-qunit': {
|
||||
all: {
|
||||
options: {
|
||||
build: process.env.TRAVIS_JOB_ID,
|
||||
throttled: 10,
|
||||
maxRetries: 3,
|
||||
maxPollRetries: 4,
|
||||
urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'],
|
||||
browsers: grunt.file.readYAML('grunt/sauce_browsers.yml')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
exec: {
|
||||
npmUpdate: {
|
||||
command: 'npm update'
|
||||
}
|
||||
},
|
||||
|
||||
compress: {
|
||||
main: {
|
||||
options: {
|
||||
archive: 'bootstrap-<%= pkg.version %>-dist.zip',
|
||||
mode: 'zip',
|
||||
level: 9,
|
||||
pretty: true
|
||||
},
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'dist/',
|
||||
src: ['**'],
|
||||
dest: 'bootstrap-<%= pkg.version %>-dist'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// These plugins provide necessary tasks.
|
||||
require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
// Docs HTML validation task
|
||||
grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']);
|
||||
|
||||
var runSubset = function (subset) {
|
||||
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;
|
||||
};
|
||||
var isUndefOrNonZero = function (val) {
|
||||
return val === undefined || val !== '0';
|
||||
};
|
||||
|
||||
// Test task.
|
||||
var testSubtasks = [];
|
||||
// Skip core tests if running a different subset of the test suite
|
||||
if (runSubset('core') &&
|
||||
// Skip core tests if this is a Savage build
|
||||
process.env.TRAVIS_REPO_SLUG !== 'twbs-savage/bootstrap') {
|
||||
testSubtasks = testSubtasks.concat(['dist-css', 'dist-js', 'csslint:dist', 'test-js', 'docs']);
|
||||
}
|
||||
// Skip HTML validation if running a different subset of the test suite
|
||||
if (runSubset('validate-html') &&
|
||||
// Skip HTML5 validator on Travis when [skip validator] is in the commit message
|
||||
isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) {
|
||||
testSubtasks.push('validate-html');
|
||||
}
|
||||
// Only run Sauce Labs tests if there's a Sauce access key
|
||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
||||
// Skip Sauce if running a different subset of the test suite
|
||||
runSubset('sauce-js-unit') &&
|
||||
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
||||
isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
||||
testSubtasks.push('connect');
|
||||
testSubtasks.push('saucelabs-qunit');
|
||||
}
|
||||
grunt.registerTask('test', testSubtasks);
|
||||
grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']);
|
||||
|
||||
// JS distribution task.
|
||||
grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']);
|
||||
|
||||
// CSS distribution task.
|
||||
grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']);
|
||||
grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']);
|
||||
|
||||
// Full distribution task.
|
||||
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']);
|
||||
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['clean:dist', 'copy:fonts', 'test']);
|
||||
|
||||
// Version numbering task.
|
||||
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
|
||||
// This can be overzealous, so its changes should always be manually reviewed!
|
||||
grunt.registerTask('change-version-number', 'sed');
|
||||
|
||||
grunt.registerTask('build-glyphicons-data', function () { generateGlyphiconsData.call(this, grunt); });
|
||||
|
||||
// task for building customizer
|
||||
grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']);
|
||||
grunt.registerTask('build-customizer-html', 'jade');
|
||||
grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () {
|
||||
var banner = grunt.template.process('<%= banner %>');
|
||||
generateRawFiles(grunt, banner);
|
||||
});
|
||||
|
||||
grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () {
|
||||
var srcFiles = grunt.config.get('concat.bootstrap.src');
|
||||
var destFilepath = 'dist/js/npm.js';
|
||||
generateCommonJSModule(grunt, srcFiles, destFilepath);
|
||||
});
|
||||
|
||||
// Docs task.
|
||||
grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']);
|
||||
grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']);
|
||||
grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']);
|
||||
grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']);
|
||||
grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']);
|
||||
|
||||
grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']);
|
||||
|
||||
// Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json).
|
||||
// This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
|
||||
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']);
|
||||
grunt.registerTask('_update-shrinkwrap', function () {
|
||||
var done = this.async();
|
||||
npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) {
|
||||
if (err) {
|
||||
grunt.fail.warn(err);
|
||||
}
|
||||
var dest = 'test-infra/npm-shrinkwrap.json';
|
||||
fs.renameSync('npm-shrinkwrap.json', dest);
|
||||
grunt.log.writeln('File ' + dest.cyan + ' updated.');
|
||||
done();
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2015 Twitter, Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user