public Boolean RemoveBidHouseItemAtLine(BidHouseItem BHI) { byte cat = (byte)(BHI.getQuantity(false) - 1); Boolean canDelete = Categories[cat].Remove(BHI); Tri(cat); return(canDelete); }
public static void Add(BidHouseItem BHI) { try { MySqlCommand Command = new MySqlCommand() { Connection = DatabaseManager.Provider.getConnection(), CommandText = "REPLACE INTO `bidhouse_items` VALUES(@map,@owner,@price,@count,@item);", }; Command.Prepare(); Command.Parameters.AddWithValue("@map", BHI.MapID); Command.Parameters.AddWithValue("@owner", BHI.Owner); Command.Parameters.AddWithValue("@price", BHI.Price); Command.Parameters.AddWithValue("@count", BHI.getQuantity(false)); Command.Parameters.AddWithValue("@item", BHI.Item.ID); Command.ExecuteNonQuery(); } catch (Exception e) { Logger.Error("Can't execute query : " + e.ToString()); } }