private void FormTambahJadwal_Load(object sender, EventArgs e)
        {
            string codebaru;
            string hasilgen = Jadwal.GenerateCode(out codebaru);

            if (hasilgen == "1")
            {
                textBoXid.Text    = codebaru;
                textBoXid.Enabled = false;
            }
            else
            {
                MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilgen);
            }
            listhasildata.Clear();
            string hasilBaca1 = Spk.BacaData("", "", listhasildata);

            if (hasilBaca1 == "1")
            {
                comboBoxSPK.Items.Clear();
                for (int i = 0; i < listhasildata.Count; i++)
                {
                    comboBoxSPK.Items.Add(listhasildata[i].NoSPK);
                }
            }
            else
            {
                MessageBox.Show("Data SPK gagal ditampilkan. Pesan kesalahan: " + hasilBaca1);
            }
        }
Beispiel #2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            listBahanBaku.Clear();
            listSpk.Clear();
            listBom.Clear();
            Barang b = listBarang[comboBox1.SelectedIndex];

            comboBoxBahanBaku.Items.Clear();
            string hasilBom = BOM.BacaData("kode_barang", b.Kode, listBom);

            if (hasilBom == "1")
            {
                for (int i = 0; i < listBom.Count; i++)
                {
                    List <BahanBaku> lbb        = new List <BahanBaku>();
                    string           hasilBahan = BahanBaku.BacaData("BB.Id", listBom[i].IdbahanBaku, lbb);
                    comboBoxBahanBaku.Items.Add(lbb[0].Id + " - " + lbb[0].Nama);
                    listBahanBaku.Add(lbb[0]);
                }
            }
            comboBoxSpk.Items.Clear();
            string hasil = Spk.BacaData("kode_barang", b.Kode, listSpk);

            if (hasil == "1")
            {
                for (int i = 0; i < listSpk.Count; i++)
                {
                    comboBoxSpk.Items.Add(listSpk[i].NoSPK + " - " + listSpk[i].IdPekerja.Nama);
                }
                comboBoxSpk.Enabled       = true;
                comboBoxBahanBaku.Text    = "";
                comboBoxBahanBaku.Enabled = false;
            }
        }
        private void textBoxCari_TextChanged(object sender, EventArgs e)
        {
            string kriteria = "";

            if (comboBoxCari.Text == "No SPK")
            {
                kriteria = "S.nomor";
            }
            else if (comboBoxCari.Text == "Barang")
            {
                kriteria = "B.nama";
            }

            // Kosongi isi list
            listHasilData.Clear();

            // Tampilkan data kategori sesuai kriteria
            string hasilBaca = Spk.BacaData(kriteria, textBoxCari.Text, listHasilData);

            if (hasilBaca == "1")
            {
                dataGridViewJabatan.DataSource = null;
                dataGridViewJabatan.DataSource = listHasilData;
            }
        }
        private void FormPengiriman_Load(object sender, EventArgs e)
        {
            listDataSPK.Clear();
            string hasilBaca = Spk.BacaData("", "", listDataSPK);

            if (hasilBaca == "1")
            {
                comboBoxSPK.Items.Clear();
                for (int i = 0; i < listDataSPK.Count; i++)
                {
                    comboBoxSPK.Items.Add(listDataSPK[i].NoSPK);
                }
            }
            else
            {
                MessageBox.Show("Data Jabatan gagal ditampilkan. Pesan kesalahan: " + hasilBaca);
            }
        }
        private void FormUbahJadwal_Load(object sender, EventArgs e)
        {
            hasildataspk.Clear();
            string hasilBaca1 = Spk.BacaData("", "", hasildataspk);

            if (hasilBaca1 == "1")
            {
                comboBoxSPK.Items.Clear();
                for (int i = 0; i < hasildataspk.Count; i++)
                {
                    comboBoxSPK.Items.Add(hasildataspk[i].NoSPK);
                }
            }
            else
            {
                MessageBox.Show("Data SPK gagal ditampilkan. Pesan kesalahan: " + hasilBaca1);
            }
        }
        public void FormDaftarSPK_Load(object sender, EventArgs e)
        {
            listHasilData.Clear();
            FormatDataGrid();

            listHasilData.Clear();
            string hasilBaca = Spk.BacaData("", "", listHasilData);

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

                for (int i = 0; i < listHasilData.Count; i++)
                {
                    dataGridViewJabatan.Rows.Add(listHasilData[i].NoSPK, listHasilData[i].Tanggal.ToShortDateString(), listHasilData[i].Brg.Nama
                                                 , listHasilData[i].IdPekerja.Nama, listHasilData[i].Pekerjaan, listHasilData[i].Lokasi, listHasilData[i].LamaPengerjaan + " Hari",
                                                 listHasilData[i].Biaya, listHasilData[i].Syarat, listHasilData[i].Metode);
                }
            }
        }
Beispiel #7
0
        private void FormTambahProgress_Load(object sender, EventArgs e)
        {
            frmDaftar = (FormDaftarProgress)this.Owner;

            listaftarmesin.Clear();
            listaftarspk.Clear();
            listdaftarpekerja.Clear();

            string bacamesin = Mesin.BacaData("", "", listaftarmesin);

            if (bacamesin == "1")
            {
                comboBoxMesin.Items.Clear();
                for (int i = 0; i < listaftarmesin.Count; i++)
                {
                    comboBoxMesin.Items.Add(listaftarmesin[i].IdMesin + " - " + listaftarmesin[i].Nama);
                }
            }

            string bacaspk = Spk.BacaData("", "", listaftarspk);

            if (bacaspk == "1")
            {
                comboBoxSPK.Items.Clear();
                for (int i = 0; i < listaftarspk.Count; i++)
                {
                    comboBoxSPK.Items.Add(listaftarspk[i].NoSPK);
                }
            }

            string bacapekerja = Pekerja.BacaData("", "", listdaftarpekerja);

            if (bacapekerja == "1")
            {
                comboBoxPekerja.Items.Clear();
                for (int i = 0; i < listdaftarpekerja.Count; i++)
                {
                    comboBoxPekerja.Items.Add(listdaftarpekerja[i].IdPekerja + " - " + listdaftarpekerja[i].Nama);
                }
            }
        }
        public void FormPemesananBahanBaku_Load(object sender, EventArgs e)
        {
            hrg             = 0;
            labelHarga.Text = hrg.ToString();
            dataGridViewBarang.Rows.Clear();
            FormatDataGrid();
            listHasilData.Clear();
            comboBoxID.Items.Clear();
            comboBoxNomorSPK.Items.Clear();
            textBoxsub.Text         = "";
            textBoxharga.Text       = "";
            textBoxjenis.Text       = "";
            textBoxjumlah.Text      = "";
            comboBoxID.Text         = "";
            richTextBoxkete.Text    = "";
            textBoxsub.Enabled      = false;
            textBoxharga.Enabled    = false;
            textBoxjenis.Enabled    = false;
            textBoxjumlah.Enabled   = false;
            richTextBoxkete.Enabled = false;
            string hasil = BahanBaku.BacaData("", "", listHasilData);

            if (hasil == "1")
            {
                for (int i = 0; i < listHasilData.Count; i++)
                {
                    comboBoxID.Items.Add(listHasilData[i].Id + " - " + listHasilData[i].Nama);
                }
            }
            string spk = Spk.BacaData("", "", listspk);

            if (spk == "1")
            {
                for (int i = 0; i < listspk.Count; i++)
                {
                    comboBoxNomorSPK.Items.Add(listspk[i].NoSPK);
                }
            }
        }