private void addTabItem(string link, string price, string tabId, string imgLink) { if (tabId == string.Empty) tabControl1.TabPages.Add("Item " + (tabControl1.TabCount + 1).ToString()); else tabControl1.TabPages.Add(tabId); ScanItem scanIt = new ScanItem(); scanIt.Height = tabControl1.Height - 20; scanIt.Width = tabControl1.Width - 5; scanIt.Anchor = (AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left); tabControl1.TabPages[tabControl1.TabCount - 1].Controls.Add(scanIt); scanIt.linkValue = link; scanIt.wishedValue = price; scanIt.ImgLink = imgLink; scanIt.ButtonClick += new EventHandler(ScanItemButton_Click); ScanItLst.Add(scanIt); SteamSite ScanSite = new SteamSite(); ScanSite.delegMessage += new eventDelegate(Event_Message); ScanSite.cookieCont = steam_srch.cookieCont; SteamLst.Add(ScanSite); }
public int BuyLogic(int wished, string sessid, ScanItem ourItem, saveTab Input, int buyCont, bool ismain) { int total = ourItem.Price + ourItem.Fee; string totalStr = total.ToString(); if (total <= wished) { if ((Input.ToBuy) && (Main.walletVal > Main.stopfundsVal)) { var buyresp = BuyItem(cookieCont, sessid, ourItem.ListringId, Input.Link, ourItem.Price.ToString(), ourItem.Fee.ToString(), totalStr); if (buyresp.Succsess) { //Resell if (Input.ResellType != 0) { StartResellThread(totalStr, Input.ResellPrice, ourItem.Type, ourItem.ItemName, Input.ResellType); } doMessage(flag.Success_buy, scanID, buyresp.Mess, ismain); doMessage(flag.Price_btext, scanID, totalStr, ismain); buyCont++; //Bloody hell, you're f****n' genious! if (buyCont == Input.BuyQnt) { Input.ToBuy = false; doMessage(flag.Send_cancel, scanID, string.Empty, ismain); } return buyCont; } else { doMessage(flag.Error_buy, scanID, buyresp.Mess, ismain); } } else doMessage(flag.Price_htext, scanID, totalStr, ismain); } else doMessage(flag.Price_text, scanID, totalStr, ismain); return buyCont; }
public void BuyLogic(int wished, string sessid, ScanItem ourItem, saveTab Input, int buyCont, bool ismain) { int total = ourItem.Price + ourItem.Fee; string totalStr = total.ToString(); string prtoTxt = DoFracture(totalStr); if (total < wished) { if (Input.ToBuy) { var buyresp = BuyItem(cookieCont, sessid, ourItem.ListringId, Input.Link, ourItem.Price.ToString(), ourItem.Fee.ToString(), totalStr); if (buyresp.Succsess) { //Resell if (Input.ResellType != 0) { StartResellThread(totalStr, Input.ResellPrice, ourItem.Type, ourItem.ItemName); } doMessage(flag.Success_buy, scanID, buyresp.Mess, ismain); doMessage(flag.Price_btext, scanID, prtoTxt, ismain); buyCont++; if (buyCont == Input.BuyQnt) { doMessage(flag.Send_cancel, scanID, string.Empty, ismain); } } else { doMessage(flag.Error_buy, scanID, buyresp.Mess, ismain); } } else doMessage(flag.Price_htext, scanID, prtoTxt, ismain); } else doMessage(flag.Price_text, scanID, prtoTxt, ismain); }