Exemple #1
0
        private void LoadBots()
        {
            int sel = CmbBots.SelectedIndex;

            CmbBots.DataSource    = SBots.GetSemuaBot();
            CmbBots.SelectedIndex = sel;
        }
Exemple #2
0
 private void LoadBot()
 {
     if (!string.IsNullOrEmpty(CmbBots.Text))
     {
         TbxToken.Text      = SBots.GetBots(CmbBots.Text.Trim())[0].Token;
         TbxUri.Text        = SBots.GetBots(CmbBots.Text.Trim())[0].UriClean;
         TbxUriDefault.Text = SBots.GetBots(CmbBots.Text.Trim())[0].UriCurrent;
         Pengaturan.Tulis("BotTerpilih", CmbBots.SelectedIndex.ToString());
     }
 }
Exemple #3
0
 private void BtnHapusBot_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(CmbBots.Text))
     {
         SBots.HapusBot(CmbBots.Text);
         tsLStatus.Text = "Berhasil hapus Bot..";
         LoadBots();
     }
     else
     {
         tsLStatus.Text = "Pilih Bot yg mau di Hapus..";
     }
 }
Exemple #4
0
        private void BtnSimpanBot_Click(object sender, EventArgs e)
        {
            var data = new List <TelegramBot>
            {
                new TelegramBot
                {
                    Token      = TbxToken.Text.Trim(),
                    UriClean   = TbxUri.Text.Trim(),
                    UriCurrent = TbxUriDefault.Text.Trim()
                }
            };

            SBots.TambahBot(CmbBots.Text.Trim(), data);
            LoadBots();
            tsLStatus.Text = "Berhasil menambahkan Bot..";
        }