/// <summary> /// /// </summary> /// <param name="charId"></param> /// <returns></returns> public static List <ItemsEntry> LoadItems(int charId) { List <ItemsEntry> items = new List <ItemsEntry>(); SqlWrapper sqlWrapper = new SqlWrapper(); try { string sqlQuery = "SELECT `Placement`, `Flags`, `MultipleCount`, `Type`, `Instance`, `LowID`, `HighID`, `Quality`, `Nothing` FROM `inventory` WHERE ID = " + "'" + charId + "' ORDER BY Placement ASC"; DataTable dataTable = sqlWrapper.ReadDatatable(sqlQuery); foreach (DataRow itemRow in dataTable.Rows) { ItemsEntry itemEntry = new ItemsEntry(); itemEntry.Placement = (Int32)itemRow["Placement"]; itemEntry.Flags = (Int16)itemRow["Flags"]; itemEntry.MultipleCount = (Int16)itemRow["MultipleCount"]; itemEntry.ItemType = (Int32)itemRow["Type"]; itemEntry.Instance = (Int32)itemRow["Instance"]; itemEntry.LowId = (Int32)itemRow["LowID"]; itemEntry.HighId = (Int32)itemRow["HighID"]; itemEntry.Quality = (Int32)itemRow["Quality"]; itemEntry.Nothing = (Int32)itemRow["Nothing"]; items.Add(itemEntry); } } catch (Exception e) { sqlWrapper.sqlclose(); Console.WriteLine("Error: CharacterID: " + charId + "Message: " + e.Message); } return(items); }
/// <summary> /// /// </summary> /// <param name="charId"></param> /// <returns></returns> public static List<ItemsEntry> LoadItems(int charId) { List<ItemsEntry> items = new List<ItemsEntry>(); SqlWrapper sqlWrapper = new SqlWrapper(); try { string sqlQuery = "SELECT `Placement`, `Flags`, `MultipleCount`, `Type`, `Instance`, `LowID`, `HighID`, `Quality`, `Nothing` FROM `inventory` WHERE ID = " + "'" + charId + "' ORDER BY Placement ASC"; DataTable dataTable = sqlWrapper.ReadDatatable(sqlQuery); foreach (DataRow itemRow in dataTable.Rows) { ItemsEntry itemEntry = new ItemsEntry(); itemEntry.Placement = (Int32)itemRow["Placement"]; itemEntry.Flags = (Int16)itemRow["Flags"]; itemEntry.MultipleCount = (Int16)itemRow["MultipleCount"]; itemEntry.ItemType = (Int32)itemRow["Type"]; itemEntry.Instance = (Int32)itemRow["Instance"]; itemEntry.LowId = (Int32)itemRow["LowID"]; itemEntry.HighId = (Int32)itemRow["HighID"]; itemEntry.Quality = (Int32)itemRow["Quality"]; itemEntry.Nothing = (Int32)itemRow["Nothing"]; items.Add(itemEntry); } } catch (Exception e) { sqlWrapper.sqlclose(); Console.WriteLine("Error: CharacterID: " + charId + "Message: " + e.Message); } return items; }