public Main() { InitializeComponent(); FormClosing += (s, e) => { if (!openOther) { Application.Exit(); } }; api = new SMM(Properties.Settings.Default.API_URL, Properties.Settings.Default.API_KEY); orders = new SMM.OrderList(Properties.Settings.Default.ORDER_LIST); UpdateBalance(); UpdateOrders(); if (Properties.Settings.Default.BALANCE_AUTO_UPDATE) { timerBalanceUpdate.Interval = Properties.Settings.Default.BALANCE_UPDATE_INTERVAL * 1000; timerBalanceUpdate.Start(); } panels = new List <Panel>(); panels.Add(pnlInstagramFollowers); panels.Add(pnlInstagramFollowers); panels.Add(pnlInstagramLikes); panels.Add(pnlYoutubeLikes); panels.Add(pnlYoutubeDislikes); foreach (Panel p in panels) { p.Visible = false; } cmbService.SelectedIndex = 0; }
private void Shutdown() { if (instance != null) { instance = null; } }
public OrderInfo(SMM api, SMM.Order order) { InitializeComponent(); this.api = api; this.order = order; //this.Text += order.GetID(); UpdateForm(); }
public bool UpdateData(SMM api) { try { NameValueCollection values = new NameValueCollection(); values["order"] = Convert.ToString(id); string response = api.API_POST("status", values); dynamic data = JsonConvert.DeserializeObject(response); charge = Math.Round(Decimal.Parse(Convert.ToString(data.charge)), 2); start_count = Convert.ToInt32(Convert.ToString(data.start_count)); completed = Convert.ToString(data.status) == "Completed"; remains = Convert.ToInt32(Convert.ToString(data.remains)); last_update = SMM.CurrentTimestamp(); update_time = last_update + 60; // require update every minute return(true); } catch (Exception) { return(false); } }
private void btnHesapla_Click(object sender, EventArgs e) { try { SMM smm = new SMM(Double.Parse(tbTutar.Text)); tbBrut.Text = smm.brutTutar().ToString("#.##"); tbKdv.Text = smm.kdv().ToString("#.##"); tbStopaj.Text = smm.stopaj().ToString("#.##"); tbKesinti.Text = smm.kesintiToplam().ToString("#.##"); tbNetOdenen.Text = smm.netUcret().ToString("#.##"); } catch (Exception exception) { MessageBox.Show("Bu alan boş bırakılamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); tbTutar.Focus(); } }
public bool UpdateRequired() { return(SMM.CurrentTimestamp() > update_time); }