public void FormDaftarNotaJual_Load(object sender, EventArgs e)
        {
            comboBoxCari.Items.AddRange(new string[] { "No Nota", "ID Pelanggan", "Nama Pelanggan", "Alamat Pelanggan", "Diskon", "Total Harga", "Batas Pelunasan",
                                                       "Batas Diskon", "Tanggal Penjualan", "Status", "Keterangan" });
            this.Location = new Point(0, 0);
            comboBoxCari.DropDownStyle = ComboBoxStyle.DropDownList;

            FormatDataGrid();

            string hasilBaca = NotaPenjualan.BacaData("", "", listHasilData);

            if (hasilBaca == "1")
            {
                dataGridViewNota.Rows.Clear();

                for (int i = 0; i < listHasilData.Count; i++)
                {
                    string total = listHasilData[i].TotalHarga.ToString("RP 0,###");
                    dataGridViewNota.Rows.Add(listHasilData[i].NoNotaPenjualan, listHasilData[i].Pelanggan.IdPelanggan,
                                              listHasilData[i].Pelanggan.Nama, listHasilData[i].Pelanggan.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglJual.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status, listHasilData[i].Keterangan);
                }
            }
        }
        private void comboBoxCari_TextChanged(object sender, EventArgs e)
        {
            string hasilBaca = NotaPenjualan.BacaData("", "", listHasilData);

            textBoxCari.Clear();
            if (hasilBaca == "1")
            {
                dataGridViewNota.Rows.Clear();

                for (int i = 0; i < listHasilData.Count; i++)
                {
                    string total = listHasilData[i].TotalHarga.ToString("RP 0,###");
                    dataGridViewNota.Rows.Add(listHasilData[i].NoNotaPenjualan, listHasilData[i].Pelanggan.IdPelanggan,
                                              listHasilData[i].Pelanggan.Nama, listHasilData[i].Pelanggan.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglJual.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status, listHasilData[i].Keterangan);
                }
            }
        }
        private void buttonCari_Click(object sender, EventArgs e)
        {
            string nilaiKriteria = textBoxCari.Text;

            if (comboBoxCari.Text == "No Nota")
            {
                kriteria = "NoNotaPenjualan";
            }
            else if (comboBoxCari.Text == "ID Pelanggan")
            {
                kriteria = "idPelanggan";
            }
            else if (comboBoxCari.Text == "Nama Pelanggan")
            {
                kriteria = "namapelanggan";
            }
            else if (comboBoxCari.Text == "Alamat Pelanggan")
            {
                kriteria = "alamatpelanggan";
            }
            else if (comboBoxCari.Text == "Diskon")
            {
                kriteria = "diskon";
            }
            else if (comboBoxCari.Text == "Total Harga")
            {
                kriteria = "totalHarga";
            }
            else if (comboBoxCari.Text == "Batas Pelunasan")
            {
                kriteria = "tglBatasPelunasan";
            }
            else if (comboBoxCari.Text == "Batas Diskon")
            {
                kriteria = "tglBatasDiskon";
            }
            else if (comboBoxCari.Text == "Tanggal Penjualan")
            {
                kriteria = "tglJual";
            }
            else if (comboBoxCari.Text == "Status")
            {
                kriteria = "status";
            }
            else if (comboBoxCari.Text == "Keterangan")
            {
                kriteria = "keterangan";
            }


            string hasilBaca = NotaPenjualan.BacaData(kriteria, nilaiKriteria, listHasilData);

            if (hasilBaca == "1")
            {
                dataGridViewNota.Rows.Clear();

                for (int i = 0; i < listHasilData.Count; i++)
                {
                    string total = listHasilData[i].TotalHarga.ToString("RP 0,###");
                    dataGridViewNota.Rows.Add(listHasilData[i].NoNotaPenjualan, listHasilData[i].Pelanggan.IdPelanggan,
                                              listHasilData[i].Pelanggan.Nama, listHasilData[i].Pelanggan.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglJual.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status, listHasilData[i].Keterangan);
                }
            }
        }
Ejemplo n.º 4
0
        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;
        }
        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;
        }