go
This commit is contained in:
57
C4IT.API.Contracts/C4IT.API.Contracts.csproj
Normal file
57
C4IT.API.Contracts/C4IT.API.Contracts.csproj
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?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>{6CF1365B-C5BC-479C-B7BF-9229DEC98988}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>C4IT.API.Contracts</RootNamespace>
|
||||||
|
<AssemblyName>C4IT.API.Contracts</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<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' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<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.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\CommonAssembyInfo.cs">
|
||||||
|
<Link>Properties\CommonAssembyInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Contracts.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
100
C4IT.API.Contracts/Contracts.cs
Normal file
100
C4IT.API.Contracts/Contracts.cs
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace C4IT.API.Contracts
|
||||||
|
{
|
||||||
|
public class Announcement
|
||||||
|
{
|
||||||
|
public string _message = String.Empty;
|
||||||
|
public string _subject = String.Empty;
|
||||||
|
public int Type = 0;
|
||||||
|
public DateTime _createdDate;
|
||||||
|
public DateTime? _visibleFrom;
|
||||||
|
public Guid _objectID;
|
||||||
|
public string _prioColor;
|
||||||
|
public int _priority = 0;
|
||||||
|
public bool _isAdhoc = false;
|
||||||
|
|
||||||
|
public SolidColorBrush getPrioColorBrush()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(_prioColor))
|
||||||
|
{
|
||||||
|
if (_prioColor.StartsWith("0x"))
|
||||||
|
{
|
||||||
|
return new SolidColorBrush((Color)ColorConverter.ConvertFromString(_prioColor.Replace("0xFF", "#")));
|
||||||
|
}
|
||||||
|
return new SolidColorBrush((Color)ColorConverter.ConvertFromString(_prioColor));
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Ticket
|
||||||
|
{
|
||||||
|
public string _ticketNumber;
|
||||||
|
public string _subject;
|
||||||
|
public string _state;
|
||||||
|
public DateTime _createdDate;
|
||||||
|
public Int32 _lastJournalEntryAction;
|
||||||
|
public DateTime _lastJournalEntryDate;
|
||||||
|
public Guid _objectID;
|
||||||
|
public string _sysEntity;
|
||||||
|
public Int32 _stateValue;
|
||||||
|
public bool _newInformation;
|
||||||
|
public string _lastJournalEntryActionText;
|
||||||
|
public string _ticketType;
|
||||||
|
public Ticket()
|
||||||
|
{
|
||||||
|
_lastJournalEntryAction = 0;
|
||||||
|
_stateValue = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum enumMainFunctions { Announcement = 0, Information, Ssp, Incident, CustomLinks };
|
||||||
|
public class CustomerPanelConfig
|
||||||
|
{
|
||||||
|
public string _remoteAppPath = String.Empty;
|
||||||
|
public bool _disableClosing = false;
|
||||||
|
public int _iconColor = 10;
|
||||||
|
public int _mainIconTextColor = 10;
|
||||||
|
public Version _ServerVersion;
|
||||||
|
public bool _isStartApplicationMinimized;
|
||||||
|
public string _logoUrl = null;
|
||||||
|
public string _trayIconUrl = null;
|
||||||
|
public Dictionary<String, String> _uiColors = new Dictionary<string, string>();
|
||||||
|
public bool _isDraggable = false;
|
||||||
|
public Dictionary<string, string> _linkList = new Dictionary<string, string>();
|
||||||
|
public int _timerIntervalTicket = 10;
|
||||||
|
public int _timerIntervalAdHocAnnouncements = 2;
|
||||||
|
public int _timerIntervalRegularAnnouncements = 10;
|
||||||
|
public string _createNewTicketDirectLink = String.Empty;
|
||||||
|
public bool _isUUX = true;
|
||||||
|
public string _encryptedApiToken = String.Empty;
|
||||||
|
public int _reloginIntervalDays = 14;
|
||||||
|
public Dictionary<enumMainFunctions, bool> MainFunctionActivation = new Dictionary<enumMainFunctions, bool>()
|
||||||
|
{
|
||||||
|
{enumMainFunctions.Announcement, false },
|
||||||
|
{enumMainFunctions.Incident, false },
|
||||||
|
{enumMainFunctions.Ssp, false },
|
||||||
|
{enumMainFunctions.Information, true },
|
||||||
|
{enumMainFunctions.CustomLinks, false }
|
||||||
|
};
|
||||||
|
|
||||||
|
public CustomerPanelConfig()
|
||||||
|
{
|
||||||
|
_uiColors["activeButtonColor"] = "#186292";
|
||||||
|
_uiColors["inactiveButtonColor"] = "#186292";
|
||||||
|
_uiColors["backgroundColor"] = "#FFCDC9C9";
|
||||||
|
_uiColors["headerColor"] = "#FFCDC9C9";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum announcementType
|
||||||
|
{
|
||||||
|
Adhoc = 1,
|
||||||
|
Regular = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
C4IT.API.Contracts/Properties/AssemblyInfo.cs
Normal file
11
C4IT.API.Contracts/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
|
// die einer Assembly zugeordnet sind.
|
||||||
|
[assembly: AssemblyTitle("C4IT.API.Contracts")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("6cf1365b-c5bc-479c-b7bf-9229dec98988")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||||
|
<PackageReference Include="Moq" Version="4.20.72" />
|
||||||
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
|
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
||||||
|
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\C4IT.API.Contracts\C4IT.API.Contracts.csproj" />
|
||||||
|
<ProjectReference Include="..\C4IT.API\C4IT.API.CustomerPanel.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Matrix42.Contracts.Common">
|
||||||
|
<HintPath>..\lib\Matrix42.Contracts.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Matrix42.Pandora.Contracts">
|
||||||
|
<HintPath>..\lib\Matrix42.Pandora.Contracts.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Http">
|
||||||
|
<HintPath>..\..\..\Users\OT202\source\repos\FleetMarketTestWebService\FleetMarketTestWebService\lib\System.Web.Http.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="update4u.SPS.DataLayer">
|
||||||
|
<HintPath>..\lib\update4u.SPS.DataLayer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Using Include="NUnit.Framework" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
41
C4IT.API.CustomerPanelTests/CustomerPanelControllerTest.cs
Normal file
41
C4IT.API.CustomerPanelTests/CustomerPanelControllerTest.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using C4IT.API.Contracts;
|
||||||
|
using Matrix42.Pandora.Contracts;
|
||||||
|
using Matrix42.Pandora.Contracts.Internationalization;
|
||||||
|
using Moq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using update4u.SPS.DataLayer;
|
||||||
|
using System.Net.Http.Formatting;
|
||||||
|
|
||||||
|
namespace C4IT.API.CustomerPanelTests
|
||||||
|
{
|
||||||
|
public class CustomerPanelControllerTest
|
||||||
|
{
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void GetVersion_ShouldReturnDefaultVersion_WhenDataIsInvalid()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var expectedDefaultVersion = new Version(0, 0, 0, 0);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
CustomerPanelHelper customerPanelHelper = new CustomerPanelHelper();
|
||||||
|
customerPanelHelper.getVersion();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.That(customerPanelHelper.getVersion(), Is.EqualTo(expectedDefaultVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
|
||||||
|
// GetVersion_HandlesExceptions
|
||||||
|
// GetVersion_ReturnsDefaultVersion_WhenDataTableIsNull
|
||||||
|
// GetVersion_ReturnsDefaultVersion_WhenDataTableIsEmpty
|
||||||
|
// GetVersion_ReturnsDefaultVersion_WhenDatabaseQueryFails
|
||||||
|
// GetVersion_ReturnsCorrectVersion_WhenDatabaseQuerySucceeds
|
||||||
|
}
|
||||||
|
}
|
||||||
85
C4IT.API.Helper/C4IT.API.Helper.csproj
Normal file
85
C4IT.API.Helper/C4IT.API.Helper.csproj
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?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>{68000E96-161F-42E4-81C1-552EC2B00BD9}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>C4IT.API.Helper</RootNamespace>
|
||||||
|
<AssemblyName>C4IT.API.Helper</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<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' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="log4net">
|
||||||
|
<HintPath>..\lib\log4net.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Matrix42.Common">
|
||||||
|
<HintPath>..\..\..\Users\OT202\source\repos\FleetMarketTestWebService\FleetMarketTestWebService\lib\Matrix42.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="Microsoft.Net.Http.Headers">
|
||||||
|
<HintPath>..\lib\Microsoft.Net.Http.Headers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="QRCoder">
|
||||||
|
<HintPath>..\lib\QRCoder.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Web.Http">
|
||||||
|
<HintPath>..\..\..\Users\OT202\source\repos\FleetMarketTestWebService\FleetMarketTestWebService\lib\System.Web.Http.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<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.Xml" />
|
||||||
|
<Reference Include="update4u.SPS.DatabaseFileStorage">
|
||||||
|
<HintPath>..\lib\update4u.SPS.DatabaseFileStorage.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="update4u.SPS.DataLayer">
|
||||||
|
<HintPath>..\..\..\Users\OT202\source\repos\FleetMarketTestWebService\FleetMarketTestWebService\lib\update4u.SPS.DataLayer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\CommonAssembyInfo.cs">
|
||||||
|
<Link>Properties\CommonAssembyInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="HelperController.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
178
C4IT.API.Helper/HelperController.cs
Normal file
178
C4IT.API.Helper/HelperController.cs
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web.Http;
|
||||||
|
using update4u.SPS.DataLayer;
|
||||||
|
using update4u.SPS.DatabaseFileStorage;
|
||||||
|
using update4u.SPS.DataLayer.Schema.Internal;
|
||||||
|
using QRCoder;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace C4IT.API.Helper
|
||||||
|
{
|
||||||
|
[RoutePrefix("api/c4it/helper")]
|
||||||
|
public class HelperController : ApiController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[Route("copyFiles"), HttpGet]
|
||||||
|
public string copyFiles(Guid sourceEOID, Guid targetEOID)
|
||||||
|
{
|
||||||
|
StorageService storageService = new StorageService();
|
||||||
|
if (!sourceEOID.Equals(Guid.Empty) && !targetEOID.Equals(Guid.Empty))
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Guid sourceTypeID = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + sourceEOID.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
Guid targetTypeID = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + targetEOID.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
|
||||||
|
string targetFolder = StorageService.GetFolderName(targetTypeID, targetEOID);
|
||||||
|
string sourceFolder = StorageService.GetFolderName(sourceTypeID, sourceEOID);
|
||||||
|
List<DatabaseFile> dbFiles = storageService.ListFiles(sourceFolder);
|
||||||
|
|
||||||
|
List<Guid> copyFileGuids = new List<Guid>();
|
||||||
|
foreach (DatabaseFile dbFile in dbFiles)
|
||||||
|
{
|
||||||
|
copyFileGuids.Add(dbFile.FileGuid);
|
||||||
|
|
||||||
|
}
|
||||||
|
storageService.CopyFiles(copyFileGuids, targetFolder);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "ok";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Route("moveFiles"), HttpGet]
|
||||||
|
public string moveFiles(Guid sourceEOID, Guid targetEOID)
|
||||||
|
{
|
||||||
|
StorageService storageService = new StorageService();
|
||||||
|
if (!sourceEOID.Equals(Guid.Empty) && !targetEOID.Equals(Guid.Empty)) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
Guid sourceTypeID = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + sourceEOID.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
Guid targetTypeID = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + targetEOID.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
|
||||||
|
string targetFolder = StorageService.GetFolderName(targetTypeID, targetEOID);
|
||||||
|
string sourceFolder = StorageService.GetFolderName(sourceTypeID, sourceEOID);
|
||||||
|
|
||||||
|
|
||||||
|
storageService.RenameFolder(sourceFolder, targetFolder);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "ok";
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("unreadActivity"), HttpPost]
|
||||||
|
public string unreadActivity(Guid[] activiesEOID)
|
||||||
|
{
|
||||||
|
string log = activiesEOID.Length.ToString();
|
||||||
|
if (activiesEOID.Length > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (Guid activityEOID in activiesEOID)
|
||||||
|
{
|
||||||
|
|
||||||
|
Guid typeId = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + activityEOID.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
SPSObject activity = ObjectRequest.GetSPSObject(typeId, activityEOID);
|
||||||
|
log += " / " + activity.GetAttribute("SPSActivityClassBase", "TicketNumber");
|
||||||
|
activity.UpdateAttribute("SPSActivityClassBase","NewInformationReceived",DBNull.Value);
|
||||||
|
activity.Update();
|
||||||
|
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
return log + " / " + e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return log;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("genQrCode"),HttpGet]
|
||||||
|
public HttpResponseMessage genQRCode(string qrText)
|
||||||
|
{
|
||||||
|
QRCodeGenerator qrGenerator = new QRCodeGenerator();
|
||||||
|
QRCodeData qrCodeData = qrGenerator.CreateQrCode(qrText,
|
||||||
|
QRCodeGenerator.ECCLevel.Q);
|
||||||
|
QRCode qrCode = new QRCode(qrCodeData);
|
||||||
|
Bitmap qrCodeImage = qrCode.GetGraphic(20);
|
||||||
|
var dataStream = new MemoryStream(BitmapToBytes(qrCodeImage));
|
||||||
|
var fileName = Path.GetInvalidFileNameChars().Aggregate(qrText.Substring(0, 10), (current, c) => current.Replace(c.ToString(), string.Empty));
|
||||||
|
if (String.IsNullOrEmpty(fileName))
|
||||||
|
{
|
||||||
|
fileName = "dummy";
|
||||||
|
}
|
||||||
|
HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK);
|
||||||
|
httpResponseMessage.Content = new StreamContent(dataStream);
|
||||||
|
httpResponseMessage.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
|
||||||
|
httpResponseMessage.Content.Headers.ContentDisposition.FileName = fileName+".png";
|
||||||
|
httpResponseMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/png");
|
||||||
|
|
||||||
|
return httpResponseMessage;
|
||||||
|
}
|
||||||
|
// This method is for converting bitmap into a byte array
|
||||||
|
private static byte[] BitmapToBytes(Bitmap img)
|
||||||
|
{
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
|
||||||
|
return stream.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Route("copyObject"), HttpGet]
|
||||||
|
|
||||||
|
public string copyObject(Guid objectToCopy)
|
||||||
|
{
|
||||||
|
string log = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Guid sourceTypeID = new Guid(FragmentRequestBase.SimpleLoad(SPSDataEngineSchemaReader.ClassGetIDFromName("SPSCommonClassBase"), "typeid", "[expression-objectid]='" + objectToCopy.ToString() + "'").Rows[0]["typeid"].ToString());
|
||||||
|
SPSObject oldObject = ObjectRequest.GetSPSObject(sourceTypeID, objectToCopy);
|
||||||
|
SPSObject newObject = (SPSObject)oldObject.CreateCopy(true);
|
||||||
|
|
||||||
|
IAttribute k = newObject.ConfigurationItem.AutoNumberAttribute;
|
||||||
|
string attrib = k.DbColumnName;
|
||||||
|
IDataDefinition dd = k.BelongsToSchemaObjectClass;
|
||||||
|
newObject.UpdateAttribute(dd.Name, attrib, DBNull.Value);
|
||||||
|
log = attrib + " / " + dd.Name;
|
||||||
|
|
||||||
|
|
||||||
|
newObject.Update();
|
||||||
|
}catch(Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return log;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Route("createUninstall"), HttpPost]
|
||||||
|
public bool createUninstall(Guid[] installBookings)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
C4IT.API.Helper/Properties/AssemblyInfo.cs
Normal file
11
C4IT.API.Helper/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
|
// die einer Assembly zugeordnet sind.
|
||||||
|
[assembly: AssemblyTitle("C4IT.API.Helper")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("68000e96-161f-42e4-81c1-552ec2b00bd9")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
15
C4IT.API.Helper/app.config
Normal file
15
C4IT.API.Helper/app.config
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
7
C4IT.API.Helper/packages.config
Normal file
7
C4IT.API.Helper/packages.config
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Microsoft.AspNetCore.Http.Abstractions" version="2.2.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.AspNetCore.Http.Features" version="2.2.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.AspNetCore.Mvc.Abstractions" version="2.2.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.AspNetCore.Routing.Abstractions" version="2.2.0" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
57
C4IT.API.sln
Normal file
57
C4IT.API.sln
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.10.35122.118
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C4IT.API.CustomerPanel", "C4IT.API\C4IT.API.CustomerPanel.csproj", "{C965495D-D326-4521-9B6A-668227ED0651}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C4IT.API.Contracts", "C4IT.API.Contracts\C4IT.API.Contracts.csproj", "{6CF1365B-C5BC-479C-B7BF-9229DEC98988}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Common", "_Common", "{2C8DF0C0-0FB7-4E67-8AC4-7C0D368410CE}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
CommonAssembyInfo.cs = CommonAssembyInfo.cs
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C4IT.API.CustomerPanelTests", "C4IT.API.CustomerPanelTests\C4IT.API.CustomerPanelTests.csproj", "{ECE98C21-EF8F-442B-BA98-8DB8E848D906}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{C965495D-D326-4521-9B6A-668227ED0651}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C965495D-D326-4521-9B6A-668227ED0651}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C965495D-D326-4521-9B6A-668227ED0651}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C965495D-D326-4521-9B6A-668227ED0651}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6CF1365B-C5BC-479C-B7BF-9229DEC98988}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6CF1365B-C5BC-479C-B7BF-9229DEC98988}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6CF1365B-C5BC-479C-B7BF-9229DEC98988}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6CF1365B-C5BC-479C-B7BF-9229DEC98988}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{ECE98C21-EF8F-442B-BA98-8DB8E848D906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{ECE98C21-EF8F-442B-BA98-8DB8E848D906}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{ECE98C21-EF8F-442B-BA98-8DB8E848D906}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ECE98C21-EF8F-442B-BA98-8DB8E848D906}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {4E72DDDF-0E9A-4BA8-B27B-3C86DBE20A7F}
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||||
|
SccNumberOfProjects = 4
|
||||||
|
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||||
|
SccTeamFoundationServer = https://consulting4it.visualstudio.com/
|
||||||
|
SccLocalPath0 = .
|
||||||
|
SccProjectUniqueName1 = C4IT.API.Contracts\\C4IT.API.Contracts.csproj
|
||||||
|
SccProjectName1 = C4IT.API.Contracts
|
||||||
|
SccLocalPath1 = C4IT.API.Contracts
|
||||||
|
SccProjectUniqueName2 = C4IT.API\\C4IT.API.CustomerPanel.csproj
|
||||||
|
SccProjectName2 = C4IT.API
|
||||||
|
SccLocalPath2 = C4IT.API
|
||||||
|
SccProjectUniqueName3 = C4IT.API.CustomerPanelTests\\C4IT.API.CustomerPanelTests.csproj
|
||||||
|
SccProjectName3 = C4IT.API.CustomerPanelTests
|
||||||
|
SccLocalPath3 = C4IT.API.CustomerPanelTests
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
60
C4IT.API/ApiCache.cs
Normal file
60
C4IT.API/ApiCache.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.Caching;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
class ApiCache
|
||||||
|
{
|
||||||
|
public static object GetValue(string key)
|
||||||
|
{
|
||||||
|
MemoryCache memoryCache = MemoryCache.Default;
|
||||||
|
|
||||||
|
return memoryCache.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object AddOrGet(string key, object value, DateTimeOffset absExpiration)
|
||||||
|
{
|
||||||
|
MemoryCache memoryCache = MemoryCache.Default;
|
||||||
|
lock (memoryCache)
|
||||||
|
{
|
||||||
|
return memoryCache.AddOrGetExisting(key, value, absExpiration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool Add(string key, object value, DateTimeOffset absExpiration)
|
||||||
|
{
|
||||||
|
|
||||||
|
MemoryCache memoryCache = MemoryCache.Default;
|
||||||
|
lock (memoryCache)
|
||||||
|
{
|
||||||
|
return memoryCache.Add(key, value, absExpiration);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Delete(string key)
|
||||||
|
{
|
||||||
|
MemoryCache memoryCache = MemoryCache.Default;
|
||||||
|
if (memoryCache.Contains(key))
|
||||||
|
{
|
||||||
|
memoryCache.Remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> GetAllKeysInCache()
|
||||||
|
{
|
||||||
|
MemoryCache memoryCache = MemoryCache.Default;
|
||||||
|
List<String> cacheKeys = new List<String>();
|
||||||
|
var keys= memoryCache.Where(o => true).Select(o => o.Key);
|
||||||
|
|
||||||
|
foreach (var key in keys)
|
||||||
|
{
|
||||||
|
cacheKeys.Add(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cacheKeys;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
170
C4IT.API/C4IT.API.CustomerPanel.csproj
Normal file
170
C4IT.API/C4IT.API.CustomerPanel.csproj
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<?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>{C965495D-D326-4521-9B6A-668227ED0651}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>C4IT.API.CustomerPanel</RootNamespace>
|
||||||
|
<AssemblyName>C4IT.API.CustomerPanel</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<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' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Matrix42.Common">
|
||||||
|
<HintPath>..\SB_DLLs\Matrix42.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Matrix42.Contracts.Common">
|
||||||
|
<HintPath>..\SB_DLLs\Matrix42.Contracts.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Matrix42.DataLayer.Common">
|
||||||
|
<HintPath>..\SB_DLLs\Matrix42.DataLayer.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Matrix42.Pandora.Contracts">
|
||||||
|
<HintPath>..\SB_DLLs\Matrix42.Pandora.Contracts.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Caching.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Options, Version=8.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Options.8.0.2\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Primitives.8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Owin, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Owin.4.2.2\lib\net45\Microsoft.Owin.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.4.2.2\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Owin.Security, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Owin.Security.4.2.2\lib\net45\Microsoft.Owin.Security.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Runtime.Caching" />
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Web.Http">
|
||||||
|
<HintPath>..\SB_DLLs\System.Web.Http.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<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.Xml" />
|
||||||
|
<Reference Include="update4u.SPS.Config">
|
||||||
|
<HintPath>..\SB_DLLs\update4u.SPS.Config.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="update4u.SPS.DataLayer">
|
||||||
|
<HintPath>..\SB_DLLs\update4u.SPS.DataLayer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\Common Code\Logging\C4IT.Logging.LogManager.cs">
|
||||||
|
<Link>Common\C4IT.Logging.LogManager.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\..\Common Code\Security\C4IT.Security.SecurePassword.cs">
|
||||||
|
<Link>Common\C4IT.Security.SecurePassword.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\CommonAssembyInfo.cs">
|
||||||
|
<Link>Properties\CommonAssembyInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ApiCache.cs" />
|
||||||
|
<Compile Include="cDirectDbCompat.cs" />
|
||||||
|
<Compile Include="ConverterHelper.cs" />
|
||||||
|
<Compile Include="CustomerPanelController.cs" />
|
||||||
|
<Compile Include="CustomerPanelHelper.cs" />
|
||||||
|
<Compile Include="CustomerPanelHub.cs" />
|
||||||
|
<Compile Include="PrivateCustomerPanelSecurePassword.cs" />
|
||||||
|
<Compile Include="CustomerPanelSecurePassword.cs" />
|
||||||
|
<Compile Include="DeepLinkBuilder.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<None Include="SignFiles.cmd" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Connected Services\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\C4IT.API.Contracts\C4IT.API.Contracts.csproj">
|
||||||
|
<Project>{6cf1365b-c5bc-479c-b7bf-9229dec98988}</Project>
|
||||||
|
<Name>C4IT.API.Contracts</Name>
|
||||||
|
<Private>True</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<PostBuildEvent>call "$(ProjectDir)PostBuildCopy.bat" "$(Configuration)"</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
70
C4IT.API/ConverterHelper.cs
Normal file
70
C4IT.API/ConverterHelper.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
public static class ConverterHelper
|
||||||
|
{
|
||||||
|
public static string Html2Plaintext(string html)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(html))
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
// 1. HTML‐Entities dekodieren (z.B. &uuml; → ü)
|
||||||
|
string decoded = WebUtility.HtmlDecode(html);
|
||||||
|
|
||||||
|
// 2. </p> und <br> durch Zeilenumbruch ersetzen
|
||||||
|
string withBreaks = Regex.Replace(
|
||||||
|
decoded,
|
||||||
|
@"</(?:p|div|li|blockquote|pre|h[1-6]|tr)\s*> # schließende Block-Tags
|
||||||
|
|<(?:br|hr)\b[^>]*> # <br>, <hr>
|
||||||
|
|<(?:ul|ol|table|thead|tbody|tfoot|article # öffnende Block-Container
|
||||||
|
|section|nav|aside|header|footer
|
||||||
|
|figure|figcaption|details|summary)[^>]*>",
|
||||||
|
" ",
|
||||||
|
RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
|
// 3. Alle übrigen Tags entfernen
|
||||||
|
string noTags = Regex.Replace(withBreaks, @"<[^>]+>", string.Empty);
|
||||||
|
|
||||||
|
return noTags.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool ObjectToBoolConverter(object source)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (source.Equals("1"))
|
||||||
|
{
|
||||||
|
source = 1;
|
||||||
|
}
|
||||||
|
return Convert.ToBoolean(source);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int ObjectToIntConverter(object source)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Convert.ToInt32(source);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ObjectToStringConverter(this object value)
|
||||||
|
{
|
||||||
|
return (value ?? string.Empty).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
156
C4IT.API/CustomerPanelController.cs
Normal file
156
C4IT.API/CustomerPanelController.cs
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Web.Http;
|
||||||
|
using C4IT.API.Contracts;
|
||||||
|
using C4IT.Logging;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Web.Http.Controllers;
|
||||||
|
using Matrix42.Pandora.Contracts;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
using Matrix42.Pandora.Contracts.Internationalization;
|
||||||
|
using System.Security.Principal;
|
||||||
|
using update4u.SPS.DataLayer.Query.FunctionExpression;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
[RoutePrefix("api/c4it/customerpanel")]
|
||||||
|
|
||||||
|
public class CustomerPanelController : ApiController
|
||||||
|
{
|
||||||
|
private readonly CustomerPanelHelper _CPanelHelper = new CustomerPanelHelper();
|
||||||
|
|
||||||
|
public static bool IsInitialized { get; private set; } = false;
|
||||||
|
|
||||||
|
public IPandoraUserProfile UserProfile => _userProfile;
|
||||||
|
|
||||||
|
public ICultureConfuguration GlobalSettings => _globalSettings;
|
||||||
|
|
||||||
|
public LanguageInfo[] Languages => _languages ?? (_languages = GlobalSettings.GetLanguages());
|
||||||
|
|
||||||
|
private static Object initLock = new object();
|
||||||
|
internal static CustomerPanelController controller = null;
|
||||||
|
|
||||||
|
private readonly IPandoraUserProfile _userProfile;
|
||||||
|
private readonly ICultureConfuguration _globalSettings;
|
||||||
|
private LanguageInfo[] _languages = null;
|
||||||
|
public CustomerPanelController(IPandoraUserProfile pandoraUserProfile, ICultureConfuguration globalSettings)
|
||||||
|
{
|
||||||
|
controller = this;
|
||||||
|
_userProfile = pandoraUserProfile;
|
||||||
|
_globalSettings = globalSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Initialize(HttpControllerContext controllerContext)
|
||||||
|
{
|
||||||
|
base.Initialize(controllerContext);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
lock (initLock)
|
||||||
|
{
|
||||||
|
if (IsInitialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var Ass = Assembly.GetExecutingAssembly();
|
||||||
|
var LM = cLogManagerFile.CreateInstance(LocalMachine: true, A: Ass);
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
cLogManager.DefaultLogger.LogAssemblyInfo(Ass);
|
||||||
|
|
||||||
|
CustomerPanelSecurePassword.Init();
|
||||||
|
PrivateCustomerPanelSecurePassword.Init();
|
||||||
|
|
||||||
|
IsInitialized = true;
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { };
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("version"), HttpGet]
|
||||||
|
public Version GetVersion()
|
||||||
|
{
|
||||||
|
return _CPanelHelper.getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("closeallclients"), HttpGet]
|
||||||
|
public bool GetCloseAllClients()
|
||||||
|
{
|
||||||
|
return _CPanelHelper.GetCloseAllClients();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("config"), HttpGet]
|
||||||
|
public CustomerPanelConfig GetConfig(bool noCache = false)
|
||||||
|
{
|
||||||
|
return _CPanelHelper.GetConfig(noCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("tickets/{userid:guid}"), HttpGet]
|
||||||
|
public List<Ticket> GetTicketsByUserId(Guid userId)
|
||||||
|
{
|
||||||
|
return _CPanelHelper.GetTickets(userId);
|
||||||
|
}
|
||||||
|
[Route("tickets"), HttpGet]
|
||||||
|
public List<Ticket> GetTickets()
|
||||||
|
{
|
||||||
|
return _CPanelHelper.GetTickets(controller.UserProfile.UserId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("resetCache"), HttpGet]
|
||||||
|
public bool ResetCache()
|
||||||
|
{
|
||||||
|
return this._CPanelHelper.ResetCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("announcements/{userid:guid}"), HttpGet]
|
||||||
|
public List<Contracts.Announcement> GetAnnouncementsByUserId(announcementType type, Guid userId, bool noCache = false)
|
||||||
|
{
|
||||||
|
return GetAnnouncementsInternal(type, userId, noCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("announcements"), HttpGet]
|
||||||
|
public List<Contracts.Announcement> GetAnnouncements(announcementType type, bool noCache = false)
|
||||||
|
{
|
||||||
|
return GetAnnouncementsInternal(type, null, noCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("isalive"), HttpGet]
|
||||||
|
public HttpResponseMessage isAlive()
|
||||||
|
{
|
||||||
|
return new HttpResponseMessage(HttpStatusCode.NoContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Contracts.Announcement> GetAnnouncementsInternal(announcementType type, Guid? userId, bool noCache)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case announcementType.Regular:
|
||||||
|
return userId.HasValue
|
||||||
|
? this._CPanelHelper.GetRegularAnnouncements(userId.Value)
|
||||||
|
: this._CPanelHelper.GetRegularAnnouncements(controller.UserProfile.UserId);
|
||||||
|
case announcementType.Adhoc:
|
||||||
|
return this._CPanelHelper.GetAdHocAnnouncements(noCache);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("Encode"), HttpPost]
|
||||||
|
public string Encode(string str)
|
||||||
|
{
|
||||||
|
return this._CPanelHelper.Encode(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("ApiCache"), HttpGet]
|
||||||
|
public Object GetApiCache()
|
||||||
|
{
|
||||||
|
return ApiCache.GetAllKeysInCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
//[Route("JoinPool"), HttpGet]
|
||||||
|
//public void JoinHubPool()
|
||||||
|
//{
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
1009
C4IT.API/CustomerPanelHelper.cs
Normal file
1009
C4IT.API/CustomerPanelHelper.cs
Normal file
File diff suppressed because it is too large
Load Diff
57
C4IT.API/CustomerPanelHub.cs
Normal file
57
C4IT.API/CustomerPanelHub.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
public delegate void ClientConnectionEventHandler(string clientId);
|
||||||
|
public delegate void ClientNameChangedEventHandler(string clientId, string newName);
|
||||||
|
public delegate void ClientGroupEventHandler(string clientId, string groupName);
|
||||||
|
|
||||||
|
public delegate void MessageReceivedEventHandler(string senderClientId, string message);
|
||||||
|
class CustomerPanelHub : Hub
|
||||||
|
{
|
||||||
|
static ConcurrentDictionary<string, string> _users = new ConcurrentDictionary<string, string>();
|
||||||
|
|
||||||
|
public static event ClientConnectionEventHandler ClientConnected;
|
||||||
|
public static event ClientConnectionEventHandler ClientDisconnected;
|
||||||
|
public static event ClientNameChangedEventHandler ClientNameChanged;
|
||||||
|
|
||||||
|
public static event ClientGroupEventHandler ClientJoinedToGroup;
|
||||||
|
public static event ClientGroupEventHandler ClientLeftGroup;
|
||||||
|
|
||||||
|
public static event MessageReceivedEventHandler MessageReceived;
|
||||||
|
|
||||||
|
public static void ClearState()
|
||||||
|
{
|
||||||
|
_users.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Called when a client is connected
|
||||||
|
public override Task OnConnected()
|
||||||
|
{
|
||||||
|
_users.TryAdd(Context.ConnectionId, Context.ConnectionId);
|
||||||
|
|
||||||
|
ClientConnected?.Invoke(Context.ConnectionId);
|
||||||
|
|
||||||
|
return base.OnConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Called when a client is disconnected
|
||||||
|
public override Task OnDisconnected(bool stopCalled)
|
||||||
|
{
|
||||||
|
string userName;
|
||||||
|
_users.TryRemove(Context.ConnectionId, out userName);
|
||||||
|
|
||||||
|
ClientDisconnected?.Invoke(Context.ConnectionId);
|
||||||
|
|
||||||
|
return base.OnDisconnected(stopCalled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
class CustomerPanelHub
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
22
C4IT.API/CustomerPanelSecurePassword.cs
Normal file
22
C4IT.API/CustomerPanelSecurePassword.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using C4IT.Security;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
static public class CustomerPanelSecurePassword
|
||||||
|
{
|
||||||
|
public readonly static string FFH = "RL5?IX%E1fE^37cUWDY~u+|NA";
|
||||||
|
public readonly static string FFK = "PyTLMoZo0Ece/tbEA+nmiUOcn14cjg1KPG9185EoHD5EVWUWPm2iUDwXX+8Vne4saDsihtj7CeKi0aeOFqKEL05lmrmEkVFrYOQ1yhVaLdNzz+yw2KGZ9cF9nS0g+le5PqKg67vfiueoQWwvUQYkbLjjARPm3eoaUcjqFTZqVZ7vcW4C6eushQZ4NrOAzd5WcVENU55l6ORnstRW+SoT+SV2t4MO3ObXWlOK495Gerf44juHDeVGfPL+MjnfcIyUvEVe0AcC+Uddvn7atlbcjBF2m317wVqsogKoAPDpaGHhWAW6D6j8ezP2DSRvDmYXm7EuRXqbb6XatwO1TC/JWnPBk2sHR3/suiURx0ui34oD5e+/QbqapG++caQhba4jf+ailaBrKCdauMPP+BJ6d1Zulu+6NXTWknpbQo9qgPQfWk6B9WQJfzyzUxQ8uey4TaRqS6TDgdqObSddXnzk5pjBhvwNSWOtfvaoX4m4h2iHCTWDp+O3g94MR/StOjIK/eX/D0bIbVxXQD3jgjqyiFoPYbZM6QrNT+CaXD3eEpiBKRojxe1jd5fUOj2gq64HYAvD1DQhvP/6MgR87BOeUGWwrXm8PIwyc4wMoj8RnEEnkH8+yjx9SvHfv7Gb2tW4JDKXOaCZF7+NOrDe3L9ECJh3XyyE6a6kI7eW+XEbjFh/8ugPgqbP2rGAFlKES5AzaPN3ePl2Dv/9s00gYyuGhnM02iWTkj7wOzOTpTaIrhS4uZdBxqlIxnbw/UCDkajitaqq8zeGXWNTAAEc8G4FELXruw0QbwIIuszOS770gAGsmSbpLeOtDyYNFWnnuYlZfhuCyofrk02mnB2e+nZ6p4O9G+MvZkgimeST23MnhLdLNFEIASlwFxDqD9X0GfKN0zD4S2LrwT0yp8mKfgJPyKxG9f3Dwr7yuWIIodplWcIQa/NYVEn/0lga43+F6fSv73uhAKBKqlaivMnZXRqzrX9YsRxgzMOuVJm9WXs0iWhV/Q183vrUVyQnx4H1cZq7p+RriIwEn6Y/01RgE5TzpLILDGdT56if4BGDVoKa4RcAFq4kamdAj8VnLtNTZSt+QA2IOrISFcoiFpn6Z5ZPpjp3ktP5EcqFi/jPNiLn1aQi4c4xhgsggd+S+bpEr2Q31p6WKDv40w2wXmClNz2Ck8BcYtN7z040WGqGtfu4gDPiYpQedytPwzc65ipxKJQ8/sv4At0kVd5U+u/Gsc2lYcDU5va/t338ioKOj1nfB9YmIUuxjvd5hzCmWjHizf/rjMV7SF7PbCsq3RZtPa2Hy4BcXkV5YaoZACN3wgOHadkiz1T3rAGC8KhoiJ94dlQvkwwtoNDblMrpnKoHedBDgsl1Gg09fAzlyXQ6ofNonzOsMERdSwNDyDuOQCoDK809bhxsyGeGvLsWDS7srI7ODedjevx6Obdvpgb95YXKPBIzSXgZRMKMNwTJNMUA4qWrNPZOiW0tkYRhZujN50oMHX2ZJfRKllknJk5SgiijKxlSPd4Abk62n9eGG42DXC1dAEpNoDkiP6lWbtaxVOVL6Kr+LsgD0G6N0Y21Q8YpEH1MTW+462AHaZkcnsVAEGWH";
|
||||||
|
public static cSecurePassword Instance { get; private set; } = null;
|
||||||
|
|
||||||
|
static public void Init()
|
||||||
|
{
|
||||||
|
Instance = new cSecurePassword(FFH);
|
||||||
|
Instance.SetRsaKey(FFK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
93
C4IT.API/DeepLinkBuilder.cs
Normal file
93
C4IT.API/DeepLinkBuilder.cs
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Web;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
public enum ViewType
|
||||||
|
{
|
||||||
|
New, // open create dialog
|
||||||
|
Preview, // open preview
|
||||||
|
Action, // run action/wizard
|
||||||
|
Edit // open edit dialog
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeepLinkBuilder
|
||||||
|
{
|
||||||
|
public string Host { get; set; }
|
||||||
|
public string AppName { get; set; }
|
||||||
|
|
||||||
|
// Parameter f<>r view-options
|
||||||
|
public bool? Embedded { get; set; }
|
||||||
|
public Guid? DialogId { get; set; }
|
||||||
|
public Guid? ObjectId { get; set; }
|
||||||
|
public int? Archived { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
|
public ViewType? ViewType { get; set; }
|
||||||
|
public Guid? ActionId { get; set; }
|
||||||
|
public Guid? ViewId { get; set; }
|
||||||
|
|
||||||
|
public object PresetParams { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Baut die URL basierend auf den gesetzten Eigenschaften.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Die erstellte DeepLink-URL als string.</returns>
|
||||||
|
public string BuildUrl()
|
||||||
|
{
|
||||||
|
var viewOptions = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
if (Embedded.HasValue)
|
||||||
|
viewOptions["embedded"] = Embedded.Value;
|
||||||
|
if (DialogId.HasValue)
|
||||||
|
viewOptions["dialogId"] = DialogId.Value;
|
||||||
|
if (ObjectId.HasValue)
|
||||||
|
viewOptions["objectId"] = ObjectId.Value;
|
||||||
|
if (Archived.HasValue)
|
||||||
|
viewOptions["archived"] = Archived.Value;
|
||||||
|
if (!string.IsNullOrEmpty(Type))
|
||||||
|
viewOptions["type"] = Type;
|
||||||
|
if (ViewType.HasValue)
|
||||||
|
viewOptions["viewType"] = ViewType.Value.ToString().ToLower();
|
||||||
|
if (ActionId.HasValue)
|
||||||
|
viewOptions["actionId"] = ActionId.Value;
|
||||||
|
if (ViewId.HasValue)
|
||||||
|
viewOptions["viewId"] = ViewId.Value;
|
||||||
|
|
||||||
|
string viewOptionsJson = JsonConvert.SerializeObject(viewOptions);
|
||||||
|
string encodedViewOptions = HttpUtility.UrlEncode(viewOptionsJson);
|
||||||
|
string url = $"{Host.TrimEnd('/')}/wm/app-{AppName}/?view-options={encodedViewOptions}";
|
||||||
|
|
||||||
|
if (PresetParams != null)
|
||||||
|
{
|
||||||
|
string presetParamsJson = JsonConvert.SerializeObject(PresetParams);
|
||||||
|
string encodedPresetParams = HttpUtility.UrlEncode(presetParamsJson);
|
||||||
|
url += $"&presetParams={encodedPresetParams}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Statische Methode zur Erstellung eines DeepLinks basierend auf den angegebenen Parametern.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="host">Der Hostname der Anwendung.</param>
|
||||||
|
/// <param name="appName">Der Name der Anwendung.</param>
|
||||||
|
/// <param name="viewType">Der Typ der Ansicht.</param>
|
||||||
|
/// <param name="type">Der Type des Objekts.</param>
|
||||||
|
/// <returns>Die erstellte DeepLink-URL als string.</returns>
|
||||||
|
public static string CreateDeepLink(string host, string appName, ViewType viewType, string type)
|
||||||
|
{
|
||||||
|
var builder = new DeepLinkBuilder
|
||||||
|
{
|
||||||
|
Host = host,
|
||||||
|
AppName = appName,
|
||||||
|
ViewType = viewType,
|
||||||
|
Type = type,
|
||||||
|
};
|
||||||
|
|
||||||
|
return builder.BuildUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
51
C4IT.API/PostBuildCopy.bat
Normal file
51
C4IT.API/PostBuildCopy.bat
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
@echo off
|
||||||
|
SETLOCAL
|
||||||
|
|
||||||
|
REM Überprüfe, ob die Konfiguration als Parameter übergeben wurde
|
||||||
|
IF "%1"=="" (
|
||||||
|
echo ERROR: Keine Konfiguration übergeben. Verwenden Sie z. B. "Debug" oder "Release".
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Setze die Quelldateien und das Zielverzeichnis
|
||||||
|
SET SourceDir=%~dp0bin\%1
|
||||||
|
SET TargetDir=\\srvwsm001.imagoverum.com\c$\Program Files (x86)\Matrix42\Matrix42 Workplace Management\svc\bin
|
||||||
|
|
||||||
|
REM Debugging-Ausgabe
|
||||||
|
echo Starting Post-Build Copy Script...
|
||||||
|
echo Source Directory: %SourceDir%
|
||||||
|
echo Target Directory: %TargetDir%
|
||||||
|
|
||||||
|
REM Prüfe, ob die Quelldateien existieren
|
||||||
|
IF NOT EXIST "%SourceDir%\C4IT.API.Contracts.dll" (
|
||||||
|
echo ERROR: C4IT.API.Contracts.dll nicht gefunden.
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
|
||||||
|
IF NOT EXIST "%SourceDir%\C4IT.API.CustomerPanel.dll" (
|
||||||
|
echo ERROR: C4IT.API.CustomerPanel.dll nicht gefunden.
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Kopiere die Dateien
|
||||||
|
echo Kopiere C4IT.API.Contracts.dll...
|
||||||
|
xcopy "%SourceDir%\C4IT.API.Contracts.dll" "%SourceDir%\..\..\..\..\Matrix42\C4IT_CustomerPanel\Matrix42Libs" /Y
|
||||||
|
IF ERRORLEVEL 1 (
|
||||||
|
echo ERROR: Kopiervorgang von C4IT.API.Contracts.dll fehlgeschlagen.
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
xcopy "%SourceDir%\C4IT.API.Contracts.dll" "%TargetDir%" /Y
|
||||||
|
IF ERRORLEVEL 1 (
|
||||||
|
echo ERROR: Kopiervorgang von C4IT.API.Contracts.dll fehlgeschlagen.
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Kopiere C4IT.API.CustomerPanel.dll...
|
||||||
|
xcopy "%SourceDir%\C4IT.API.CustomerPanel.dll" "%TargetDir%" /Y
|
||||||
|
IF ERRORLEVEL 1 (
|
||||||
|
echo ERROR: Kopiervorgang von C4IT.API.CustomerPanel.dll fehlgeschlagen.
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Dateien erfolgreich kopiert.
|
||||||
|
ENDLOCAL
|
||||||
22
C4IT.API/PrivateCustomerPanelSecurePassword.cs
Normal file
22
C4IT.API/PrivateCustomerPanelSecurePassword.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using C4IT.Security;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace C4IT.API
|
||||||
|
{
|
||||||
|
static public class PrivateCustomerPanelSecurePassword
|
||||||
|
{
|
||||||
|
public readonly static string FFH = "RL5?IX%E1fE^37cUWDY~u+|NA";
|
||||||
|
public readonly static string FFK = "PyTLMoZo0Ece/tbEA+nmiUOcn14cjg1KPG9185EoHD5EVWUWPm2iUDwXX+8Vne4saDsihtj7CeKi0aeOFqKEL05lmrmEkVFrYOQ1yhVaLdNzz+yw2KGZ9cF9nS0g+le5PqKg67vfiueoQWwvUQYkbLjjARPm3eoaUcjqFTZqVZ7vcW4C6eushQZ4NrOAzd5WcVENU55l6ORnstRW+SoT+SV2t4MO3ObXWlOK495Gerf44juHDeVGfPL+MjnfcIyUvEVe0AcC+Uddvn7atlbcjBF2m317wVqsogKoAPDpaGHhWAW6D6j8ezP2DSRvDmYXm7EuRXqbb6XatwO1TC/JWnPBk2sHR3/suiURx0ui34oD5e+/QbqapG++caQhba4jf+ailaBrKCdauMPP+BJ6d1Zulu+6NXTWknpbQo9qgPQfWk6B9WQJfzyzUxQ8uey4TaRqS6TDgdqObSddXnzk5pjBhvwNSWOtfvaoX4m4h2iHCTWDp+O3g94MR/StOjIK/eX/D0bIbVxXQD3jgjqyiFoPYbZM6QrNT+CaXD3eEpiBKRojxe1jd5fUOj2gq64HYAvD1DQhvP/6MgR87BOeUGWwrXm8PIwyc4wMoj8RnEEnkH8+yjx9SvHfv7Gb2tW4JDKXOaCZF7+NOrDe3L9ECJh3XyyE6a6kI7eW+XEbjFh/8ugPgqbP2rGAFlKES5AzaPN3ePl2Dv/9s00gYyuGhnM02iWTkj7wOzOTpTaIrhS4uZdBxqlIxnbw/UCDkajitaqq8zeGXWNTAAEc8G4FELXruw0QbwIIuszOS770gAGsmSbpLeOtDyYNFWnnuYlZfhuCyofrk02mnB2e+nZ6p4O9G+MvZkgimeST23MnhLdLNFEIASlwFxDqD9X0GfKN0zD4S2LrwT0yp8mKfgJPyKxG9f3Dwr7yuWIIodplWcIQa/NYVEn/0lga43+F6fSv73uhAKBKqlaivMnZXRqzrX9YsRxgzMOuVJm9WXs0iWhV/Q183vrUVyQnx4H1cZq7p+RriIwEn6Y/01RgE5TzpLILDGdT56if4BGDVoKa4RcAFq4kamdAj8VnLtNTZSt+QA2IOrISFcoiFpn6Z5ZPpjp3ktP5EcqFi/jPNiLn1aQi4c4xhgsggd+S+bpEr2Q31p6WKDv40w2wXmClNz2Ck8BcYtN7z040WGqGtfu4gDPiYpQedytPwzc65ipxKJQ8/sv4At0kVd5U+u/Gsc2lYcDU5va/t338ioKOj1nfB9YmIUuxjvd5hzCmWjHizf/rjMV7SF7PbCsq3RZtPa2Hy4BcXkV5YaoZACN3wgOHadkiz1T3rAGC8KhoiJ94dlQvkwwtoNDblMrpnKoHedBDgsl1Gg09fAzlyXQ6ofNonzOsMERdSwNDyDuOQCoDK809bhxsyGeGvLsWDS7srI7ODedjevx6Obdvpgb95YXKPBIzSXgZRMKMNwTJNMUA4qWrNPZOiW0tkYRhZujN50oMHX2ZJfRKllknJk5SgiijKxlSPd4Abk62n9eGG42DXC1dAEpNoDkiP6lWbtaxVOVL6Kr+LsgD0G6N0Y21Q8YpEH1MTW+462AHaZkcnsVAEGWH";
|
||||||
|
public static cSecurePassword Instance { get; private set; } = null;
|
||||||
|
|
||||||
|
static public void Init()
|
||||||
|
{
|
||||||
|
Instance = new cSecurePassword(FFH);
|
||||||
|
Instance.SetRsaKey(FFK, "C4itF4sdCustomerPanelWebApi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
C4IT.API/Properties/AssemblyInfo.cs
Normal file
8
C4IT.API/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("C4IT.API")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: Guid("c965495d-d326-4521-9b6a-668227ed0651")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
11
C4IT.API/SignFiles.cmd
Normal file
11
C4IT.API/SignFiles.cmd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
set ProductName="C4IT Customer Panel API"
|
||||||
|
|
||||||
|
set SignTool=..\..\Common Code\Tools\signtool.exe
|
||||||
|
set TimeStamp=http://rfc3161timestamp.globalsign.com/advanced
|
||||||
|
|
||||||
|
set Src=.\bin\Release
|
||||||
|
"%SignTool%" sign /a /tr %TimeStamp% /td SHA256 /fd SHA256 /d %ProductName% "%Src%\C4IT.API.Contracts.dll" "%Src%\C4IT.API.CustomerPanel.dll" "%Src%\C4IT.API.Contracts.dll"
|
||||||
|
|
||||||
|
pause
|
||||||
|
|
||||||
|
|
||||||
27
C4IT.API/app.config
Normal file
27
C4IT.API/app.config
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
||||||
20
C4IT.API/packages.config
Normal file
20
C4IT.API/packages.config
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.Caching.Abstractions" version="8.0.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.1" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.1" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.Options" version="8.0.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.Primitives" version="8.0.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Owin" version="4.2.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Owin.Host.SystemWeb" version="4.2.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Owin.Security" version="4.2.2" targetFramework="net472" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
|
<package id="Owin" version="1.0" targetFramework="net472" />
|
||||||
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
15
CommonAssembyInfo.cs
Normal file
15
CommonAssembyInfo.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyProduct("C4IT Customer Panel API")]
|
||||||
|
|
||||||
|
[assembly: AssemblyCompany("Consulting4IT GmbH, Germany")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2025, Consulting4IT GmbH, Germany")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: AssemblyInformationalVersion("1.2.*.*")]
|
||||||
|
[assembly: AssemblyVersion("1.2.0.0")]
|
||||||
BIN
SB_DLLs/Matrix42.Common.dll
Normal file
BIN
SB_DLLs/Matrix42.Common.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/Matrix42.Contracts.Common.dll
Normal file
BIN
SB_DLLs/Matrix42.Contracts.Common.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/Matrix42.DataLayer.Common.dll
Normal file
BIN
SB_DLLs/Matrix42.DataLayer.Common.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/Matrix42.Pandora.Contracts.dll
Normal file
BIN
SB_DLLs/Matrix42.Pandora.Contracts.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/System.Web.Http.dll
Normal file
BIN
SB_DLLs/System.Web.Http.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/update4u.SPS.Config.dll
Normal file
BIN
SB_DLLs/update4u.SPS.Config.dll
Normal file
Binary file not shown.
BIN
SB_DLLs/update4u.SPS.DataLayer.dll
Normal file
BIN
SB_DLLs/update4u.SPS.DataLayer.dll
Normal file
Binary file not shown.
Reference in New Issue
Block a user