Exemple #1
0
        public static void InizializeInitialProceses()
        {
            bool isNecessaryCreateTables;

            isNecessaryCreateTables = CheckTables();

            List <ITaskable> oITaskableList = new List <ITaskable>();

            if (isNecessaryCreateTables)
            {
                oITaskableList.Add(InitialCreateTables.GetInstance(
                                       CovidDAOPostgreImpl.GetInstance()));
            }
            oITaskableList.Add(new InitialDataInsertions(CovidDAOPostgreImpl.GetInstance(), true));

            TaskableThreadManager oTaskableThreadManager = new TaskableThreadManager(true, oITaskableList.ToArray());

            oTaskableThreadManager.ThreadProc();
        }
Exemple #2
0
        private static bool CheckTables()
        {
            CovidDAOPostgreImpl oCovidDAO    = CovidDAOPostgreImpl.GetInstance();
            List <GeoZone>      oGeoZoneList = new List <GeoZone>();

            oCovidDAO.GetAllCountries(oGeoZoneList);
            if (oGeoZoneList.Count < 200)
            {
                return(true);
            }
            List <CovidDate> oCovidDateList = new List <CovidDate>();

            oCovidDAO.GetAllDates(oCovidDateList);
            if (oCovidDateList.Count < 100)
            {
                return(true);
            }

            return(false);
        }