add ping to client to test connection

This commit is contained in:
Ivan Hörler 2018-07-14 10:54:53 +02:00
parent 48036aa105
commit 7ebabf41b2
6 changed files with 109 additions and 19 deletions

View File

@ -787,6 +787,9 @@ namespace Client.EHEC_Service {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/GetResults", ReplyAction="http://tempuri.org/IService/GetResultsResponse")]
Client.EHEC_Service.Result[] GetResults();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Ping", ReplyAction="http://tempuri.org/IService/PingResponse")]
string Ping();
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@ -843,5 +846,9 @@ namespace Client.EHEC_Service {
public Client.EHEC_Service.Result[] GetResults() {
return base.Channel.GetResults();
}
public string Ping() {
return base.Channel.Ping();
}
}
}

View File

@ -49,6 +49,12 @@
<wsdl:message name="IService_GetResults_OutputMessage">
<wsdl:part name="parameters" element="tns:GetResultsResponse" />
</wsdl:message>
<wsdl:message name="IService_Ping_InputMessage">
<wsdl:part name="parameters" element="tns:Ping" />
</wsdl:message>
<wsdl:message name="IService_Ping_OutputMessage">
<wsdl:part name="parameters" element="tns:PingResponse" />
</wsdl:message>
<wsdl:portType name="IService">
<wsdl:operation name="WriteDoctor">
<wsdl:input wsaw:Action="http://tempuri.org/IService/WriteDoctor" message="tns:IService_WriteDoctor_InputMessage" />
@ -78,6 +84,10 @@
<wsdl:input wsaw:Action="http://tempuri.org/IService/GetResults" message="tns:IService_GetResults_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IService/GetResultsResponse" message="tns:IService_GetResults_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="Ping">
<wsdl:input wsaw:Action="http://tempuri.org/IService/Ping" message="tns:IService_Ping_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IService/PingResponse" message="tns:IService_Ping_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IService" type="tns:IService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
@ -144,6 +154,15 @@
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Ping">
<soap:operation soapAction="http://tempuri.org/IService/Ping" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service">
<wsdl:port name="BasicHttpBinding_IService" binding="tns:BasicHttpBinding_IService">

View File

@ -97,4 +97,16 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Ping">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
<xs:element name="PingResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="PingResult" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -4,17 +4,20 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Client.EHEC_Service;
using System.Windows;
namespace Client
{
/// <summary>
/// This is a Singleton implementation for the need of one single client connection
/// </summary>
/// <summary>
/// This is a Singleton implementation for the need of one single client connection
/// </summary>
public class Global
{
private Global()
{ }
{
}
private static Global globalInstance = null;
private static ServiceClient service = null;
@ -39,5 +42,6 @@ namespace Client
return service;
}
}
}
}

View File

@ -26,8 +26,8 @@
<RowDefinition Height="32*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="55*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="54*"/>
<ColumnDefinition Width="26*"/>
<ColumnDefinition Width="76*"/>
<ColumnDefinition Width="105*"/>
<ColumnDefinition Width="134*"/>
@ -38,8 +38,8 @@
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Label x:Name="LabelTitel" Content="EHEC Meldeform:" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="1,1,1,0.4" VerticalContentAlignment="Center" FontSize="20" />
<Label x:Name="LabelArzt" Content="Arzt:" Margin="1" Grid.Row="2" VerticalContentAlignment="Center"/>
<Label x:Name="LabelPatient" Content="Patient:" Margin="1" RenderTransformOrigin="0.582,0.288" Grid.Row="8" VerticalContentAlignment="Center" Width="50"/>
<Label x:Name="LabelArzt" Content="Arzt:" Margin="1,0.6,1.6,1.4" Grid.Row="2" VerticalContentAlignment="Center"/>
<Label x:Name="LabelPatient" Content="Patient:" Margin="3,0.6,2.6,1.4" RenderTransformOrigin="0.582,0.288" Grid.Row="8" VerticalContentAlignment="Center"/>
<Label x:Name="LabelAnalyseergebnisse" Content="Analyseergebnisse:" Margin="1,1.6,0.6,0.4" Grid.Column="4" Grid.Row="2" VerticalContentAlignment="Center"/>
<Label x:Name="LabelNahrungseinnahmen" Content="Nahrungseinnahmen:" Margin="1,1.6,0.6,0.4" Grid.Column="4" Grid.Row="3" VerticalContentAlignment="Center"/>
<Button x:Name="ButtonClose" Content="X" Margin="1.2,1,0.6,0.8" Click="ButtonClose_Click" Background="White" RenderTransformOrigin="0.573,1.105" Grid.Column="9"/>
@ -48,14 +48,15 @@
<Button x:Name="ButtonSend" Content="Senden" Margin="1.2,1,0.8,1" Click="ButtonSend_Click" Background="White" Grid.Column="8" Grid.Row="14" VerticalContentAlignment="Center"/>
<Label x:Name="LabelRueckmeldung" Content="Rückmeldung:" Margin="1,1.2,0.6,2" Grid.Column="4" Grid.Row="13" VerticalContentAlignment="Center"/>
<Label x:Name="LabelRueckmeldungsfeld" Content="" Margin="1.4,1.2,9.6,2" Grid.ColumnSpan="5" Grid.Column="5" Grid.Row="13" VerticalContentAlignment="Center"/>
<Label x:Name="LabelRueckmeldungsOnline" Content="" Margin="1.2,1,0.8,0.8" Grid.ColumnSpan="1" Grid.Column="8" Grid.Row="0" VerticalContentAlignment="Center"/>
<ComboBox Grid.Column="5" HorizontalAlignment="Left" Grid.Row="12" VerticalAlignment="Top" Width="148" Height="22" Margin="0.4,0.2,0,0" Grid.ColumnSpan="2"/>
<Label x:Name="LabelPatientId" Content="" Margin="0" Grid.Row="8" VerticalContentAlignment="Center" Grid.Column="1" FontSize="6"/>
<Label x:Name="LabelArztId" Content="" Margin="0" Grid.Row="2" VerticalContentAlignment="Center" Grid.Column="1" FontSize="6"/>
<Label x:Name="LabelBakterienstamm" Content="" Margin="0.8,0.6,58.8,1.4" Grid.Row="2" VerticalContentAlignment="Center" Grid.Column="7" FontSize="6"/>
<Label x:Name="LabelNahrung1Id" Content="" Margin="1" Grid.Row="3" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6"/>
<Label x:Name="LabelNahrung2Id" Content="" Margin="1" Grid.Row="5" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6"/>
<Label x:Name="LabelNahrung3Id" Content="" Margin="1" Grid.Row="7" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6"/>
<Label x:Name="LabelNahrung4Id" Content="" Margin="1" Grid.Row="9" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6"/>
<Label x:Name="LabelPatientId" Content="" Margin="1" Grid.Row="8" VerticalContentAlignment="Center" Grid.Column="1" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelArztId" Content="" Margin="1" Grid.Row="2" VerticalContentAlignment="Center" Grid.Column="1" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelBakterienstamm" Content="" Margin="0.8,0.6,58.8,1.4" Grid.Row="2" VerticalContentAlignment="Center" Grid.Column="7" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelNahrung1Id" Content="" Margin="1.2,0.6,0.6,1.4" Grid.Row="3" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelNahrung2Id" Content="" Margin="1.2,0.6,0.6,1.4" Grid.Row="5" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelNahrung3Id" Content="" Margin="1.2,0.6,0.6,1.4" Grid.Row="7" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6" Foreground="Gray"/>
<Label x:Name="LabelNahrung4Id" Content="" Margin="1.2,0.6,0.6,0.6" Grid.Row="9" VerticalContentAlignment="Center" Grid.Column="9" FontSize="6" Foreground="Gray"/>
<xctk:WatermarkTextBox x:Name="TextboxArztName" Margin="0.8,1.6,1,0.4" Padding="3,1" Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="2" VerticalContentAlignment="Center">
<xctk:WatermarkTextBox.Watermark>
<StackPanel Orientation="Horizontal">

