143 lines
5.3 KiB
C#
143 lines
5.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.ServiceModel;
|
|
|
|
namespace EHEC_Server
|
|
{
|
|
public partial class GenerateDataBuilder
|
|
{
|
|
|
|
//dieses file wird im moment nicht benötigt, da alles im global benutzt wird, bitte so belassen für den moment
|
|
private static List<Doctor> Doctors = new List<Doctor>();
|
|
private static List<Patient> Patients = new List<Patient>();
|
|
private static List<Origin> Origins = new List<Origin>();
|
|
private static List<Result> Results = new List<Result>();
|
|
private static List<Exam> Exams = new List<Exam>();
|
|
private static Random Rnd = new Random();
|
|
|
|
private static List<string> PatientUid = new List<string>(new string[]
|
|
{
|
|
"djud73", "23jhgdh738","28hfc9","937hbnf9s","838fbnos","3886b10bd","nc3592bd0","3939uhdj","md8363gbd0","d93gd0sh"
|
|
});
|
|
|
|
private static List<string> DoctorUid = new List<string>(new string[]
|
|
{
|
|
"2123dd73", "2325438","2cqw","93123ff9s","cse6654","te5654hz","er343erg556","345tgww","345345tegv","te4tserz"
|
|
});
|
|
|
|
private static List<string> FirstNames = new List<string>(new string[]
|
|
{
|
|
"Michael", "Andreas", "Stefan", "Ivan","Adrien"
|
|
});
|
|
|
|
private static List<string> LastNames = new List<string>(new string[]
|
|
{
|
|
"Meister", "Schär", "Eberhard", "Zingg", "Howald", "Aebi", "Feldmann"
|
|
});
|
|
|
|
private static List<string> Streets = new List<string>(new string[]
|
|
{
|
|
"Rosenauweg", "Schessstrasse", "Hardstrasse", "Gehweg", "Bananastreet", "Moosweg", "Feldstrasse"
|
|
});
|
|
|
|
private static List<string> Cities = new List<string>(new string[]
|
|
{
|
|
"Meister", "Schär", "Eberhard", "Zingg", "Howald", "Aebi", "Feldmann"
|
|
});
|
|
|
|
private static List<string> Regions = new List<string>(new string[]
|
|
{
|
|
"Aargau", "Zurich", "Graubünden","Vallhalla", "Hell", "Heaven"
|
|
});
|
|
|
|
|
|
private static List<string> BirthDates = new List<string>(new string[]
|
|
{
|
|
"2001-07-11 20:18:00.000", "1999-03-12 10:18:00.000","1980-01-21 00:18:00.000",
|
|
});
|
|
|
|
private static List<string> DoctorOrigins = new List<string>(new string[]
|
|
{
|
|
"SanktMonika", "DisneyWorld", "Kantonsspital Baden", "Online Schulung"
|
|
});
|
|
|
|
|
|
public static Patient CreateRandomPatients(Patient patients)
|
|
{
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
{
|
|
Random p = new Random();
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
Patient patient = new Patient
|
|
{
|
|
PatientUid = PatientUid[p.Next(0, 10)].ToString(),
|
|
FirstName = FirstNames[p.Next(0, 5)].ToString(),
|
|
LastName = LastNames[p.Next(0, 7)].ToString(),
|
|
BirthDate = Convert.ToDateTime(BirthDates[p.Next(0, 3)].ToString()),
|
|
Street = Streets[p.Next(0, 7)].ToString(),
|
|
City = Cities[p.Next(0, 7)].ToString(),
|
|
Region = Regions[p.Next(0, 6)].ToString()
|
|
};
|
|
//Global.GlobalInstance.DbAccess.Patients.Add(patient);
|
|
ctx.Patients.Add(patient);
|
|
ctx.SaveChanges();
|
|
}
|
|
}
|
|
return patients;
|
|
}
|
|
public static Doctor CreateRandomDoctors(Doctor doctors)
|
|
{
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
{
|
|
|
|
Random d = new Random();
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
Doctor doctor = new Doctor
|
|
{
|
|
DoctorUid = DoctorUid[d.Next(0, 10)].ToString(),
|
|
FirstName = FirstNames[d.Next(0, 5)].ToString(),
|
|
LastName = LastNames[d.Next(0, 7)].ToString(),
|
|
DoctorOrigin = DoctorOrigins[d.Next(0, 4)].ToString(),
|
|
Region = Regions[d.Next(0, 6)].ToString()
|
|
};
|
|
//Global.GlobalInstance.DbAccess.Doctors.Add(doctor);
|
|
ctx.Doctors.Add(doctor);
|
|
ctx.SaveChanges();
|
|
}
|
|
}
|
|
return doctors;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//add patients
|
|
/* using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
{
|
|
Random p = new Random();
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
Patient patient = new Patient
|
|
{
|
|
PatientUid = PatientUid[p.Next(0, 10)].ToString(),
|
|
FirstName = FirstNames[p.Next(0, 5)].ToString(),
|
|
LastName = LastNames[p.Next(0, 7)].ToString(),
|
|
BirthDate = Convert.ToDateTime(BirthDates[p.Next(0, 3)].ToString()),
|
|
Street = Streets[p.Next(0, 7)].ToString(),
|
|
City = Cities[p.Next(0, 7)].ToString(),
|
|
Region = Regions[p.Next(0, 6)].ToString()
|
|
};
|
|
//Global.GlobalInstance.DbAccess.Patients.Add(patient);
|
|
ctx.Patients.Add(patient);
|
|
ctx.SaveChanges();
|
|
}
|
|
} */
|
|
//add doctors |