Exemple #1
0
        private static void DeleteSyncRow(WhitelistType whitelistType, string Ip, BatchQueryBuilder batchQueryBuilder)
        {
            var command = new MySqlCommand($"DELETE FROM FamilyRpServerAccess.{schemaTable[whitelistType]} WHERE IP = @IP;");

            command.Parameters.AddWithValue("IP", Ip);
            batchQueryBuilder.AppendSqlCommand(command);
        }
Exemple #2
0
        private static void UpdateSyncStatus(WhitelistType whitelistType, string Ip, string targetState, BatchQueryBuilder batchQueryBuilder)
        {
            var command = new MySqlCommand($"UPDATE FamilyRpServerAccess.{schemaTable[whitelistType]} SET State = @State WHERE IP = @IP;");

            command.Parameters.AddWithValue("State", targetState);
            command.Parameters.AddWithValue("IP", Ip);
            batchQueryBuilder.AppendSqlCommand(command);
        }
Exemple #3
0
 private static void AuditLog(string WhitelistType, string Ip, string ActionType, BatchQueryBuilder batchQueryBuilder)
 {
     batchQueryBuilder.AppendSqlCommand(new MySqlCommand($@"INSERT INTO FamilyRpServerAccess.ServerWhitelistLog (Date, ActionType, Ip, WhitelistType) VALUES
                         (NOW(), '{ActionType}', '{Ip}', '{WhitelistType}');"));
 }