From d3c4ff66a7e780e6e102b598e374ae36a83ec7c1 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 31 May 2007 14:24:15 +0000 Subject: * Completed reading of inventory in Manager. (still needs to be hooked up via interfaces, but easy to do.) --- .../OpenGrid.Framework.Data.MySQL/MySQLManager.cs | 48 +++++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) (limited to 'OpenGridServices/OpenGrid.Framework.Data.MySQL') diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index 11f34d7..0538bd3 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs @@ -290,14 +290,50 @@ namespace OpenGrid.Framework.Data.MySQL { try { - InventoryFolderBase retval = new InventoryFolderBase(); + InventoryFolderBase folder = new InventoryFolderBase(); - retval.agentID = new libsecondlife.LLUUID((string)reader["agentID"]); - retval.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); - retval.folderID = new libsecondlife.LLUUID((string)reader["folderID"]); - retval.name = (string)reader["folderName"]; + folder.agentID = new libsecondlife.LLUUID((string)reader["agentID"]); + folder.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); + folder.folderID = new libsecondlife.LLUUID((string)reader["folderID"]); + folder.name = (string)reader["folderName"]; - rows.Add(retval); + rows.Add(folder); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + } + + return rows; + } + + /// + /// Reads a collection of items from an SQL result + /// + /// The SQL Result + /// A List containing Inventory Items + public List readInventoryItems(IDataReader reader) + { + List rows = new List(); + + while (reader.Read()) + { + try + { + InventoryItemBase item = new InventoryItemBase(); + + item.assetID = new libsecondlife.LLUUID((string)reader["assetID"]); + item.avatarID = new libsecondlife.LLUUID((string)reader["avatarID"]); + item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString()); + item.inventoryDescription = (string)reader["inventoryDescription"]; + item.inventoryID = new libsecondlife.LLUUID((string)reader["inventoryID"]); + item.inventoryName = (string)reader["inventoryName"]; + item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString()); + item.parentFolderID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); + item.type = Convert.ToInt32(reader["type"].ToString()); + + rows.Add(item); } catch (Exception e) { -- cgit v1.1