private void comboBoxNoNotaJual_SelectedIndexChanged(object sender, EventArgs e) { listHasilData.Clear(); string hasilBaca = NotaPenjualan.BacaDataPelunasan("noNotaPenjualan", comboBoxNoNotaJual.Text, listHasilData2); if (hasilBaca == "1") { textBoxNominal.Clear(); if (listHasilData2.Count > 0) { textBoxNominal.Text = listHasilData2[0].TotalHarga.ToString(); btsDiskon = listHasilData2[0].TglBatasDiskon; // diskon = listHasilData2[0].Diskon; //untuk mendapatkan diskon if (diskon > 0) // apabila terdapat diskon, maka tampilkan info diskon dan batas diskon { MessageBox.Show("Pembeli mendapatkan diskon " + diskon + "%, apabila membayar sebelum atau tanggal : " + btsDiskon.ToString("dddd, dd MMMM yyyy"), "Info Diskon"); } else //apabila ada diskon { MessageBox.Show("Tidak ada diskon untuk pembeli", "Info Diskon"); } } } else { textBoxNominal.Clear(); } }
private void FormTambahPenerimaanPembayaran_Load(object sender, EventArgs e) { string noNotaBaru; pPeriode = Periode.GetPeriodeTerbaru(); comboBoxNoNotaJual.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCaraPemb.DropDownStyle = ComboBoxStyle.DropDownList; string hasilGenerate = Pelunasan.GenerateNoNota(out noNotaBaru); textBoxNoPelunasan.Clear(); if (hasilGenerate == "1") { textBoxNoPelunasan.Text = noNotaBaru; } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerTgl.Value = DateTime.Now; dateTimePickerTgl.Enabled = false; string hasilBaca = NotaPenjualan.BacaDataPelunasan("", "", listHasilData2); if (hasilBaca == "1") { comboBoxNoNotaJual.Items.Clear(); for (int i = 0; i < listHasilData2.Count; i++) { comboBoxNoNotaJual.Items.Add(listHasilData2[i].NoNotaPenjualan); } } else { comboBoxNoNotaJual.Items.Clear(); } comboBoxCaraPemb.SelectedIndex = 0; }