aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
diff options
context:
space:
mode:
authorSean Dague2008-04-07 23:15:35 +0000
committerSean Dague2008-04-07 23:15:35 +0000
commitf43681510725f5b95fcb864a1f3e4b744fcaf992 (patch)
tree2d34caa75488d1c608d1a21b4888cb0f264a6cba /OpenSim/Data/MSSQL/MSSQLInventoryData.cs
parentneeded to add 4 characters to support the dashes (diff)
downloadopensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.zip
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.gz
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.bz2
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.xz
Refactor InventoryItemBase to do the following:
* wrap fields as Properties * rename some fields/properties to more sensible names * set style to PropName to match more standard C# approach
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLInventoryData.cs82
1 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index df7020d..15078aa 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -301,19 +301,19 @@ namespace OpenSim.Data.MSSQL
301 { 301 {
302 InventoryItemBase item = new InventoryItemBase(); 302 InventoryItemBase item = new InventoryItemBase();
303 303
304 item.inventoryID = new LLUUID((string) reader["inventoryID"]); 304 item.ID = new LLUUID((string) reader["inventoryID"]);
305 item.assetID = new LLUUID((string) reader["assetID"]); 305 item.AssetID = new LLUUID((string) reader["assetID"]);
306 item.assetType = (int) reader["assetType"]; 306 item.AssetType = (int) reader["assetType"];
307 item.parentFolderID = new LLUUID((string) reader["parentFolderID"]); 307 item.Folder = new LLUUID((string) reader["parentFolderID"]);
308 item.avatarID = new LLUUID((string) reader["avatarID"]); 308 item.Owner = new LLUUID((string) reader["avatarID"]);
309 item.inventoryName = (string) reader["inventoryName"]; 309 item.Name = (string) reader["inventoryName"];
310 item.inventoryDescription = (string) reader["inventoryDescription"]; 310 item.Description = (string) reader["inventoryDescription"];
311 item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]); 311 item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]);
312 item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]); 312 item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]);
313 item.invType = (int) reader["invType"]; 313 item.InvType = (int) reader["invType"];
314 item.creatorsID = new LLUUID((string) reader["creatorID"]); 314 item.Creator = new LLUUID((string) reader["creatorID"]);
315 item.inventoryBasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); 315 item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
316 item.inventoryEveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); 316 item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
317 return item; 317 return item;
318 } 318 }
319 catch (SqlException e) 319 catch (SqlException e)
@@ -425,7 +425,7 @@ namespace OpenSim.Data.MSSQL
425 /// <param name="item">The inventory item</param> 425 /// <param name="item">The inventory item</param>
426 public void addInventoryItem(InventoryItemBase item) 426 public void addInventoryItem(InventoryItemBase item)
427 { 427 {
428 if (getInventoryItem(item.inventoryID) != null) 428 if (getInventoryItem(item.ID) != null)
429 { 429 {
430 updateInventoryItem(item); 430 updateInventoryItem(item);
431 return; 431 return;
@@ -440,19 +440,19 @@ namespace OpenSim.Data.MSSQL
440 try 440 try
441 { 441 {
442 Dictionary<string, string> param = new Dictionary<string, string>(); 442 Dictionary<string, string> param = new Dictionary<string, string>();
443 param["inventoryID"] = item.inventoryID.ToString(); 443 param["inventoryID"] = item.ID.ToString();
444 param["assetID"] = item.assetID.ToString(); 444 param["assetID"] = item.AssetID.ToString();
445 param["assetType"] = item.assetType.ToString(); 445 param["assetType"] = item.AssetType.ToString();
446 param["parentFolderID"] = item.parentFolderID.ToString(); 446 param["parentFolderID"] = item.Folder.ToString();
447 param["avatarID"] = item.avatarID.ToString(); 447 param["avatarID"] = item.Owner.ToString();
448 param["inventoryName"] = item.inventoryName; 448 param["inventoryName"] = item.Name;
449 param["inventoryDescription"] = item.inventoryDescription; 449 param["inventoryDescription"] = item.Description;
450 param["inventoryNextPermissions"] = item.inventoryNextPermissions.ToString(); 450 param["inventoryNextPermissions"] = item.NextPermissions.ToString();
451 param["inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString(); 451 param["inventoryCurrentPermissions"] = item.CurrentPermissions.ToString();
452 param["invType"] = Convert.ToString(item.invType); 452 param["invType"] = Convert.ToString(item.InvType);
453 param["creatorID"] = item.creatorsID.ToString(); 453 param["creatorID"] = item.Creator.ToString();
454 param["inventoryBasePermissions"] = Convert.ToString(item.inventoryBasePermissions); 454 param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions);
455 param["inventoryEveryOnePermissions"] = Convert.ToString(item.inventoryEveryOnePermissions); 455 param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions);
456 456
457 IDbCommand result = database.Query(sql, param); 457 IDbCommand result = database.Query(sql, param);
458 result.ExecuteNonQuery(); 458 result.ExecuteNonQuery();
@@ -484,20 +484,20 @@ namespace OpenSim.Data.MSSQL
484 "inventoryBasePermissions = @inventoryBasePermissions" + 484 "inventoryBasePermissions = @inventoryBasePermissions" +
485 "inventoryEveryOnePermissions = @inventoryEveryOnePermissions) where " + 485 "inventoryEveryOnePermissions = @inventoryEveryOnePermissions) where " +
486 "inventoryID = @keyInventoryID;", database.getConnection()); 486 "inventoryID = @keyInventoryID;", database.getConnection());
487 SqlParameter param1 = new SqlParameter("@inventoryID", item.inventoryID.ToString()); 487 SqlParameter param1 = new SqlParameter("@inventoryID", item.ID.ToString());
488 SqlParameter param2 = new SqlParameter("@assetID", item.assetID); 488 SqlParameter param2 = new SqlParameter("@assetID", item.AssetID);
489 SqlParameter param3 = new SqlParameter("@assetType", item.assetType); 489 SqlParameter param3 = new SqlParameter("@assetType", item.AssetType);
490 SqlParameter param4 = new SqlParameter("@parentFolderID", item.parentFolderID); 490 SqlParameter param4 = new SqlParameter("@parentFolderID", item.Folder);
491 SqlParameter param5 = new SqlParameter("@avatarID", item.avatarID); 491 SqlParameter param5 = new SqlParameter("@avatarID", item.Owner);
492 SqlParameter param6 = new SqlParameter("@inventoryName", item.inventoryName); 492 SqlParameter param6 = new SqlParameter("@inventoryName", item.Name);
493 SqlParameter param7 = new SqlParameter("@inventoryDescription", item.inventoryDescription); 493 SqlParameter param7 = new SqlParameter("@inventoryDescription", item.Description);
494 SqlParameter param8 = new SqlParameter("@inventoryNextPermissions", item.inventoryNextPermissions); 494 SqlParameter param8 = new SqlParameter("@inventoryNextPermissions", item.NextPermissions);
495 SqlParameter param9 = new SqlParameter("@inventoryCurrentPermissions", item.inventoryCurrentPermissions); 495 SqlParameter param9 = new SqlParameter("@inventoryCurrentPermissions", item.CurrentPermissions);
496 SqlParameter param10 = new SqlParameter("@invType", item.invType); 496 SqlParameter param10 = new SqlParameter("@invType", item.InvType);
497 SqlParameter param11 = new SqlParameter("@creatorID", item.creatorsID); 497 SqlParameter param11 = new SqlParameter("@creatorID", item.Creator);
498 SqlParameter param12 = new SqlParameter("@inventoryBasePermissions", item.inventoryBasePermissions); 498 SqlParameter param12 = new SqlParameter("@inventoryBasePermissions", item.BasePermissions);
499 SqlParameter param13 = new SqlParameter("@inventoryEveryOnePermissions", item.inventoryEveryOnePermissions); 499 SqlParameter param13 = new SqlParameter("@inventoryEveryOnePermissions", item.EveryOnePermissions);
500 SqlParameter param14 = new SqlParameter("@keyInventoryID", item.inventoryID.ToString()); 500 SqlParameter param14 = new SqlParameter("@keyInventoryID", item.ID.ToString());
501 command.Parameters.Add(param1); 501 command.Parameters.Add(param1);
502 command.Parameters.Add(param2); 502 command.Parameters.Add(param2);
503 command.Parameters.Add(param3); 503 command.Parameters.Add(param3);