コード例 #1
0
ファイル: Main.cs プロジェクト: ooojustin/justinMedia-SMM-API
 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;
 }
コード例 #2
0
 private void Shutdown()
 {
     if (instance != null)
     {
         instance = null;
     }
 }
コード例 #3
0
 public OrderInfo(SMM api, SMM.Order order)
 {
     InitializeComponent();
     this.api   = api;
     this.order = order;
     //this.Text += order.GetID();
     UpdateForm();
 }
コード例 #4
0
 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); }
 }
コード例 #5
0
 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();
     }
 }
コード例 #6
0
 public bool UpdateRequired()
 {
     return(SMM.CurrentTimestamp() > update_time);
 }