aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs')
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
index ea7e2ac..1f7413f 100644
--- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
@@ -207,6 +207,39 @@ namespace OpenGrid.Framework.Data.MySQL
207 return retval; 207 return retval;
208 } 208 }
209 209
210 public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
211 {
212 string sql = "INSERT INTO logs (target, server, method, arguments, priority, message) VALUES (";
213 sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)";
214
215 Dictionary<string, string> parameters = new Dictionary<string, string>();
216 parameters["?server"] = serverDaemon;
217 parameters["?target"] = target;
218 parameters["?method"] = methodCall;
219 parameters["?arguments"] = arguments;
220 parameters["?priority"] = priority.ToString();
221 parameters["?message"] = logMessage;
222
223 bool returnval = false;
224
225 try
226 {
227 IDbCommand result = Query(sql, parameters);
228
229 if (result.ExecuteNonQuery() == 1)
230 returnval = true;
231
232 result.Dispose();
233 }
234 catch (Exception e)
235 {
236 Console.WriteLine(e.ToString());
237 return false;
238 }
239
240 return returnval;
241 }
242
210 public bool insertRow(SimProfileData profile) 243 public bool insertRow(SimProfileData profile)
211 { 244 {
212 string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; 245 string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";