public void LocationCitizenCreation(LocationCitizenService lcs, CitizenService cs, LocationService ls) { Console.Clear(); Console.WriteLine("Enter address for the location: "); string address = Console.ReadLine(); Console.WriteLine("Enter SocialSecurityNumber for the citizen: "); string ssn = (Console.ReadLine()); Console.WriteLine("Enter the date "); string date = (Console.ReadLine()); var cit = cs.Get(ssn); var loc = ls.GetAddress(address); var addLocationCitizen = new LocationCitizen() { Address = address, SSN = ssn, date = date, citizen = cit, location = loc }; lcs.Create(addLocationCitizen); Console.WriteLine("Location added!\n"); }
public void TestCaseCreation(CitizenService cs, TestCenterService tcs, TestCenterCitizenService tccs, LocationCitizenService lcs) { Console.Clear(); Console.WriteLine("Enter Social sericurity number for a citizen: "); string tempSSN = Console.ReadLine(); string ssn = tempSSN.Trim(); Console.Clear(); Console.WriteLine("Enter TestCenterId for where the testcenter occured: "); string tempTest = Console.ReadLine(); int tcid = int.Parse(tempTest); var cit = cs.Get(ssn); var tcr = tcs.Get(tcid); var tcc = new TestCenterCitizen(); tcc.SSN = cit.SSN; tcc.TestCenterId = tcr.TestCenterId; tcc.citizen = cit; tcc.testCenter = tcr; Console.Clear(); Console.WriteLine("Enter date for the test in the format (ddmmyy): "); string tempDate = Console.ReadLine(); tcc.Date = tempDate; Console.Clear(); Console.WriteLine("Enter status for the test either ready, done or not done: "); string statusOfTest = Console.ReadLine(); tcc.Status = statusOfTest; Console.Clear(); Console.WriteLine("Enter test result, P = Positve and N = Negative\n"); string tempResult = Console.ReadLine(); int checkBool = 0; do { if (tempResult == "P") { tcc.Result = true; checkBool = 1; } else if (tempResult == "N") { tcc.Result = false; checkBool = 1; } else { Console.WriteLine("Enter valid result: "); tempResult = Console.ReadLine(); checkBool = 0; } } while (checkBool == 0); tccs.Create(tcc); Console.WriteLine("Test case added\n"); }