Exemplo n.º 1
0
 private void buttonUpdateGroup_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
     {
         if (objJsonInventoryResult.ui_real_instance == dataGridView1.Rows[i].Cells["ui_real_instance"].Value.ToString() &&
             objJsonInventoryResult.i_classid == dataGridView1.Rows[i].Cells["i_classid"].Value.ToString())
         {
             Info.GetUrl(csgo_setPrice + dataGridView1.Rows[i].Cells["ui_id"].Value + @"/" + textBoxPrice.Text + @"/?key=" + keyMarket);
         }
     }
     dataGridView1.DataSource = Info.GetUrlJSONInventorylist(csgo_trades + keyMarket);
     FormsLogic.DeleteColumns(ref dataGridView1, badMarketColumns);
 }
Exemplo n.º 2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            Info.GetUrl(csgo_setPrice + objJsonInventoryResult.ui_id + @"/" + textBoxPrice.Text + @"/?key=" + keyMarket);
            marketItems = new BindingList <JsonInventoryResult>();
            var temp = Info.GetUrlJSONInventorylist(csgo_trades + keyMarket);

            foreach (var item in temp)
            {
                marketItems.Add(item);
            }
            dataGridView1.DataSource = marketItems;
            FormsLogic.DeleteColumns(ref dataGridView1, badMarketColumns);
        }
Exemplo n.º 3
0
        void statisticOld()
        {
            popularSteamItems = SetSteamPopularData(0);
            List <JsonResult> history = Info.GetUrlJSONlist(csgo_history);

            history.Distinct();
            dataGridViewStatisticMarket.DataSource = history;
            List <string> columnsNames = new List <string>()
            {
                "average_price",
                "median_price",
                "highest_price",
                "lowest_price",
                "hash",
                "rank"
            };

            FormsLogic.AddColumns(ref dataGridViewStatisticMarket, columnsNames);
            for (int i = 0; i < dataGridViewStatisticMarket.RowCount; i++)
            {
                MarketItemInfo marketInfo = Info.GetMarketItemInfo(csgo_itemInfo + dataGridViewStatisticMarket.Rows[i].Cells["classid"].Value + "_"
                                                                   + dataGridViewStatisticMarket.Rows[i].Cells["instanceid"].Value + "/ru/?key=" + keyMarket);
                foreach (SteamPopularItem item in popularSteamItems)
                {
                    if (item.market_hash_name == marketInfo.market_hash_name)
                    {
                        dataGridViewStatisticMarket.Rows[i].Cells["rank"].Value = item.rank.ToString();
                    }
                }
                //if (name.Contains("™") || name.Contains("★"))
                //    name = Regex.Replace(name, "[^\x0d\x0a\x20-\x7e\t]", "");
                //if (name.Contains("StatTrak"))
                //    name = Regex.Replace(name, "StatTrak", "");
                //     SteamApiItemCS steamInfo = Info.GetApiItemCS(@"http://csgobackpack.net/api/GetItemPrice/?currency=RUB&id=" + marketInfo.market_hash_name + "&time=7&icon=1");//Info.GetSteamApiItem(@"http://api.csgo.steamlytics.xyz/v1/prices/" + marketInfo.market_hash_name + "?key=8754a7606d6b00db0cc9ce1dee003256");
                //dataGridViewStatisticMarket.Rows[i].Cells["average_price"].Value = steamInfo.average_price;
                //dataGridViewStatisticMarket.Rows[i].Cells["median_price"].Value = steamInfo.median_price;
                //dataGridViewStatisticMarket.Rows[i].Cells["highest_price"].Value = steamInfo.highest_price;
                //dataGridViewStatisticMarket.Rows[i].Cells["lowest_price"].Value = steamInfo.lowest_price;
                dataGridViewStatisticMarket.Rows[i].Cells["hash"].Value = marketInfo.hash;
                // Thread.Sleep(10500);
            }
        }
Exemplo n.º 4
0
 private void dataGridView1_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     //foreach (var prop in GetType().GetProperties())
     if (currentColumnIndex == e.ColumnIndex)
     {
         marketItems = new BindingList <JsonInventoryResult>(marketItems.OrderByDescending(
                                                                 x => x.GetType().GetProperty(dataGridView1.Columns[e.ColumnIndex].Name).GetValue(x, null)
                                                                 ).ToList());
         currentColumnIndex = 0;
     }
     else
     {
         marketItems = new BindingList <JsonInventoryResult>(marketItems.OrderBy(
                                                                 x => x.GetType().GetProperty(dataGridView1.Columns[e.ColumnIndex].Name).GetValue(x, null)
                                                                 ).ToList());
         currentColumnIndex = e.ColumnIndex;
     }
     dataGridView1.DataSource = marketItems;
     FormsLogic.DeleteColumns(ref dataGridView1, badMarketColumns);
 }
Exemplo n.º 5
0
        public void SetDataSourceSellItem(DataGridView dataGridViewForSell)
        {
            marketItems = Converter.InventoryListToBindingList(Info.GetUrlJSONInventorylist(csgo_trades + keyMarket));
            var targetListSteam = itemsrgInventory.Select(x =>
                                                          new ItemId()
            {
                classid = x["classid"].ToString(), instanceid = x["instanceid"].ToString()
            }).ToList();
            var targetListMarket = marketItems.Select(x =>
                                                      new ItemId()
            {
                classid = x.i_classid, instanceid = x.ui_real_instance
            }).ToList();
            int count = 0;

            soldSteamItems = SoldItemsFromSteam(targetListSteam, targetListMarket, ref count);
            dataGridViewForSell.DataSource = soldSteamItems;
            labelCount.Text = "Count: " + count.ToString();
            AddParameters(dataGridViewForSell);
            FormsLogic.AddSteamPrices(ref dataGridViewForSell);
            FormsLogic.AddEarnings(ref dataGridViewForSell);
        }
Exemplo n.º 6
0
 private void FormInventory_Load(object sender, EventArgs e)
 {
     SetDataSourse();
     FormsLogic.DeleteColumns(ref dataGridView1, badMarketColumns);
     timerRequest.Start();
 }
Exemplo n.º 7
0
 private void buttonRemoveAll_Click(object sender, EventArgs e)
 {
     Info.GetUrl(csgo_removeAll + keyMarket);
     SetDataSourse();
     FormsLogic.DeleteColumns(ref dataGridView1, badMarketColumns);
 }