private void FormTambahNotaJual_Load(object sender, EventArgs e) { comboBoxStatus.Items.AddRange(new string[] { "L", "P" }); this.Location = new Point(500, 26); FormatDataGrid(); pPeriode = Periode.GetPeriodeTerbaru(); textBoxKode.MaxLength = 5; textBoxNo.Enabled = false; textBoxAlamat.Enabled = false; comboBoxPelanggan.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList; string noNotaBaru; string hasilGenerate = NotaPenjualan.GenerateNoNota(out noNotaBaru); textBoxNo.Clear(); if (hasilGenerate == "1") { textBoxNo.Text = noNotaBaru; textBoxKode.Focus(); } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerTanggalJual.Value = DateTime.Now; dateTimePickerTanggalJual.Enabled = false; string hasilBaca = Pelanggan.BacaData("", "", listHasilData); if (hasilBaca == "1") { comboBoxPelanggan.Items.Clear(); for (int i = 0; i < listHasilData.Count; i++) { comboBoxPelanggan.Items.Add(listHasilData[i].IdPelanggan + " - " + listHasilData[i].Nama); } } else { comboBoxPelanggan.Items.Clear(); } if (comboBoxPelanggan.Items.Count != 0) { comboBoxPelanggan.SelectedIndex = 0; } if (comboBoxStatus.Items.Count != 0) { comboBoxStatus.SelectedIndex = 0; } FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }
private void FormTambahSuratJalan_Load(object sender, EventArgs e) { comboBoxJenis.Items.AddRange(new string[] { "Masuk", "Keluar" }); this.Location = new Point(500, 26); FormatDataGrid(); pPeriode = Periode.GetPeriodeTerbaru(); textBoxKode.MaxLength = 5; textBoxNoSurat.Enabled = false; comboBoxSuratPermintaan.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxJenis.DropDownStyle = ComboBoxStyle.DropDownList; string noSuratBaru; string hasilGenerate = SuratJalan.GenerateNoSuratJalan(out noSuratBaru); textBoxNoSurat.Clear(); if (hasilGenerate == "1") { textBoxNoSurat.Text = noSuratBaru; } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerTgl.Value = DateTime.Now; dateTimePickerTgl.Enabled = false; string hasilBaca = SuratPermintaan.BacaData("JO.status", "P", listHasilSuratPer); if (hasilBaca == "1") { comboBoxSuratPermintaan.Items.Clear(); for (int i = 0; i < listHasilSuratPer.Count; i++) { comboBoxSuratPermintaan.Items.Add(listHasilSuratPer[i].NoSuratPermintaan); } } else { comboBoxSuratPermintaan.Items.Clear(); } if (comboBoxSuratPermintaan.Items.Count != 0) { comboBoxSuratPermintaan.SelectedIndex = 0; } comboBoxJenis.SelectedIndex = 1; FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }
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; }
private void FormTambahBarang_Load(object sender, EventArgs e) { comboBoxSatuan.Items.AddRange(new string[] { "Unit", "Jam" }); this.Location = new Point(500, 26); FormatDataGrid(); pPeriode = Periode.GetPeriodeTerbaru(); textBoxIdKaryawan.MaxLength = 1; textBoxKodeJobOrder.Enabled = false; comboBoxItem.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxNoNotaJual.DropDownStyle = ComboBoxStyle.DropDownList; string KodeJobBaru; string hasilGenerate = JobOrder.GenerateKodeJobOrder(out KodeJobBaru); textBoxKodeJobOrder.Clear(); if (hasilGenerate == "1") { textBoxKodeJobOrder.Text = KodeJobBaru; comboBoxNoNotaJual.Focus(); } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerSelesai.Value = DateTime.Now; dateTimePickerMulai.Value = DateTime.Now; dateTimePickerMulai.Enabled = false; textBoxSatuan.Enabled = false; string hasilBaca = Barang.BacaData("jenis", "BJ", listHasilBarang); // untuk mendapatkan nama barang, kode dan menampilkan di comboboxitems if (hasilBaca == "1") { comboBoxItem.Items.Clear(); for (int i = 0; i < listHasilBarang.Count; i++) { comboBoxItem.Items.Add(listHasilBarang[i].KodeBarang + " - " + listHasilBarang[i].Nama); } } else { comboBoxItem.Items.Clear(); } string hasilBaca2 = NotaPenjualan.BacaData("", "", listHasilNotaPenjualan); // tampilkan ke combobox nonotapenjualan if (hasilBaca2 == "1") { comboBoxNoNotaJual.Items.Clear(); for (int i = 0; i < listHasilNotaPenjualan.Count; i++) { comboBoxNoNotaJual.Items.Add(listHasilNotaPenjualan[i].NoNotaPenjualan); } } else { comboBoxNoNotaJual.Items.Clear(); } if (comboBoxNoNotaJual.Items.Count != 0) { comboBoxNoNotaJual.SelectedIndex = 0; } comboBoxItem.SelectedIndex = 0; FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }