excel Tool 3.2.14
neue Locode DB
This commit is contained in:
parent
2a54e905e6
commit
3cbc32d6da
Binary file not shown.
@ -12,18 +12,50 @@ namespace SafeSeaNetTest
|
|||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
private static string veryBasicUri = "https://nswtestapi.safeseanet.dk/";
|
||||||
private static string baseUri = "https://nswtestapi.safeseanet.dk/api/v1/";
|
private static string baseUri = "https://nswtestapi.safeseanet.dk/api/v1/";
|
||||||
private static string searchUri = "search?query=contentType: ship&take=5";
|
private static string searchUri = "search?query=contentType: ship&take=5";
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Login();
|
Login3();
|
||||||
|
|
||||||
|
|
||||||
Console.Read();
|
Console.Read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static async void Login3()
|
||||||
|
{
|
||||||
|
|
||||||
|
var credential = new NetworkCredential("bsm-schick", "R1g048r20l", "SSNTEST");
|
||||||
|
var myCache = new CredentialCache();
|
||||||
|
|
||||||
|
Uri uri = new Uri(Path.Combine(baseUri, searchUri));
|
||||||
|
Uri authUri = new Uri(uri.GetLeftPart(UriPartial.Authority));
|
||||||
|
|
||||||
|
// welche Uri wird hier tatsächlich hinzugefügt? nur die Base oder ganz speziell?
|
||||||
|
myCache.Add(authUri, "ntlm", credential);
|
||||||
|
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.AllowAutoRedirect = true;
|
||||||
|
handler.Credentials = myCache;
|
||||||
|
|
||||||
|
// Create an HttpClient with the handler object
|
||||||
|
HttpClient httpClient = new HttpClient(handler);
|
||||||
|
|
||||||
|
// Wait to get the reponse, and you can use the reponse in your code
|
||||||
|
HttpResponseMessage responseMessage = await httpClient.GetAsync(uri);
|
||||||
|
|
||||||
|
|
||||||
|
string jsonMessage;
|
||||||
|
using (Stream responseStream = await responseMessage.Content.ReadAsStreamAsync())
|
||||||
|
{
|
||||||
|
jsonMessage = new StreamReader(responseStream).ReadToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static async void Login()
|
private static async void Login()
|
||||||
{
|
{
|
||||||
NetworkCredential credential = new NetworkCredential("bsm-schick", "R1g048r20l");
|
NetworkCredential credential = new NetworkCredential("bsm-schick", "R1g048r20l");
|
||||||
|
|||||||
@ -4,8 +4,7 @@ G
|
|||||||
Anmeldung: bsm-schick
|
Anmeldung: bsm-schick
|
||||||
PW: Melder2016
|
PW: Melder2016
|
||||||
Januar-2016
|
Januar-2016
|
||||||
|
--> R1g048r20l
|
||||||
(funktioniert aktuell beides nicht)
|
|
||||||
|
|
||||||
https://nswtest.safeseanet.dk/api/v1/search?query=contentType: ship&take=5
|
https://nswtest.safeseanet.dk/api/v1/search?query=contentType: ship&take=5
|
||||||
|
|
||||||
|
|||||||
@ -314,6 +314,12 @@ namespace bsmd.ExcelReadService
|
|||||||
stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber");
|
stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber");
|
||||||
stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");
|
stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");
|
||||||
|
|
||||||
|
if(!stat.ISMCompanyId.IsNullOrEmpty() && stat.ISMCompanyId.Length < 7)
|
||||||
|
{
|
||||||
|
while (stat.ISMCompanyId.Length < 7)
|
||||||
|
stat.ISMCompanyId = "0" + stat.ISMCompanyId;
|
||||||
|
}
|
||||||
|
|
||||||
if (!stat.Flag.IsNullOrEmpty() && stat.Flag.Length > 2)
|
if (!stat.Flag.IsNullOrEmpty() && stat.Flag.Length > 2)
|
||||||
stat.Flag = LocodeDB.CountryCodeFromName(stat.Flag);
|
stat.Flag = LocodeDB.CountryCodeFromName(stat.Flag);
|
||||||
|
|
||||||
@ -430,6 +436,9 @@ namespace bsmd.ExcelReadService
|
|||||||
}
|
}
|
||||||
AGNT agnt = agntMessage.Elements[0] as AGNT;
|
AGNT agnt = agntMessage.Elements[0] as AGNT;
|
||||||
Util.ScanMessage(agnt, reader);
|
Util.ScanMessage(agnt, reader);
|
||||||
|
|
||||||
|
if (agnt.AgentLastName.IsNullOrEmpty()) agnt.AgentLastName = "-";
|
||||||
|
|
||||||
// wird nicht mehr entfernt, egal welche Felder gelesen werden
|
// wird nicht mehr entfernt, egal welche Felder gelesen werden
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,6 +536,39 @@ namespace bsmd.ExcelReadService
|
|||||||
mdh.MDHSimplification = false;
|
mdh.MDHSimplification = false;
|
||||||
mdh.PortOfCallWhereCompleteMDHNotified = "";
|
mdh.PortOfCallWhereCompleteMDHNotified = "";
|
||||||
|
|
||||||
|
|
||||||
|
string kuerzelErsteZelle = reader.ReadText("MDH.PortOfCallLast30DaysLocode_1");
|
||||||
|
|
||||||
|
|
||||||
|
// lt. Mail von Christin am 11.10.2016
|
||||||
|
// "SEC" Mode, die Werte aus last10PortFacilitesCalled (SEC) werden übernommen
|
||||||
|
// das funktioniert, da SEC vor MDH gelesen wird
|
||||||
|
if (!kuerzelErsteZelle.IsNullOrEmpty() && kuerzelErsteZelle.Equals("sec", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
Message secMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.SEC);
|
||||||
|
if (secMessage.Elements.Count == 0) return;
|
||||||
|
SEC sec = secMessage.Elements[0] as SEC;
|
||||||
|
int i = 1;
|
||||||
|
foreach (LastTenPortFacilitiesCalled ltpfc in sec.LastTenPortFacilitesCalled)
|
||||||
|
{
|
||||||
|
PortOfCallLast30Days poc30d = mdh.GetSublistElementWithIdentifier((i + 1).ToString()) as PortOfCallLast30Days;
|
||||||
|
if (poc30d == null)
|
||||||
|
{
|
||||||
|
poc30d = new PortOfCallLast30Days();
|
||||||
|
poc30d.Identifier = (i + 1).ToString();
|
||||||
|
poc30d.MDH = mdh;
|
||||||
|
mdh.PortOfCallLast30Days.Add(poc30d);
|
||||||
|
}
|
||||||
|
|
||||||
|
poc30d.PortOfCallLast30DaysCrewMembersJoined = false;
|
||||||
|
poc30d.PortOfCallLast30DaysLocode = ltpfc.PortFacilityPortLoCode;
|
||||||
|
poc30d.PortOfCallLast30DaysDateOfDeparture = ltpfc.PortFacilityDateOfDeparture;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // "normal mode", aus den Zellen lesen
|
||||||
|
{
|
||||||
|
|
||||||
// POC last 30 days
|
// POC last 30 days
|
||||||
for (int i = 0; i < mdh.NumberOfExcelRows; i++)
|
for (int i = 0; i < mdh.NumberOfExcelRows; i++)
|
||||||
{
|
{
|
||||||
@ -580,6 +622,7 @@ namespace bsmd.ExcelReadService
|
|||||||
if (!poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && (poc30d.PortOfCallLast30DaysLocode == null))
|
if (!poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && (poc30d.PortOfCallLast30DaysLocode == null))
|
||||||
mdh.PortOfCallLast30Days.Remove(poc30d);
|
mdh.PortOfCallLast30Days.Remove(poc30d);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// wird nicht wieder entfernt falls keine Daten vorliegen
|
// wird nicht wieder entfernt falls keine Daten vorliegen
|
||||||
}
|
}
|
||||||
@ -639,10 +682,6 @@ namespace bsmd.ExcelReadService
|
|||||||
string portDateOfDeparture = string.Format("SEC.PortFacilityDateOfDeparture_{0}", i);
|
string portDateOfDeparture = string.Format("SEC.PortFacilityDateOfDeparture_{0}", i);
|
||||||
string portShipSecLevel = string.Format("SEC.PortFacilityShipSecurityLevel_{0}", i);
|
string portShipSecLevel = string.Format("SEC.PortFacilityShipSecurityLevel_{0}", i);
|
||||||
string portGISISCode = string.Format("SEC.PortFacilityGISISCode_{0}", i);
|
string portGISISCode = string.Format("SEC.PortFacilityGISISCode_{0}", i);
|
||||||
if((portGISISCode != null) && (portGISISCode.Length < 4))
|
|
||||||
{
|
|
||||||
while (portGISISCode.Length < 4) portGISISCode = "0" + portGISISCode;
|
|
||||||
}
|
|
||||||
string portSecMatters = string.Format("SEC.PortFacilitySecurityMattersToReport_{0}", i);
|
string portSecMatters = string.Format("SEC.PortFacilitySecurityMattersToReport_{0}", i);
|
||||||
|
|
||||||
LastTenPortFacilitiesCalled l10fc = sec.GetPortFacilityWithIdentifier(i.ToString()) as LastTenPortFacilitiesCalled;
|
LastTenPortFacilitiesCalled l10fc = sec.GetPortFacilityWithIdentifier(i.ToString()) as LastTenPortFacilitiesCalled;
|
||||||
@ -661,6 +700,13 @@ namespace bsmd.ExcelReadService
|
|||||||
l10fc.PortFacilityDateOfDeparture = reader.ReadDate(portDateOfDeparture);
|
l10fc.PortFacilityDateOfDeparture = reader.ReadDate(portDateOfDeparture);
|
||||||
l10fc.PortFacilityShipSecurityLevel = (byte) reader.ReadNumber(portShipSecLevel);
|
l10fc.PortFacilityShipSecurityLevel = (byte) reader.ReadNumber(portShipSecLevel);
|
||||||
l10fc.PortFacilityGISISCode = reader.ReadTextNoWhitespace(portGISISCode);
|
l10fc.PortFacilityGISISCode = reader.ReadTextNoWhitespace(portGISISCode);
|
||||||
|
if (l10fc.PortFacilityGISISCode.IsNullOrEmpty() || l10fc.PortFacilityGISISCode == "0")
|
||||||
|
l10fc.PortFacilityGISISCode = "0000";
|
||||||
|
if((l10fc.PortFacilityGISISCode != null) && (l10fc.PortFacilityGISISCode.Length < 4))
|
||||||
|
{
|
||||||
|
while (l10fc.PortFacilityGISISCode.Length < 4) l10fc.PortFacilityGISISCode = "0" + l10fc.PortFacilityGISISCode;
|
||||||
|
}
|
||||||
|
|
||||||
l10fc.PortFacilitySecurityMattersToReport = reader.ReadText(portSecMatters);
|
l10fc.PortFacilitySecurityMattersToReport = reader.ReadText(portSecMatters);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,8 +48,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.101.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite, Version=1.0.103.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Data.SQLite.Core.1.0.101.0\lib\net45\System.Data.SQLite.dll</HintPath>
|
<HintPath>..\packages\System.Data.SQLite.Core.1.0.103\lib\net45\System.Data.SQLite.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@ -128,12 +128,12 @@
|
|||||||
<WCFMetadata Include="Service References\" />
|
<WCFMetadata Include="Service References\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets')" />
|
<Import Project="..\packages\System.Data.SQLite.Core.1.0.103\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.103\build\net45\System.Data.SQLite.Core.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets'))" />
|
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.103\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.103\build\net45\System.Data.SQLite.Core.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.5" targetFramework="net45" />
|
<package id="log4net" version="2.0.5" targetFramework="net45" />
|
||||||
<package id="OpenPop.NET" version="2.0.6.1120" targetFramework="net45" />
|
<package id="OpenPop.NET" version="2.0.6.1120" targetFramework="net45" />
|
||||||
<package id="System.Data.SQLite.Core" version="1.0.101.0" targetFramework="net45" />
|
<package id="System.Data.SQLite.Core" version="1.0.103" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -136,7 +136,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
[LookupName("SanitaryControlReinspectionRequired")]
|
[LookupName("MDH.SanitaryControlReinspectionRequired")]
|
||||||
public bool? SanitaryControlReinspectionRequired { get; set; }
|
public bool? SanitaryControlReinspectionRequired { get; set; }
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
||||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||||
[assembly: AssemblyInformationalVersion("3.2.10")]
|
[assembly: AssemblyInformationalVersion("3.2.14")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2016 Informatikbüro Daniel Schick. All rights reserved.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.10.*")]
|
[assembly: AssemblyVersion("3.2.14.*")]
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user