private void comboBoxSupplier_SelectedIndexChanged(object sender, EventArgs e)
        {
            string kdSupplier = comboBoxSupplier.Text.Substring(0, 1);

            DaftarSupplier daftarSp = new DaftarSupplier();

            daftarSp.CariData("KodeSupplier", kdSupplier);
            textBoxAlamat.Text = daftarSp.ListSupplier[0].AlamatSupplier;
        }
        private void FormTambahNotaBeli_Load(object sender, EventArgs e)
        {
            DaftarNotaBeli daftar = new DaftarNotaBeli();
            string         hasil  = daftar.GenerateNoNota();

            if (hasil == "sukses")
            {
                textBoxNoNota.Text    = daftar.NoNotaTerbaru;
                textBoxNoNota.Enabled = false;
            }
            else
            {
                MessageBox.Show("Generate Kode gagal dilakukan. Pesan Kesalahan= " + hasil);
            }

            dateTimePickerTanggal.Value   = DateTime.Now;
            dateTimePickerTanggal.Enabled = false;

            comboBoxSupplier.DropDownStyle = ComboBoxStyle.DropDownList;
            DaftarSupplier daftarSp = new DaftarSupplier();

            hasil = daftarSp.BacaSemuaData();
            if (hasil == "sukses")
            {
                comboBoxSupplier.Items.Clear();
                for (int i = 0; i < daftarSp.JumlahSupplier; i++)
                {
                    comboBoxSupplier.Items.Add(daftarSp.ListSupplier[i].KodeSupplier + " - " + daftarSp.ListSupplier[i].NamaSupplier);
                    textBoxAlamat.Text = daftarSp.ListSupplier[i].AlamatSupplier;
                }
                comboBoxSupplier.SelectedIndex = 0;
            }
            else
            {
                MessageBox.Show("Data Pelanggan gagal ditampilkan di combobox. Pesan kesalahan " + hasil);
            }

            FormUtama frmUtama = (FormUtama)this.Owner.MdiParent;

            labelKodePegawai.Text = frmUtama.labelKodePegawai.Text;
            labelNamaPegawai.Text = frmUtama.labelNamaPegawai.Text;

            FormatDataGrid();

            textBoxKodeBarang.MaxLength       = 5;
            textBoxKodeBarang.CharacterCasing = CharacterCasing.Upper;
        }