Ejemplo n.º 1
0
        public string SwitchOnSOSviaSMS(string encryptedParms, string utcTicks, string ticks, string lat, string longi)
        {
            try
            {
                if (!string.IsNullOrEmpty(encryptedParms))
                {
                    string decodeEncryptedString = EncryptAndDecrypt.DecodeString(encryptedParms);

                    if (!string.IsNullOrEmpty(decodeEncryptedString))
                    {
                        string decryptedParameters = EncryptAndDecrypt.Decrypt(decodeEncryptedString);

                        if (!string.IsNullOrEmpty(decryptedParameters))
                        {
                            string[] parameters = Regex.Split(decryptedParameters, "&");

                            string ProfileID = Regex.Split(parameters[0], "=")[1];
                            string Token     = Regex.Split(parameters[1], "=")[1];
                            string SOS       = Regex.Split(parameters[2], "=")[1];

                            new GeoUpdate().SwitchOnSOSviaSMS(ProfileID, Token, SOS, ticks, lat, longi, utcTicks).GetAwaiter().GetResult();
                            return(ProfileID + "," + Token);
                        }
                    }
                    else
                    {
                        throw new InvalidDataException();
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }