add the models

This commit is contained in:
Andreas Zweili 2018-05-21 12:24:20 +02:00
parent 273cbe002c
commit 92f472caa8
10 changed files with 286 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class City
{
private string _Name;
private int _ZipCode;
private Country _Counry;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
[DataMember]
public int ZipCode { get => _ZipCode; set => _ZipCode = value; }
[DataMember]
public Country Country { get => _Counry; set => _Counry = value; }
public City (string name, int zipCode, Country country)
{
this.Name = name;
this.ZipCode = zipCode;
this.Country = country;
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Country
{
private string _Name;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
public Country (string name)
{
this.Name = name;
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Doctor
{
private Person _Person;
private Status _Status;
[DataMember]
public Person Person { get => _Person; set => _Person = value; }
[DataMember]
public Status Status { get => _Status; set => _Status = value; }
public Doctor (Person person, Status status)
{
this.Person = person;
this.Status = status;
}
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Exam
{
private DateTime _Date;
private Doctor _Doctor;
private Person _Patient;
private Result _Result;
[DataMember]
public DateTime Date { get => _Date; set => _Date = value; }
[DataMember]
public Doctor Doctor { get => _Doctor; set => _Doctor = value; }
[DataMember]
public Person Patient { get => _Patient; set => _Patient = value; }
[DataMember]
public Result Result { get => _Result; set => _Result = value; }
public Exam (Doctor doctor, Person patient, Result result)
{
this.Date = DateTime.Now;
this.Doctor = doctor;
this.Patient = patient;
this.Result = result;
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Gender
{
private string _Name;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
public Gender (string name)
{
this.Name = name;
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Person
{
private string _FirstName;
private string _LastName;
private Gender _Gender;
private Salutation _Salutation;
private string _StreetName;
private City _City;
[DataMember]
public string FirstName { get => _FirstName; set => _FirstName = value; }
[DataMember]
public string LastName { get => _LastName; set => _LastName = value; }
[DataMember]
public Gender Gender { get => _Gender; set => _Gender = value; }
[DataMember]
public Salutation Salutation { get => _Salutation; set => _Salutation = value; }
[DataMember]
public string StreetName { get => _StreetName; set => _StreetName = value; }
[DataMember]
public City City { get => _City; set => _City = value; }
public Person (string firstName, string lastName, Gender gender, Salutation salutation,
string streetName, City city)
{
this.FirstName = firstName;
this.LastName = lastName;
this.Gender = gender;
this.Salutation = salutation;
this.StreetName = streetName;
this.City = city;
}
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Result
{
private string _Name;
private string _Description;
private Strain _Strain;
private bool _Infected;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
[DataMember]
public string Description { get => _Description; set => _Description = value; }
[DataMember]
public Strain Strain { get => _Strain; set => _Strain = value; }
[DataMember]
public bool Infected { get => _Infected; set => _Infected = value; }
public Result (string name, string description, Strain strain, bool infected)
{
this.Name = name;
this.Description = description;
this.Strain = strain;
this.Infected = infected;
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Salutation
{
private string _Name;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
public Salutation (string name)
{
this.Name = name;
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Status
{
private string _Name;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
public Status (string name)
{
this.Name = name;
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace Server.Models
{
[DataContract]
public class Strain
{
private string _Name;
[DataMember]
public string Name { get => _Name; set => _Name = value; }
public Strain (string name)
{
this.Name = name;
}
}
}