initial version with inspection edition

This commit is contained in:
2020-04-29 14:08:00 +08:00
commit 6a5629fc3b
186 changed files with 33984 additions and 0 deletions

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<appSettings>
<add key="DbConntionString" value="Data Source=192.168.25.215\IRONINTEL;Initial Catalog=IRONINTEL_IRONDEV;Integrated Security=false;User ID=fi;Password=database"/>
<add key="AppVersion" value="2.17.1.19"/>
<add key="LastUpdateTime" value="10/17/2016 10:36:26.229"/>
<add key="FleetAssetServiceAddress" value="http://192.168.25.210:5081/fleet/1/fleetsvc;http://192.168.25.210:5081/fleet/2/fleetsvc"/>
<add key="StartFICAlertService" value="false"/>
<add key="StartFICChartSubscribeService" value="false"/>
</appSettings>
</configuration>

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Text;
using System.Configuration;
using System.ServiceProcess;
using System.Threading;
using FI.FIC.DataProviders.Alert;
namespace IronIntel.Contractor
{
public class IronIntelService : ServiceBase
{
private static bool IsTrue(string s)
{
return (string.Compare(s, "true", true) == 0 || string.Compare(s, "yes", true) == 0 || string.Compare(s, "1", true) == 0);
}
private AlertManagerEx _Alert = null;
protected override void OnStart(string[] args)
{
base.OnStart(args);
SystemParams.CreateDbObjects();
if (IsTrue(ConfigurationManager.AppSettings["StartFICAlertService"]))
{
_Alert = new AlertManagerEx();
_Alert.Start();
Log.WriteMessage("FIC Alert Service Started.");
}
if (IsTrue(ConfigurationManager.AppSettings["StartFICChartSubscribeService"]))
{
FI.FIC.Email.ChartProvider.StartSend();
Log.WriteMessage("FIC Chart Subscribe Service Started.");
}
}
protected override void OnStop()
{
if(_Alert!=null)
{
_Alert.Stop();
_Alert = null;
}
FI.FIC.Email.ChartProvider.EndSend();
base.OnStop();
}
}
}

View File

@ -0,0 +1,100 @@
<?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>{B5E29343-DF46-47DE-A8E8-69BCF58C0697}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>IronIntel.Contractor</RootNamespace>
<AssemblyName>IronIntelSiteServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.7.2</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>LHBIS.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="FICBLC, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Reflib\FIC\FICBLC.dll</HintPath>
</Reference>
<Reference Include="FICEmailSubscribe">
<HintPath>..\Reflib\FIC\FICEmailSubscribe.dll</HintPath>
</Reference>
<Reference Include="FIChartLib">
<HintPath>..\Reflib\FIC\FIChartLib.dll</HintPath>
</Reference>
<Reference Include="FICIntf, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Reflib\FIC\FICIntf.dll</HintPath>
</Reference>
<Reference Include="FICIntfAdv, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Reflib\FIC\FICIntfAdv.dll</HintPath>
</Reference>
<Reference Include="FICModels, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b006d6021b5c4397, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Reflib\FIC\FICModels.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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="Log.cs" />
<Compile Include="IronIntelService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="LHBIS.snk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IronIntelContractorBusiness\IronIntelContractorBusiness.csproj">
<Project>{515fb61f-f032-4a48-8f32-93b59b9d37f8}</Project>
<Name>IronIntelContractorBusiness</Name>
</ProjectReference>
<ProjectReference Include="..\IronIntelContractorSiteLib\IronIntelContractorSiteLib.csproj">
<Project>{9d398985-9424-4fc7-a637-6b5b204d8f7c}</Project>
<Name>IronIntelContractorSiteLib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace IronIntel.Contractor
{
static class Log
{
public static void WriteMessage(string msg)
{
try
{
string dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log");
if(!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
string fn = Path.Combine(dir, "svclog.txt");
using (FileStream fs = new FileStream(fn, FileMode.Append, FileAccess.Write))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
sw.Write(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff"));
sw.Write(": ");
sw.WriteLine(msg);
}
}
}
catch
{ }
}
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace IronIntel.Contractor
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
IronIntel.Contractor.IronIntelHost.Init();
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new IronIntelService()
};
ServiceBase.Run(ServicesToRun);
}
}
}

View File

@ -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("IronIntelSiteServiceHost")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Foresight Intelligence")]
[assembly: AssemblyProduct("IronIntelSiteServiceHost")]
[assembly: AssemblyCopyright("Copyright © Foresight Intelligence 2019")]
[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("b5e29343-df46-47de-a8e8-69bcf58c0697")]
// 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("3.0.0.0")]
[assembly: AssemblyFileVersion("3.20.420")]