Beispiel #1
0
        private void TagAsBooked(MappedOrder order, string info)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(this.connectionStr))
                {
                    SqlCommand command = connection.CreateCommand();
                    command.CommandText = "MappedOrder_TagAsBooked";
                    command.CommandType = CommandType.StoredProcedure;
                    connection.Open();
                    command.Parameters.Add("@orderId", SqlDbType.UniqueIdentifier).Value = order.ID;
                    command.Parameters.Add("@bookResult", SqlDbType.NVarChar).Value      = info;

                    command.ExecuteNonQuery();
                }
            }
            catch (Exception exception)
            {
                AppDebug.LogEvent("StateServer", string.Format("TagAsBooked failed, error = {0} \n {1}", exception, order.ToXmlNode().OuterXml), System.Diagnostics.EventLogEntryType.Warning);
            }
        }
Beispiel #2
0
        private bool Book(MappedOrder order)
        {
            order.Adjust();
            TransactionError error = this.bookExecutor(order);

            if (error != TransactionError.RuntimeError)
            {
                if (error != TransactionError.OK)
                {
                    AppDebug.LogEvent("StateServer", string.Format("Book failed, error = {0} \n {1}", error, order.ToXmlNode().OuterXml), System.Diagnostics.EventLogEntryType.Warning);
                }

                this.TagAsBooked(order, string.Format("Book restult is {0}", error));

                return(true);
            }
            else
            {
                AppDebug.LogEvent("StateServer", string.Format("Book failed, error = {0} \n {1}", error, order.ToXmlNode().OuterXml), System.Diagnostics.EventLogEntryType.Warning);
                return(false);
            }
        }