Merge branch 'master' into server
This commit is contained in:
commit
3d39a05139
|
@ -18,16 +18,20 @@
|
|||
<ColumnDefinition Width="455*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Add new exam" HorizontalAlignment="Left" VerticalAlignment="Top" Height="45" Width="433" FontFamily="Tahoma" FontSize="24" Margin="0.4,-3,0,0" Grid.Column="1" Grid.RowSpan="2"/>
|
||||
<Label Content="Date" Margin="0,115.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Description" Margin="0,163.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="44" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Date of 
consultation" Margin="0,115.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="77" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Description" Margin="0,391.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="44" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Patient" Margin="0,23.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontSize="24" FontFamily="Tahoma" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtDescription" HorizontalAlignment="Left" Height="34" Margin="137,163.4,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtDescription" HorizontalAlignment="Left" Height="69" Margin="137,391.4,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" Grid.ColumnSpan="2"/>
|
||||
<ComboBox x:Name="ComboBoxPatients" HorizontalAlignment="Left" Margin="0.4,23.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Height="34" Grid.Column="1"/>
|
||||
<ComboBox x:Name="ComboBoxStrains" HorizontalAlignment="Left" Margin="0.4,212.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Grid.Column="1" Height="34"/>
|
||||
<Label Content="Strain" Margin="0,212.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="41" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<ComboBox x:Name="ComboBoxStrains" HorizontalAlignment="Left" Margin="137,206.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Height="34" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Strain" Margin="0,199.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="41" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Doctor" Margin="0,68.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontSize="24" FontFamily="Tahoma" Grid.ColumnSpan="2"/>
|
||||
<ComboBox x:Name="ComboBoxDoctors" HorizontalAlignment="Left" Margin="0.4,68.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Height="34" Grid.Column="1"/>
|
||||
<DatePicker x:Name="dateboxExamDate" HorizontalAlignment="Left" Margin="137,115.4,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="433" Height="34"/>
|
||||
<Button x:Name="btnAddExam" Content="ADD EXAM" HorizontalAlignment="Left" Margin="136,371.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Click="btnAddFoodPlace_Click" Grid.ColumnSpan="2" Height="44" FontSize="20"/>
|
||||
<DatePicker x:Name="dateboxExamDate" HorizontalAlignment="Left" Margin="137,115.4,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="433" Height="77"/>
|
||||
<Button x:Name="btnAddExam" Content="ADD EXAM" HorizontalAlignment="Left" Margin="137,479.4,0,-0.2" Grid.Row="1" VerticalAlignment="Top" Width="433" Click="btnAddFoodPlace_Click" Grid.ColumnSpan="2" Height="44" FontSize="20"/>
|
||||
<Label Content="Foodplace" Margin="0,251.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="44" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Date at
foodplace" Margin="0,300.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="77" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<DatePicker x:Name="dateboxFoodplaceDate" HorizontalAlignment="Left" Margin="137,300.4,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="433" Height="77"/>
|
||||
<ComboBox x:Name="ComboBoxFoodPlace" HorizontalAlignment="Left" Margin="137,256.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Height="34" Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -27,27 +27,34 @@ namespace WpfWebClient
|
|||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
|
||||
//Retrieve all doctors and save them into "doctorlist"
|
||||
// Retrieve all doctors and save them into "doctorlist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Doctor> doctorlist = new List<ServiceReferenceEHEC.Doctor>(client.GetDoctors());
|
||||
|
||||
//Display all doctors with name in Combobox
|
||||
// Display all doctors with name in Combobox
|
||||
ComboBoxDoctors.ItemsSource = doctorlist;
|
||||
ComboBoxDoctors.DisplayMemberPath = "FirstName";
|
||||
|
||||
//Retrieve all patients and save them into "patientlist"
|
||||
// Retrieve all patients and save them into "patientlist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Person> patientlist = new List<ServiceReferenceEHEC.Person>(client.GetPersons());
|
||||
|
||||
//Display all patients with name in Combobox
|
||||
// Display all patients with name in Combobox
|
||||
ComboBoxPatients.ItemsSource = patientlist;
|
||||
ComboBoxPatients.DisplayMemberPath = "FirstName";
|
||||
|
||||
//Retrieve all strains and save them into "strainlist"
|
||||
// Retrieve all strains and save them into "strainlist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Strain> strainlist = new List<ServiceReferenceEHEC.Strain>(client.GetStrains());
|
||||
|
||||
//Display all strains with name in Combobox
|
||||
// Display all strains with name in Combobox
|
||||
ComboBoxStrains.ItemsSource = strainlist;
|
||||
ComboBoxStrains.DisplayMemberPath = "Name";
|
||||
|
||||
// Retrieve all foodplaces and save them into "fplist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.FoodPlace> fplist = new List<ServiceReferenceEHEC.FoodPlace>(client.GetFoodPlaces());
|
||||
|
||||
// Display all foodplaces with name in Combobox
|
||||
ComboBoxFoodPlace.ItemsSource = fplist;
|
||||
ComboBoxFoodPlace.DisplayMemberPath = "Name";
|
||||
|
||||
client.Close();
|
||||
}
|
||||
|
||||
|
@ -60,11 +67,25 @@ namespace WpfWebClient
|
|||
exam.Date = dateboxExamDate.SelectedDate.Value;
|
||||
exam.Doctor = (Doctor)ComboBoxDoctors.SelectedValue;
|
||||
exam.Patient = (Person)ComboBoxPatients.SelectedValue;
|
||||
exam.Description = txtDescription.ToString();
|
||||
exam.Description = txtDescription.Text;
|
||||
exam.Strain = (Strain)ComboBoxStrains.SelectedValue;
|
||||
|
||||
client.WriteExam(exam);
|
||||
|
||||
PatientAtFoodPlace patf = new PatientAtFoodPlace();
|
||||
|
||||
|
||||
patf.FoodPlace = (FoodPlace)ComboBoxFoodPlace.SelectedValue;
|
||||
patf.Patient = (Person)ComboBoxPatients.SelectedValue;
|
||||
patf.PatientID = ComboBoxPatients.SelectedIndex;
|
||||
patf.VistingDate = dateboxFoodplaceDate.SelectedDate.Value;
|
||||
|
||||
|
||||
client.WriteRelation(patf);
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,14 +18,16 @@
|
|||
<ColumnDefinition Width="455*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Add new foodplace" HorizontalAlignment="Left" VerticalAlignment="Top" Height="45" Width="433" FontFamily="Tahoma" FontSize="24" Margin="0.4,-3,0,0" Grid.Column="1" Grid.RowSpan="2"/>
|
||||
<Label Content="Description" Margin="1,173.4,453.8,0" Grid.Row="1" VerticalAlignment="Top" Height="41" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Description" Margin="0,231.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="41" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Name" Margin="0,30.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<Label Content="Street" Margin="0,79.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtFoodPlaceDescription" HorizontalAlignment="Left" Height="34" Margin="137,172.4,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtFoodPlaceDescription" HorizontalAlignment="Left" Height="108" Margin="136,230.4,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtFoodPlaceName" HorizontalAlignment="Left" Height="34" Margin="136,30.4,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtFoodPlaceStreetName" Height="34" Margin="136,79.4,23.8,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
|
||||
<Label Content="House Nr." Margin="0,125.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="34" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<TextBox x:Name="txtFoodPlaceHouseNumber" Height="34" Margin="137,125.4,23.8,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
|
||||
<Button x:Name="btnAddFoodPlace" Content="ADD FOODPLACE" HorizontalAlignment="Left" Margin="136,371.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Click="btnAddFoodPlace_Click" Grid.ColumnSpan="2" Height="44" FontSize="20"/>
|
||||
<Label Content="City" Margin="0,174.4,454.8,0" Grid.Row="1" VerticalAlignment="Top" Height="39" FontFamily="Tahoma" FontSize="24" Grid.ColumnSpan="2"/>
|
||||
<ComboBox x:Name="ComboBoxFPCities" HorizontalAlignment="Left" Margin="0.4,179.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="433" Grid.Column="1" Height="34"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -24,22 +24,37 @@ namespace WpfWebClient
|
|||
public FoodplaceForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
// Retrieve all cities and save them into "citylist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.City> citylist = new List<ServiceReferenceEHEC.City>(client.GetCities());
|
||||
|
||||
// Display all cities with name in Combobox
|
||||
ComboBoxFPCities.ItemsSource = citylist;
|
||||
ComboBoxFPCities.DisplayMemberPath = "Name";
|
||||
|
||||
}
|
||||
|
||||
private void btnAddFoodPlace_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
client.Open();
|
||||
// create new foodplace from user input
|
||||
|
||||
FoodPlace fp = new FoodPlace();
|
||||
FoodPlace fp = new FoodPlace();
|
||||
|
||||
fp.Name = txtFoodPlaceName.Text;
|
||||
fp.Streetname = txtFoodPlaceStreetName.Text;
|
||||
fp.Streetnumber = txtFoodPlaceHouseNumber.Text;
|
||||
fp.Description = txtFoodPlaceDescription.Text;
|
||||
|
||||
client.WriteFoodPlace(fp);
|
||||
fp.Streetname = txtFoodPlaceStreetName.Text;
|
||||
fp.Streetnumber = txtFoodPlaceHouseNumber.Text;
|
||||
fp.Name = txtFoodPlaceName.Text;
|
||||
fp.Description = txtFoodPlaceDescription.Text;
|
||||
fp.City = (City)ComboBoxFPCities.SelectedValue;
|
||||
|
||||
client.WriteFoodPlace(fp);
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WpfWebClient.ServiceReferenceEHEC;
|
||||
|
||||
namespace WpfWebClient.Helper
|
||||
{
|
||||
public static class GenerateTestData
|
||||
{
|
||||
private static List<FoodPlace> Foodplaces = new List<FoodPlace>();
|
||||
private static List<Exam> Exams = new List<Exam>();
|
||||
private static Random random = new Random();
|
||||
|
||||
private static List<String> FoodPlaceNameFirstPart = new List<string>(new string[]
|
||||
{
|
||||
"The ", "Tony's ", "Best ", "Paulas ", "Golden ", "Platinum ", "Super "
|
||||
});
|
||||
|
||||
private static List<String> FoodPlaceNameSecondPart = new List<string>(new string[]
|
||||
{
|
||||
"Pizzaplace", "Meatclub", "Veganitorium", "Applepie", "Burger", "Esspalast", "Döner", "Bananorama"
|
||||
});
|
||||
|
||||
private static List<String> FoodPlaceDescription = new List<string>(new string[]
|
||||
{
|
||||
"Einfach unglaublich", "Die grössten der ganzen Stadt", "Ziemlich durchschnittlich", "Einmal alles ohne scharf bitte",
|
||||
"Das ist eine B-Schreibung", "Etwas teuer aber trotzdem einen Besuch Wert", "Grösster Müll EVER", "Do ane chumi NIE MEH!"
|
||||
});
|
||||
|
||||
private static List<String> FoodPlaceStreetName = new List<string>(new string[]
|
||||
{
|
||||
"Hansestrasse", "Dorfweg", "Rumpelstrasse", "Hauptstrasse",
|
||||
"Blumengasse", "Pimpelpfad", "Im Grund", "Schotterweg"
|
||||
});
|
||||
|
||||
public static List<FoodPlace> CreateFoodPlaces()
|
||||
{
|
||||
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
List<WpfWebClient.ServiceReferenceEHEC.City> cities = new List<ServiceReferenceEHEC.City>(client.GetCities());
|
||||
|
||||
int FirstPartLength = FoodPlaceNameFirstPart.Count();
|
||||
int SecondPartLength = FoodPlaceNameSecondPart.Count();
|
||||
int Counter = FirstPartLength * SecondPartLength;
|
||||
|
||||
int i = 1;
|
||||
while (i < 20)
|
||||
{
|
||||
int FirstPart = random.Next(1, FirstPartLength);
|
||||
int SecondPart = random.Next(1, SecondPartLength);
|
||||
int Description = random.Next(FoodPlaceDescription.Count);
|
||||
string FoodPlaceDescr = FoodPlaceDescription[Description];
|
||||
int StreetName = random.Next(FoodPlaceStreetName.Count);
|
||||
string FoodPlacesm = FoodPlaceStreetName[StreetName];
|
||||
|
||||
string FoodPlaceName = FoodPlaceNameFirstPart[FirstPart] + FoodPlaceNameSecondPart[SecondPart];
|
||||
string streetname = FoodPlacesm;
|
||||
string fpdescr = FoodPlaceDescr;
|
||||
int StreetNumber = random.Next(1, 100);
|
||||
int CityID = random.Next(1, cities.Count());
|
||||
City city = cities[CityID];
|
||||
FoodPlace NewFoodPlace = new FoodPlace();
|
||||
|
||||
NewFoodPlace.Name = FoodPlaceName;
|
||||
NewFoodPlace.Streetname = streetname;
|
||||
NewFoodPlace.Streetnumber = StreetNumber.ToString();
|
||||
NewFoodPlace.Description = fpdescr;
|
||||
NewFoodPlace.City = city;
|
||||
|
||||
|
||||
|
||||
Foodplaces.Add(NewFoodPlace);
|
||||
i++;
|
||||
}
|
||||
|
||||
return Foodplaces;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,7 +10,17 @@
|
|||
|
||||
<Grid Width="593" Height="565">
|
||||
<Label Content="Willkommen" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontFamily="Tahoma" FontSize="48" Height="61" Width="272"/>
|
||||
<TextBlock HorizontalAlignment="Left" Margin="10,124,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="356" Width="573" FontSize="20"><Run Text="Haben Sie die Applikation zum ersten Mal gestartet"/><Run Text="?"/><LineBreak/><Run/><LineBreak/><Run Text="1. Erstellen Sie neue Patienten"/><LineBreak/><Run Text="2. Erfassen Sie neue Bakterienstämme"/><LineBreak/><Run Text="3. Erfassen Sie einen neuen Fall"/><LineBreak/><Run/><LineBreak/><Run/></TextBlock>
|
||||
<TextBlock HorizontalAlignment="Left" Margin="10,124,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="431" Width="573" FontSize="20"><Run Text="Haben Sie die Applikation zum ersten Mal gestartet"/><Run Text="?"/><LineBreak/><Run/><LineBreak/><Run Text="1. Erstellen Sie neue Patienten"/><LineBreak/><Run Text="2. "/><Run Text="Generieren "/><Run Text="Sie neue Bakterienstämme"/><Run Text=" "/><LineBreak/><Run/><LineBreak/><Run Text="Enter desired letters"/><Run Text=" per strain"/><Run Text=": "/><Run Text="	"/><InlineUIContainer>
|
||||
<TextBox x:Name="txtNumLetters" Height="30" TextWrapping="Wrap" Text="5" Width="120"/>
|
||||
</InlineUIContainer><LineBreak/><Run Text="Enter desired"/><Run Text=" amount of"/><Run Text=" strains: "/><Run Text="	"/><InlineUIContainer>
|
||||
<TextBox x:Name="txtNumStrains" Height="30" TextWrapping="Wrap" Text="100" Width="120"/>
|
||||
</InlineUIContainer><LineBreak/><LineBreak/><InlineUIContainer>
|
||||
<Button x:Name="btnRandomStrainGenerator" Content="CREATE RANDOM STRAINS" Width="580" Height="34" Click="btnRandomStrainGenerator_Click"/>
|
||||
</InlineUIContainer><Run Text="	"/><LineBreak/><Run Text="3. Erfassen Sie einen neuen Fall"/><Run Text=" oder erstellen Sie Testdaten mit einem "/><Run Text="K"/><Run Text="lick auf diesen Button: "/><InlineUIContainer>
|
||||
<Button Content="GENERATE EXAMS" Width="283" Click="btnGenerateExams"/>
|
||||
</InlineUIContainer><LineBreak/><Run Text="4. Erfassen Sie neue FoodPlaces oder erstellen Sie Testdaten mit einem Klick auf diesen Button: "/><InlineUIContainer>
|
||||
<Button Content="GENERATE FOODPLACES" Width="284" Click="btnGenerateFoodPlaces"/>
|
||||
</InlineUIContainer><LineBreak/></TextBlock>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -13,6 +13,7 @@ using System.Windows.Media.Imaging;
|
|||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WpfWebClient.ServiceReferenceEHEC;
|
||||
using WpfWebClient.Helper;
|
||||
|
||||
namespace WpfWebClient
|
||||
{
|
||||
|
@ -24,7 +25,95 @@ namespace WpfWebClient
|
|||
public Home()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void btnRandomStrainGenerator_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// create new client connection
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
// msgbox to confirm action
|
||||
if (MessageBox.Show("This could take a while, are you sure?", "More strains?",
|
||||
MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
||||
{
|
||||
|
||||
// Get the number of words and letters per word.
|
||||
int num_letters = int.Parse(txtNumLetters.Text);
|
||||
int num_words = int.Parse(txtNumStrains.Text);
|
||||
|
||||
// Make an array of the letters we will use.
|
||||
char[] letters = "AeIoUbRaTdAtIlU".ToCharArray();
|
||||
|
||||
// Make a random number generator.
|
||||
Random rand = new Random();
|
||||
|
||||
// Make the words.
|
||||
for (int i = 1; i <= num_words; i++)
|
||||
{
|
||||
// Make a word.
|
||||
string word = "";
|
||||
for (int j = 1; j <= num_letters; j++)
|
||||
{
|
||||
// Pick a random number between 0 and 25
|
||||
// to select a letter from the letters array.
|
||||
int letter_num = rand.Next(2, letters.Length - 1);
|
||||
|
||||
// Append the letter.
|
||||
word += letters[letter_num];
|
||||
}
|
||||
|
||||
// Write the strains into a list
|
||||
List<string> generatedStrains = new List<string>();
|
||||
|
||||
generatedStrains.Add(word);
|
||||
|
||||
foreach (var item in generatedStrains)
|
||||
{
|
||||
Strain s = new Strain();
|
||||
s.Name = item;
|
||||
client.WriteStrain(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
}
|
||||
|
||||
private void btnGenerateExams(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// create new client connection
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
//to be continued
|
||||
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
}
|
||||
|
||||
private void btnGenerateFoodPlaces(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// create new client connection
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
//to be continued
|
||||
var foodplaces = GenerateTestData.CreateFoodPlaces();
|
||||
|
||||
foreach (var f in foodplaces)
|
||||
{
|
||||
client.WriteFoodPlace(f);
|
||||
}
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,31 +27,31 @@ namespace WpfWebClient
|
|||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
|
||||
//Retrieve all salutations and save them into "salutationlist"
|
||||
// Retrieve all salutations and save them into "salutationlist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Salutation> salutationlist = new List<ServiceReferenceEHEC.Salutation>(client.GetSalutations());
|
||||
|
||||
//Display all salutations with name in Combobox
|
||||
// Display all salutations with name in Combobox
|
||||
ComboBoxSalutations.ItemsSource = salutationlist;
|
||||
ComboBoxSalutations.DisplayMemberPath = "Name";
|
||||
|
||||
//Retrieve all genders and save them into "genderlist"
|
||||
// Retrieve all genders and save them into "genderlist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Gender> genderlist = new List<ServiceReferenceEHEC.Gender>(client.GetGenders());
|
||||
|
||||
//Display all genders with name in Combobox
|
||||
// Display all genders with name in Combobox
|
||||
ComboBoxGenders.ItemsSource = genderlist;
|
||||
ComboBoxGenders.DisplayMemberPath = "Name";
|
||||
|
||||
//Retrieve all cities and save them into "citylist"
|
||||
// Retrieve all cities and save them into "citylist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.City> citylist = new List<ServiceReferenceEHEC.City>(client.GetCities());
|
||||
|
||||
//Display all cities with name in Combobox
|
||||
// Display all cities with name in Combobox
|
||||
ComboBoxCities.ItemsSource = citylist;
|
||||
ComboBoxCities.DisplayMemberPath = "Name";
|
||||
|
||||
//Retrieve all salutations and save them into "countrylist"
|
||||
// Retrieve all salutations and save them into "countrylist"
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Country> countrylist = new List<ServiceReferenceEHEC.Country>(client.GetCountries());
|
||||
|
||||
//Display all countries with name in Combobox
|
||||
// Display all countries with name in Combobox
|
||||
ComboBoxCountries.ItemsSource = countrylist;
|
||||
ComboBoxCountries.DisplayMemberPath = "Name";
|
||||
|
||||
|
@ -68,11 +68,11 @@ namespace WpfWebClient
|
|||
|
||||
Person p = new Person();
|
||||
|
||||
//if (ComboBoxSalutations.SelectedValue != null && ComboBoxSalutations.SelectedValue is Salutation)
|
||||
//if (ComboBoxGenders.SelectedValue != null && ComboBoxGenders.SelectedValue is Gender)
|
||||
//if (ComboBoxCities.SelectedValue != null && ComboBoxCities.SelectedValue is City)
|
||||
// if (ComboBoxSalutations.SelectedValue != null && ComboBoxSalutations.SelectedValue is Salutation)
|
||||
// if (ComboBoxGenders.SelectedValue != null && ComboBoxGenders.SelectedValue is Gender)
|
||||
// if (ComboBoxCities.SelectedValue != null && ComboBoxCities.SelectedValue is City)
|
||||
|
||||
//Pick all selected fields and send object to client
|
||||
// Pick all selected fields and send object to client
|
||||
p.Salutation = (Salutation)ComboBoxSalutations.SelectedValue;
|
||||
p.Gender = (Gender)ComboBoxGenders.SelectedValue;
|
||||
p.LastName = txtLastName.Text;
|
||||
|
@ -82,7 +82,10 @@ namespace WpfWebClient
|
|||
p.City = (City)ComboBoxCities.SelectedValue;
|
||||
|
||||
client.WritePatient(p);
|
||||
|
||||
|
||||
// Show success msgbox
|
||||
System.Windows.MessageBox.Show("Success", "INFO", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
client.Close();
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace WpfWebClient
|
|||
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
//call method GetDoctors and save them to doctorlist
|
||||
// call method GetDoctors and save them to doctorlist
|
||||
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Doctor> doctorlist = new List<ServiceReferenceEHEC.Doctor>(client.GetDoctors());
|
||||
|
||||
|
|
|
@ -27,11 +27,12 @@ namespace WpfWebClient
|
|||
|
||||
WpfWebClient.ServiceReferenceEHEC.ServiceClient client = new WpfWebClient.ServiceReferenceEHEC.ServiceClient();
|
||||
|
||||
//call method GetStrains and save them to strainlist
|
||||
// call method GetStrains and save them to strainlist
|
||||
|
||||
List<WpfWebClient.ServiceReferenceEHEC.Strain> strainlist = new List<ServiceReferenceEHEC.Strain>(client.GetStrains());
|
||||
|
||||
DataGridViewStrains.ItemsSource = strainlist;
|
||||
|
||||
|
||||
client.Close();
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
<Compile Include="FoodplaceForm.xaml.cs">
|
||||
<DependentUpon>FoodplaceForm.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\GenerateTestData.cs" />
|
||||
<Compile Include="Home.xaml.cs">
|
||||
<DependentUpon>Home.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
Loading…
Reference in New Issue