public static async Task <List <PortCall> > getAllShips()
        {
            List <PortCall> portCalls = await RestHandler.getPortCalls();

            foreach (PortCall p in portCalls)
            {
                string imo         = p.vessel.imo;
                string name        = p.vessel.name;
                string imgURL      = p.vessel.photoURL;
                string portCallId  = p.id;
                string arrivalDate = p.arrivalDate;
                Console.WriteLine(arrivalDate);

                conn = new MySqlConnection(connectionString);
                conn.Open();

                MySqlCommand cmd = new MySqlCommand("INSERT IGNORE INTO tbl_ship SET imoNumber = '" +
                                                    imo + "', name = '" + name + "', imgURL = '" +
                                                    imgURL + "', portCallID = '" + portCallId +
                                                    "', active = '0', arrivalDate = '" + arrivalDate + "';");
                cmd.Connection = conn;
                cmd.ExecuteNonQuery();
                conn.Close();
            }
            return(portCalls);
        }
        public static async Task <string> createDepartureMessage(string shipIMO)
        {
            string portCallID = DataBaseHandler.getPortCallId(shipIMO);

            departureMessage.Clear();
            departureMessage.Append("PortCall ID: " + portCallID + "<br />");

            List <portCallMessage> list = await RestHandler.getEvents(portCallID);



            //Sort list based on DateTime time
            list.Sort((x, y) => DateTime.Compare(LocationOrService(x), LocationOrService(y)));

            foreach (portCallMessage pcm in list)
            {
                appendMessageInfo(pcm);
            }
            addComment("<br />" + portCallID);

            return(departureMessage.ToString());
        }