public void FormDaftarNotaBeli_Load(object sender, EventArgs e)
        {
            comboBoxCari.Items.AddRange(new string[] { "No Nota", "ID Supplier", "Nama Supplier", "Alamat Supplier",
                                                       "Diskon", "Total Harga", "Batas Pelunasan",
                                                       "Batas Diskon", "Tanggal Pembelian", "Status", "Keterangan" });

            this.Location = new Point(0, 0);
            comboBoxCari.DropDownStyle = ComboBoxStyle.DropDownList;

            FormatDataGrid();

            string hasilBaca = NotaPembelian.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].NoNotaPembelian, listHasilData[i].Supplier.IdSupplier,
                                              listHasilData[i].Supplier.Nama, listHasilData[i].Supplier.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBeli.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status, listHasilData[i].Keterangan);
                }
            }
        }
Example #2
0
        private void FormTambahPenerimaan_Load(object sender, EventArgs e)
        {
            comboBoxJenisPengiriman.Items.AddRange(new string[] { "Shipping Point", "Destination Point" });
            string noNotaBaru;

            textBoxIdPengiriman.Enabled           = false;
            dateTimePickerTerima.Enabled          = false;
            dateTimePickerTerima.Value            = DateTime.Now;
            comboBoxNoNotaBeli.DropDownStyle      = ComboBoxStyle.DropDownList;
            comboBoxJenisPengiriman.DropDownStyle = ComboBoxStyle.DropDownList;

            string hasilGenerate = Penerimaan.GenerateNoNota(out noNotaBaru);

            textBoxIdPengiriman.Clear();
            if (hasilGenerate == "1")
            {
                textBoxIdPengiriman.Text = noNotaBaru;
            }
            else
            {
                MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate);
            }

            string hasilBaca = NotaPembelian.BacaData("", "", listHasilNota);

            if (hasilBaca == "1")
            {
                comboBoxNoNotaBeli.Items.Clear();
                for (int i = 0; i < listHasilNota.Count; i++)
                {
                    comboBoxNoNotaBeli.Items.Add(listHasilNota[i].NoNotaPembelian);
                }
            }
            else
            {
                comboBoxNoNotaBeli.Items.Clear();
            }

            if (comboBoxNoNotaBeli.Items.Count != 0)
            {
                comboBoxNoNotaBeli.SelectedIndex = 0;
            }
            comboBoxJenisPengiriman.SelectedIndex = 0;

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

            labelKodePgw.Text = form.labelKodePgw.Text;
            labelNamaPgw.Text = form.labelNamaPgw.Text;
        }
        private void comboBoxCari_TextChanged(object sender, EventArgs e)
        {
            string hasilBaca = NotaPembelian.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].NoNotaPembelian, listHasilData[i].Supplier.IdSupplier,
                                              listHasilData[i].Supplier.Nama, listHasilData[i].Supplier.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBeli.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 = "noNotaPembelian";
            }
            else if (comboBoxCari.Text == "ID Supplier")
            {
                kriteria = "idSupplier";
            }
            else if (comboBoxCari.Text == "Nama Supplier")
            {
                kriteria = "namaSupplier";
            }
            else if (comboBoxCari.Text == "Alamat Supplier")
            {
                kriteria = "alamatSupplier";
            }
            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 Pembelian")
            {
                kriteria = "tglBeli";
            }
            else if (comboBoxCari.Text == "Status")
            {
                kriteria = "status";
            }
            else if (comboBoxCari.Text == "Keterangan")
            {
                kriteria = "keterangan";
            }


            string hasilBaca = NotaPembelian.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].NoNotaPembelian, listHasilData[i].Supplier.IdSupplier,
                                              listHasilData[i].Supplier.Nama, listHasilData[i].Supplier.Alamat, listHasilData[i].Diskon,
                                              total, listHasilData[i].TglBatasPelunasan.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBatasDiskon.ToString("dddd, dd MMMM yyyy"),
                                              listHasilData[i].TglBeli.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status, listHasilData[i].Keterangan);
                }
            }
        }