public async Task <string> HandleResult(IDictionary <string, object> payload)
        {
            var connectionString = "Server = 10.1.2.26; Uid = sqldude; Pwd = 123Whatsup; Database = lis;";

            string testName       = (string)payload["testName"];
            string aliquotOrderId = (string)payload["aliquotOrderId"];
            string hpv16Result    = (string)payload["hpv16Result"];
            string hpv18Result    = (string)payload["hpv1845Result"];

            HPV1618Result hpv1618Result = HPV1618Result.GetResult(hpv16Result, hpv18Result);
            string        sql           = hpv1618Result.GetSqlStatement(aliquotOrderId);

            using (var cnx = new MySqlConnection(connectionString))
            {
                using (var cmd = new MySqlCommand(sql, cnx))
                {
                    await cnx.OpenAsync();

                    await cmd.ExecuteNonQueryAsync();
                }
            }

            return("Optimus Prime updated result: " + aliquotOrderId + " - " + testName + " on " + DateTime.Now.ToString());
        }
Exemplo n.º 2
0
        public async Task <string> HandleResult(IDictionary <string, object> payload)
        {
            var connectionString = "Data Source=TestSQL;Initial Catalog=YPIData;Integrated Security=True";

            string testName       = (string)payload["testName"];
            string aliquotOrderId = (string)payload["aliquotOrderId"];
            string hpv16Result    = (string)payload["hpv16Result"];
            string hpv18Result    = (string)payload["hpv1845Result"];

            HPV1618Result hpv1618Result = HPV1618Result.GetResult(hpv16Result, hpv18Result);
            string        sql           = hpv1618Result.GetSqlStatement(aliquotOrderId);

            using (var cnx = new SqlConnection(connectionString))
            {
                using (var cmd = new SqlCommand(sql, cnx))
                {
                    await cnx.OpenAsync();

                    await cmd.ExecuteNonQueryAsync();
                }
            }

            return("Optimus Prime updated result: " + aliquotOrderId + " - " + testName + " on " + DateTime.Now.ToString());
        }