private void comboBoxIdEks_TextChanged(object sender, EventArgs e) { string hasilBaca2 = Ekspedisi.BacaData("idEkspedisi", comboBoxIdEks.Text, listHasilEkspedisi); if (hasilBaca2 == "1") { textBoxNamaEks.Clear(); for (int i = 0; i < listHasilEkspedisi.Count; i++) { textBoxNamaEks.Text = listHasilEkspedisi[i].Nama; } } else { textBoxNamaEks.Clear(); } }
private void FormTambahPengiriman_Load(object sender, EventArgs e) { comboBoxJenisPengiriman.Items.AddRange(new string[] { "Shipping Point", "Destination Point" }); string noNotaBaru; textBoxNamaEks.Enabled = false; textBoxKodePengiriman.Enabled = false; dateTimePickerKirim.Enabled = false; dateTimePickerKirim.Value = DateTime.Now; comboBoxNoNotaJual.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxIdEks.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxJenisPengiriman.DropDownStyle = ComboBoxStyle.DropDownList; string hasilGenerate = Pengiriman.GenerateNoNota(out noNotaBaru); textBoxKodePengiriman.Clear(); if (hasilGenerate == "1") { textBoxKodePengiriman.Text = noNotaBaru; } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } string hasilBaca = NotaPenjualan.BacaData("", "", listHasilNota); if (hasilBaca == "1") { comboBoxNoNotaJual.Items.Clear(); for (int i = 0; i < listHasilNota.Count; i++) { comboBoxNoNotaJual.Items.Add(listHasilNota[i].NoNotaPenjualan); } } else { comboBoxNoNotaJual.Items.Clear(); } string hasilBaca2 = Ekspedisi.BacaData("", "", listHasilEkspedisi); if (hasilBaca2 == "1") { comboBoxIdEks.Items.Clear(); for (int i = 0; i < listHasilEkspedisi.Count; i++) { comboBoxIdEks.Items.Add(listHasilEkspedisi[i].IdEkspedisi); textBoxNamaEks.Text = listHasilEkspedisi[i].Nama; } } else { comboBoxIdEks.Items.Clear(); } if (comboBoxNoNotaJual.Items.Count != 0) { comboBoxNoNotaJual.SelectedIndex = 0; } if (comboBoxIdEks.Items.Count != 0) { comboBoxIdEks.SelectedIndex = 0; } if (comboBoxJenisPengiriman.Items.Count != 0) { comboBoxJenisPengiriman.SelectedIndex = 0; } FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }