static void Main(string[] args) { Random random = new Random(); ResourceManager.LoadResources(); PersonGenerator pg = new PersonGenerator(random); DoctorGenerator dg = new DoctorGenerator(random); PatientsGenerator pSQLg = new PatientsGenerator(random); VisitGenerator vg = new VisitGenerator(random); TreatmentsGenerator tg = new TreatmentsGenerator(random); int numberOfDoctors_T1 = random.Next(10, 16); List <Doctor> doctors_T1 = dg.GenerateList_T1(numberOfDoctors_T1); List <Doctor> doctors_T2 = dg.GenerateList_T2(doctors_T1); /*listy sql*/ List <DoctorSql> doctors_sql_T1 = DoctorSqlGenerator.Generate(doctors_T1); List <DoctorSql> doctors_sql_T2 = DoctorSqlGenerator.Generate(doctors_T2); /*ustawianie ilosci pacjentow TUTAJ*/ List <Patient> patients_sql = pSQLg.GenerateListOfPatients(100); List <Disease> diseases_sql = Disease.GenerateDiseases(); List <Drugs> drugs_sql = Drugs.MakeDrugs(); /*ustawianie ilosci wizyt TUTAJ*/ List <Visit> visits_sql = vg.GenerateVisits(1000, doctors_sql_T1, patients_sql, diseases_sql); /*Generowanie insertow SQL dla T1*/ List <Treatment> treatments_sql = tg.Generate(visits_sql, drugs_sql); SqlGenerator.SqlFromDoctors(@"..\..\JanuszMED_T1.sql", doctors_sql_T1); SqlGenerator.SqlFromPatients(@"..\..\JanuszMED_T1.sql", patients_sql); SqlGenerator.SqlFromDiseases(@"..\..\JanuszMED_T1.sql", diseases_sql); SqlGenerator.SqlFromDrugs(@"..\..\JanuszMED_T1.sql", drugs_sql); SqlGenerator.SqlFromVisits(@"..\..\JanuszMED_T1.sql", visits_sql); SqlGenerator.SqlFromTreatments(@"..\..\JanuszMED_T1.sql", treatments_sql); /* Generowanie insertów SQL dla T2 */ SqlGenerator.SqlFromDoctors_T2(@"..\..\JanuszMED_T2.sql", doctors_sql_T2); List <Patient> patients_sql2 = pSQLg.PickFewPatients(100, patients_sql); List <Visit> visits_sql2 = vg.GenerateVisits(10000, doctors_sql_T2, patients_sql2, diseases_sql); SqlGenerator.SqlUpdatePatients(@"..\..\JanuszMED_T2.sql", patients_sql2); SqlGenerator.SqlFromVisits(@"..\..\JanuszMED_T2.sql", visits_sql2); SaveDoctorToExcel(doctors_T1, "Lekarze_T1.xls"); SaveDoctorToExcel(doctors_T2, "Lekarze_T2.xls"); }
public static List <Drugs> MakeDrugs() { List <Drugs> list = new List <Drugs>(); for (int i = 0; i < ResourceManager.Drugs.Count(); i++) { Drugs d = new Drugs(); d.Id = i; d.Name = ResourceManager.Drugs[i]; d.Producer = "Producent_" + i.ToString(); list.Add(d); } return(list); }
public Treatment(Visit v, Drugs d) { this.Visit = v; this.Drug = d; }