public ServerMessage method_5(int int_0, int int_1, string string_0, int int_2) { DataTable dataTable = null; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("WHERE state = '1' AND timestamp >= " + this.method_4()); if (int_0 >= 0) { stringBuilder.Append(" AND total_price > " + int_0); } if (int_1 >= 0) { stringBuilder.Append(" AND total_price < " + int_1); } string text; switch (int_2) { case 1: text = "ORDER BY asking_price DESC"; goto IL_82; } text = "ORDER BY asking_price ASC"; IL_82: using (DatabaseClient @class = GoldTree.GetDatabase().GetClient()) { @class.AddParamWithValue("search_query", "%" + string_0 + "%"); if (string_0.Length >= 1) { stringBuilder.Append(" AND public_name LIKE @search_query"); } dataTable = @class.ReadDataTable(string.Concat(new string[] { "SELECT offer_id, item_type, sprite_id, total_price FROM catalog_marketplace_offers ", stringBuilder.ToString(), " ", text, " LIMIT 500" })); } ServerMessage Message = new ServerMessage(615u); this.list_1.Clear(); this.list_0.Clear(); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { if (!this.list_0.Contains((uint)dataRow["offer_id"])) { MarketplaceOffers item = new MarketplaceOffers((uint)dataRow["offer_id"], (int)dataRow["sprite_id"], (int)dataRow["total_price"], int.Parse(dataRow["item_type"].ToString())); this.list_0.Add((uint)dataRow["offer_id"]); this.list_1.Add(item); } } return(this.method_6(int_0, int_1)); } else { Message.AppendInt32(0); return(Message); } }
public ServerMessage method_5(int int_0, int int_1, string string_0, int int_2) { DataTable dataTable = null; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("WHERE state = '1' AND timestamp >= " + this.method_4()); if (int_0 >= 0) { stringBuilder.Append(" AND total_price > " + int_0); } if (int_1 >= 0) { stringBuilder.Append(" AND total_price < " + int_1); } string text; switch (int_2) { case 1: text = "ORDER BY asking_price DESC"; goto IL_82; } text = "ORDER BY asking_price ASC"; IL_82: using (DatabaseClient @class = GoldTree.GetDatabase().GetClient()) { @class.AddParamWithValue("search_query", "%" + string_0 + "%"); if (string_0.Length >= 1) { stringBuilder.Append(" AND public_name LIKE @search_query"); } dataTable = @class.ReadDataTable(string.Concat(new string[] { "SELECT offer_id, item_type, sprite_id, total_price FROM catalog_marketplace_offers ", stringBuilder.ToString(), " ", text, " LIMIT 500" })); } ServerMessage Message = new ServerMessage(615u); this.list_1.Clear(); this.list_0.Clear(); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { if (!this.list_0.Contains((uint)dataRow["offer_id"])) { MarketplaceOffers item = new MarketplaceOffers((uint)dataRow["offer_id"], (int)dataRow["sprite_id"], (int)dataRow["total_price"], int.Parse(dataRow["item_type"].ToString())); this.list_0.Add((uint)dataRow["offer_id"]); this.list_1.Add(item); } } return this.method_6(int_0, int_1); } else { Message.AppendInt32(0); return Message; } }