public void LogSecurityEventInternal(EventType type, Result result, string description, HttpContextLoggerInfo wrapper) { var connection = new SqlConnection(ConnectionString); var cmd = new SqlCommand("dbo.LogSecurityEvent", connection) { CommandType = CommandType.StoredProcedure }; var requestIdParameter = new SqlParameter("RequestId", SqlDbType.BigInt) { Direction = ParameterDirection.InputOutput }; cmd.Parameters.Add(requestIdParameter); if (wrapper == null) { requestIdParameter.Value = null; } else { SetWebEnabledParameters(cmd, wrapper); requestIdParameter.Value = wrapper.Items[REQUEST_ID_CONTEXT_KEY]; } SetStandAloneSecurityEventParameters(description, type, result, cmd); ExecuteCommand(connection, cmd); RequestId = Convert.ToInt32(cmd.Parameters["RequestId"].Value); if (wrapper != null && wrapper.Items[REQUEST_ID_CONTEXT_KEY] == null) { wrapper.Items[REQUEST_ID_CONTEXT_KEY] = RequestId; } }
public int LogSecurityEvent(EventType type, Result result, string description) { var requestId = HttpContext.Current.Items[Keys.REQUEST_ID_KEY] as int?; return _LoggerDao.LogSecurityEvent(requestId, type, result, description); }
public Int32 LogSecurityEvent(Int32? requestId, EventType type, Result result, string description) { var connection = new SqlConnection(ConnectionString); var cmd = new SqlCommand("dbo.LogSecurityEvent2", connection) {CommandType = System.Data.CommandType.StoredProcedure}; if (requestId != null) cmd.Parameters.Add(new SqlParameter("RequestId", System.Data.SqlDbType.BigInt)).Value = requestId; cmd.Parameters.Add(new SqlParameter("EventTypeId", System.Data.SqlDbType.NChar)).Value = type.Key; cmd.Parameters.Add(new SqlParameter("Description", System.Data.SqlDbType.NVarChar)).Value = description; cmd.Parameters.Add(new SqlParameter("ResultId", System.Data.SqlDbType.NVarChar)).Value = result.Key; ExecuteCommand(connection, cmd); return Convert.ToInt32(cmd.Parameters["SecurityEventId"].Value); }
public void LogSecurityEvent(EventType type, Result result, string description) { var wrapper = GetLoggerInfo(); _LoggerDao.LogSecurityEventInternal(type, result, description, wrapper); }
private void SetStandAloneSecurityEventParameters(string description, EventType type, Result result, SqlCommand cmd) { cmd.Parameters.Add(new SqlParameter("AppId", SqlDbType.NChar)).Value = App.Key; cmd.Parameters.Add(new SqlParameter("EventTypeId", SqlDbType.NChar)).Value = type.Key; cmd.Parameters.Add(new SqlParameter("Description", SqlDbType.NVarChar)).Value = description; cmd.Parameters.Add(new SqlParameter("ResultId", SqlDbType.NVarChar)).Value = result.Key; }