Exemplo n.º 1
0
        public static ReverseGeo GetInstance()
        {
            if (Instance == null)
            {
                Instance = new ReverseGeo();
            }

            return(Instance);
        }
Exemplo n.º 2
0
        public void SendMail(string ID)
        {
            Console.WriteLine("method called");
            var x = GetUserGroup(ID); //insert into m.Schats code

            Container con = GetContainer(ID);

            if (con != null)
            {
                string lat     = con.Latitude.ToString();
                string longi   = con.Longitude.ToString();
                String message = "";
                if (message.Length == 0)
                {
                    message = "Dear user,\n\nThe garbage container at " + ReverseGeo.GetInstance().GetAddressFromCoords(lat, longi) + " is nearly full!\n\n\n" +
                              "This Mail was automatically sent because this email address is subscribed to the container at: " + ReverseGeo.GetInstance().GetAddressFromCoords(lat, longi) + ".";
                }
                mailClient.sendMailToList(x, "A container you subscribed to is nearly full", message);
                SetSent(ID, true);
                Console.WriteLine("email sent");
            }
        }