Ejemplo n.º 1
0
        public void createTestCenter(TestCenterService tcs)
        {
            Console.Clear();
            Console.WriteLine("Type the ID for the testcenter: ");
            int TestCenterID = int.Parse(Console.ReadLine());

            Console.WriteLine("Type the opening hours of the testcenter (fx. 8-16): ");
            string hours = Console.ReadLine();

            Console.WriteLine("Type the MunicipalityID for the municipality in which the testcenter is: ");
            int municipalityID = int.Parse(Console.ReadLine());

            var TestCenterAdd = new TestCenter()
            {
                TestCenterID   = TestCenterID,
                Hours          = hours,
                MunicipalityID = municipalityID
            };

            tcs.Create(TestCenterAdd);

            Console.WriteLine("TestCenter succesfully added!\n");
        }
Ejemplo n.º 2
0
        // Genererer et antal tilfældige testcentre
        public void GenerateTestCenter(TestCenterService tcs, int number = 100)
        {
            // Clears the database of TestCenter
            var myTestCenters = tcs.Get();

            foreach (var i in myTestCenters)
            {
                tcs.Remove(i);
            }

            for (int i = 1; i < (number + 1); i++)
            {
                var temp = random.Next(Municipalities.Count);

                var testcenter = new TestCenter()
                {
                    TestCenterID   = i,
                    MunicipalityID = Municipalities[temp],
                    Hours          = "8-20"
                };

                tcs.Create(testcenter);
            }
        }