Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     listKota   = Ongkir.GetKotaList();
     listKotaId = Ongkir.GetKotaIdList();
     foreach (string kota in listKota)
     {
         tbAsal.AutoCompleteCustomSource.Add(kota);
         tbAsal.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
         tbAsal.AutoCompleteSource = AutoCompleteSource.CustomSource;
         tbTujuan.AutoCompleteCustomSource.Add(kota);
         tbTujuan.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
         tbTujuan.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
 }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (tbAsal.Text != "" || tbTujuan.Text != "" || tbBerat.Text != "")
     {
         string kurir = "";
         if (rbJne.Checked)
         {
             kurir = "jne";
         }
         else if (rbPos.Checked)
         {
             kurir = "pos";
         }
         else if (rbTiki.Checked)
         {
             kurir = "tiki";
         }
         List <string> daftarLayanan = Ongkir.GetLayananList
                                           (GetIdKota(tbAsal.Text), GetIdKota(tbTujuan.Text), int.Parse(tbBerat.Text), kurir);
         TampilkanDaftar(daftarLayanan);
     }
 }