public List <MarketplaceItem> SearchMarketItem(MarketSearchOption option, ushort pageindex, object vars) { return(null); }
public List<MarketplaceItem> SearchMarketItem(MarketSearchOption option, ushort pageindex, object vars) { return null; }
public List<MarketplaceItem> SearchMarketItem(MarketSearchOption option, ushort pageindex,object vars) { string sqlstr = ""; switch (option) { case MarketSearchOption.ItemType: sqlstr = string.Format("SELECT * FROM `market` WHERE item_type='{0}' LIMIT {1}, 36;", vars.ToString(), pageindex * 36); break; case MarketSearchOption.Owner: sqlstr = string.Format("SELECT * FROM `market` WHERE owner='{0}' LIMIT {1}, 36;", vars.ToString(), pageindex * 36); break; } DataRowCollection results = SQLExecuteQuery(sqlstr); List<MarketplaceItem> list = new List<MarketplaceItem>(); foreach (DataRow i in results) { MarketplaceItem item = new MarketplaceItem(); item.item = new Item((int)(uint)i["item_id"], "", (ushort)i["item_durability"], (byte)i["item_stack"]); item.id = (uint)i["id"]; item.owner = (string)i["owner"]; item.price = (uint)i["price"]; item.comment = (string)i["comment"]; item.expire = DateTime.Parse((string)i["expire"]); list.Add(item); } return list; }