public void LogFailedCommand(Common.Commands.Infrastructure.ICommand command, Exception ex) { _databaseLayer.ExecuteNonQuery( "UPDATE Commands SET ExceptionDetails = @ExceptionDetails WHERE CommandId = @CommandId", "@ExceptionDetails", ex.ToString(), "@CommandId", command.CommandId.ToString()); }
public void LogCommand(Common.Commands.Infrastructure.ICommand command) { _databaseLayer.ExecuteNonQuery( "INSERT INTO Commands(CommandId, CommandDateTime, UserName, IpAddress, CommandData) VALUES(@CommandId, @CommandDateTime, @UserName, @IpAddress, @CommandData)", "@CommandId", command.CommandId.ToString(), "@CommandDateTime", command.Timestamp.ToUniversalTime().ToString("dd-MMM-yyyy HH:mm:ss.ff"), "@UserName", command.User, "@IpAddress", command.IPAddress, "@CommandData", SerializeCommand(command)); }