IBE.SQL.EliteDBIO.updateVisitedFlagsFromBase C# (CSharp) Method

updateVisitedFlagsFromBase() public method

Update the visited-flag in the stations- and systems-tables from the visited-basetables (tbVisitedStations/tbVistitedSystems).
public updateVisitedFlagsFromBase ( System.Boolean newSystem = true, System.Boolean newStation = true ) : void
newSystem System.Boolean
newStation System.Boolean
return void
        public void updateVisitedFlagsFromBase(Boolean newSystem = true, Boolean newStation = true)
        {
            String sqlString;
            
            try
            {
                if(newSystem)
                { 
                    sqlString = "update tbSystems S left join tbVisitedSystems V on S.id = V.system_id" +
                                "   set visited = if(V.system_id is null, 0, 1)";
                    Program.DBCon.Execute(sqlString);
                }

                if(newStation)
                { 
                    sqlString = "update tbStations S left join tbVisitedStations V on S.id = V.station_id" +
                                "   set visited = if(V.station_id is null, 0, 1)";
                    Program.DBCon.Execute(sqlString);
                }

            }
            catch (Exception ex)
            {
                throw new Exception("Error while updating the visited systems from log", ex);
            }
        }