private void LoadBots() { int sel = CmbBots.SelectedIndex; CmbBots.DataSource = SBots.GetSemuaBot(); CmbBots.SelectedIndex = sel; }
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()); } }
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.."; } }
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.."; }