View File

@ -16,6 +16,7 @@ using Xceed.Wpf.Toolkit;
using Client.EHEC_Service;
using AutoMapper;
namespace Client
{
/// <summary>
@ -29,8 +30,19 @@ namespace Client
// Start Automapper
Mapper.Initialize(cfg => cfg.AddProfile<AutomapperProfile>());
// loading of dropdowns
try
{
string con = Global.GlobalInstance.Service.Ping();
if (con == "pong") { LabelRueckmeldungsOnline.Content = "online"; }
}
catch (Exception)
{
LabelRueckmeldungsOnline.Content = "offline";
LabelRueckmeldungsOnline.Foreground = Brushes.Red;
}
}
}
private void ButtonClose_Click(object sender, RoutedEventArgs e)
{
@ -38,6 +50,7 @@ namespace Client
}
private void ButtonSend_Click(object sender, RoutedEventArgs e)
{
LabelRueckmeldungsfeld.Content = "Sende Daten. ";
Doctor newDoctor = new Doctor(TextboxArztVorname.Text,
@ -146,15 +159,43 @@ namespace Client
newOrigin_Exam3.CreateOrigin_Exam();
newOrigin_Exam4.CreateOrigin_Exam();
LabelRueckmeldungsfeld.Content = "Fertig. Behandlung Nr." + Convert.ToString(newExam.Id) + " gespeichert.";
CleanExam();
}
private void ButtonAutogenerateMany_Click(object sender, RoutedEventArgs e)
private void CleanExam()
{
TextboxPatientName.Clear();
TextboxPatientVorname.Clear();
TextboxPatientStrasseNr.Clear();
TextboxPatientPlz.Clear();
TextboxPatientOrt.Clear();
TextboxPatientRegion.Clear();
TextboxPatientGeburtstag.Clear();
TextboxBakterienstamm.Clear();
TextboxNahrung1Restaurant.Clear();
TextboxNahrung1Essen.Clear();
TextboxNahrung1Strasse.Clear();
TextboxNahrung1Plz.Clear();
TextboxNahrung1Ort.Clear();
TextboxNahrung2Restaurant.Clear();
TextboxNahrung2Essen.Clear();
TextboxNahrung2Strasse.Clear();
TextboxNahrung2Plz.Clear();
TextboxNahrung2Ort.Clear();
TextboxNahrung3Restaurant.Clear();
TextboxNahrung3Essen.Clear();
TextboxNahrung3Strasse.Clear();
TextboxNahrung3Plz.Clear();
TextboxNahrung3Ort.Clear();
TextboxNahrung4Restaurant.Clear();
TextboxNahrung4Essen.Clear();
TextboxNahrung4Strasse.Clear();
TextboxNahrung4Plz.Clear();
TextboxNahrung4Ort.Clear();
}
private void ButtonAutogenerateOne_Click(object sender, RoutedEventArgs e)
{
TextboxArztName.Text = "doctorLastname";
TextboxArztVorname.Text = "doctorFirstname";
TextboxArztStrasseNr.Text = "doctorStreet";
@ -191,6 +232,12 @@ namespace Client
TextboxNahrung4Plz.Text = "4444";
TextboxNahrung4Ort.Text = "fourthRestaurantCity";
}
private void ButtonAutogenerateMany_Click(object sender, RoutedEventArgs e)
{
}
}