public void FormDaftarBOM_Load(object sender, EventArgs e)
        {
            listBOM.Clear();
            FormatDataGrid();
            string hasilBaca = BOM.BacaData("", "", listBOM);

            if (hasilBaca == "1")
            {
                string no      = "";
                int    display = 0;
                string divider = "";
                string tb      = "";
                string bt      = "";
                string bo      = "";
                string bp      = "";
                dataGridViewBahanBaku.DataSource = null;
                for (int i = 0; i < listBOM.Count; i++)
                {
                    listbarang.Clear();
                    if (divider != listBOM[i].Kodebarang)
                    {
                        divider = listBOM[i].Kodebarang;
                        string hasis = Barang.BacaData("kode", listBOM[i].Kodebarang, listbarang);
                        no = listBOM[i].Kodebarang + " - " + listbarang[0].Nama;
                        tb = listBOM[i].TotalBiaya.ToString();
                        bt = listBOM[i].BiayaTukang.ToString();
                        bo = listBOM[i].BiayaOperasional.ToString();
                        bp = listBOM[i].PengajuanHarga.ToString();
                    }
                    else
                    {
                        no = "";
                        tb = "";
                        bt = "";
                        bo = "";
                        bp = "";
                    }

                    divider = listBOM[i].Kodebarang;
                    listBahanBaku.Clear();

                    string hasilbbs = BahanBaku.BacaData("BB.Id", listBOM[i].IdbahanBaku, listBahanBaku);
                    if (hasilbbs == "1")
                    {
                        dataGridViewBahanBaku.Rows.Add(no, listBahanBaku[0].Nama, listBahanBaku[0].Bagian, listBahanBaku[0].UkuranMentah,
                                                       listBahanBaku[0].UkuranLuasan, listBahanBaku[0].UkuranJadi, listBOM[i].JumlahBagian, listBOM[i].JumlahBijiLembarBatang,
                                                       tb, bo, bt, bp);
                    }
                    else
                    {
                        MessageBox.Show("gagal");
                    }
                }
            }
            else
            {
                // Kosongi dataGridView
                dataGridViewBahanBaku.DataSource = null;
            }
        }
Exemplo n.º 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 FormTambahBOM_Load(object sender, EventArgs e)
        {
            try
            {
                frmDaftar = (FormDaftarBOM)this.Owner;
                FormatDataGrid();
                listBahanBaku.Clear();
                listBarang.Clear();
                comboBoxBahan.Items.Clear();
                comboBoxKodeBarang.Items.Clear();
                comboBoxKodeBarang.Enabled = true;
                groupBox1.Enabled          = false;

                numericUpDownBiayaTukang.Value      = 0;
                numericUpDownBiayaOperasional.Value = 0;
                numericUpDownPengajuanHarga.Value   = 0;
                numericUpDownJumlahBagian.Value     = 0;
                numericUpDownJumlahSpesifik.Value   = 0;
                numericUpDownTotalBiaya.Value       = 0;

                numericUpDownBiayaTukang.Enabled      = false;
                numericUpDownBiayaOperasional.Enabled = false;
                numericUpDownPengajuanHarga.Enabled   = false;
                numericUpDownJumlahBagian.Enabled     = false;
                numericUpDownJumlahSpesifik.Enabled   = false;
                numericUpDownTotalBiaya.Enabled       = false;

                string hasil = BahanBaku.BacaData("", "", listBahanBaku);
                if (hasil == "1")
                {
                    for (int i = 0; i < listBahanBaku.Count; i++)
                    {
                        comboBoxBahan.Items.Add(listBahanBaku[i].Id + " - " + listBahanBaku[i].Nama);
                    }
                }
                else
                {
                    MessageBox.Show(hasil, "Error");
                }
                string hasil1 = Barang.BacaData("", "", listBarang);
                if (hasil1 == "1")
                {
                    for (int i = 0; i < listBarang.Count; i++)
                    {
                        comboBoxKodeBarang.Items.Add(listBarang[i].Kode + " - " + listBarang[i].Nama);
                    }
                }
                else
                {
                    MessageBox.Show(hasil1, "Error");
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Exemplo n.º 4
0
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <BahanBaku> li = new List <BahanBaku>();

            li.Clear();
            string hasil = BahanBaku.BacaData("BB.id", comboBox2.Text, li);

            if (hasil == "1")
            {
                textBoxbahan.Text = li[0].Nama;
            }
        }
        private void textBoxCari_TextChanged(object sender, EventArgs e)
        {
            dataGridViewBahanBaku.DataSource = null;
            dataGridViewBahanBaku.Rows.Clear();
            string kriteria = "kode_barang";

            // Kosongi isi list
            listBOM.Clear();

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

            if (hasilBaca == "1")
            {
                string no      = "";
                int    display = 0;
                string divider = "";


                for (int i = 0; i < listBOM.Count; i++)
                {
                    listbarang.Clear();
                    if (divider != listBOM[i].Kodebarang)
                    {
                        divider = listBOM[i].Kodebarang;
                        string hasis = Barang.BacaData("kode", listBOM[i].Kodebarang, listbarang);
                        no = listBOM[i].Kodebarang + " - " + listbarang[0].Nama;
                    }
                    else
                    {
                        no = "";
                    }

                    divider = listBOM[i].Kodebarang;
                    listBahanBaku.Clear();

                    string hasilbbs = BahanBaku.BacaData("BB.Id", listBOM[i].IdbahanBaku, listBahanBaku);
                    if (hasilbbs == "1")
                    {
                        dataGridViewBahanBaku.Rows.Add(no, listBahanBaku[0].Nama, listBahanBaku[0].Bagian, listBahanBaku[0].UkuranMentah,
                                                       listBahanBaku[0].UkuranLuasan, listBahanBaku[0].UkuranJadi, listBOM[i].JumlahBagian, listBOM[i].JumlahBijiLembarBatang,
                                                       listBOM[i].TotalBiaya, listBOM[i].BiayaOperasional, listBOM[i].BiayaTukang, listBOM[i].PengajuanHarga);
                    }
                    else
                    {
                        MessageBox.Show("gagal");
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void textBoxID_TextChanged(object sender, EventArgs e)
        {
            try
            {
                listHasilData.Clear();
                string hasil = BahanBaku.BacaData("BB.Id", textBoxID.Text, listHasilData);
                if (hasil == "1")
                {
                    textBoxNama.Text               = listHasilData[0].Nama;
                    textBoxBagian.Text             = listHasilData[0].Bagian;
                    numericUpDownHargaSatuan.Value = listHasilData[0].HargaSatuan;
                    numericUpDownStok.Value        = listHasilData[0].Stok;
                    textBoxUkuranJadi.Text         = listHasilData[0].UkuranJadi;
                    textBoxUkuranLuasan.Text       = listHasilData[0].UkuranLuasan;
                    textBoxUkuranMentah.Text       = listHasilData[0].UkuranMentah;
                    if (File.Exists(Application.StartupPath + "\\Images\\BahanBaku\\" + textBoxID.Text + ".jpg"))
                    {
                        Image i = GetCopyImage(Application.StartupPath + "\\Images\\BahanBaku\\" + textBoxID.Text + ".jpg");
                        pictureBox1.BackgroundImage = i;
                    }
                    comboBoxSupplier.Text = listHasilData[0].Supplier.IdSupplier + " - " + listHasilData[0].Supplier.Nama;
                }
                else
                {
                    textBoxID.Text           = "";
                    textBoxNama.Text         = "";
                    textBoxBagian.Text       = "";
                    textBoxUkuranMentah.Text = "";
                    textBoxUkuranLuasan.Text = "";
                    textBoxUkuranJadi.Text   = "";

                    numericUpDownStok.Value   = 0;
                    numericUpDownStok.Enabled = false;

                    numericUpDownHargaSatuan.Value = 0;
                    comboBoxSupplier.SelectedIndex = -1;
                    comboBoxSupplier.Items.Clear();
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Exemplo n.º 7
0
        private void textBoxID_TextChanged(object sender, EventArgs e)
        {
            try
            {
                listHasilData.Clear();
                string hasil = BahanBaku.BacaData("BB.Id", textBoxID.Text, listHasilData);
                if (hasil == "1")
                {
                    textBoxNama.Text               = listHasilData[0].Nama;
                    textBoxBagian.Text             = listHasilData[0].Bagian;
                    numericUpDownHargaSatuan.Value = listHasilData[0].HargaSatuan;
                    numericUpDownStok.Value        = listHasilData[0].Stok;
                    textBoxUkuranJadi.Text         = listHasilData[0].UkuranJadi;
                    textBoxUkuranLuasan.Text       = listHasilData[0].UkuranLuasan;
                    textBoxUkuranMentah.Text       = listHasilData[0].UkuranMentah;
                    if (File.Exists(Application.StartupPath + "\\Images\\BahanBaku\\" + textBoxID.Text + ".jpg"))
                    {
                        pictureBoxGambar.BackgroundImage = new Bitmap(Application.StartupPath + "\\Images\\BahanBaku\\" + textBoxID.Text + ".jpg");
                    }
                    textBoxSupplier.Text = listHasilData[0].Supplier.IdSupplier + " - " + listHasilData[0].Supplier.Nama;
                }
                else
                {
                    textBoxID.Text           = "";
                    textBoxNama.Text         = "";
                    textBoxBagian.Text       = "";
                    textBoxUkuranMentah.Text = "";
                    textBoxUkuranLuasan.Text = "";
                    textBoxUkuranJadi.Text   = "";
                    textBoxSupplier.Text     = "";

                    numericUpDownStok.Value   = 0;
                    numericUpDownStok.Enabled = false;

                    numericUpDownHargaSatuan.Value = 0;
                }
            }
            catch (Exception exc)
            {
            }
        }
        private void textBoxCari_TextChanged(object sender, EventArgs e)
        {
            string kriteria = "";

            if (comboBoxCari.Text == "Id Bahan Baku")
            {
                kriteria = "BB.id";
            }
            else if (comboBoxCari.Text == "Bagian")
            {
                kriteria = "BB.bagian";
            }
            else if (comboBoxCari.Text == "Stok")
            {
                kriteria = "BB.stok";
            }
            else if (comboBoxCari.Text == "Harga")
            {
                kriteria = "BB.harga_satuan";
            }
            else if (comboBoxCari.Text == "Id Supplier")
            {
                kriteria = "S.id";
            }
            else if (comboBoxCari.Text == "Nama Supplier")
            {
                kriteria = "S.Nama";
            }

            listHasilData.Clear();

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

            if (hasilBaca == "1")
            {
                dataGridViewBahanBaku.DataSource = null;
                dataGridViewBahanBaku.DataSource = listHasilData;
            }
        }
        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);
                }
            }
        }
        public void FormDaftarBahanBaku_Load(object sender, EventArgs e)
        {
            try
            {
                FormatDataGrid();

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

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

                    for (int i = 0; i < listHasilData.Count; i++)
                    {
                        if (File.Exists(Application.StartupPath + "\\Images\\BahanBaku\\" + listHasilData[i].Id + ".jpg"))
                        {
                            Image m = GetCopyImage(Application.StartupPath + "\\Images\\BahanBaku\\" + listHasilData[i].Id + ".jpg");
                            dataGridViewBahanBaku.Rows.Add(listHasilData[i].Id, listHasilData[i].Nama, m,
                                                           listHasilData[i].Bagian, listHasilData[i].UkuranMentah, listHasilData[i].UkuranLuasan, listHasilData[i].UkuranJadi,
                                                           listHasilData[i].Stok, listHasilData[i].HargaSatuan, listHasilData[i].Supplier.IdSupplier, listHasilData[i].Supplier.Nama);
                        }
                        else
                        {
                            dataGridViewBahanBaku.Rows.Add(listHasilData[i].Id, listHasilData[i].Nama, null, listHasilData[i].Bagian,
                                                           listHasilData[i].UkuranMentah, listHasilData[i].UkuranLuasan, listHasilData[i].UkuranJadi,
                                                           listHasilData[i].Stok, listHasilData[i].HargaSatuan, listHasilData[i].Supplier.IdSupplier, listHasilData[i].Supplier.Nama);
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Exemplo n.º 11
0
        public void getNotif()
        {
            listBahanBaku.Clear();

            string bahanbaku = BahanBaku.BacaData("", "", listBahanBaku);

            if (bahanbaku != "1")
            {
                MessageBox.Show(bahanbaku);
            }
            else
            {
                listNotif.Clear();
                panel1.Controls.Clear();
                int pointY      = 0;
                int panelheight = 20;
                for (int i = 0; i < listBahanBaku.Count; i++)
                {
                    if (listBahanBaku[i].Stok <= 5)
                    {
                        try
                        {
                            this.panel1.Size = new System.Drawing.Size(panel1.Size.Width, panelheight);
                            TextBox a = new TextBox();
                            a.Enabled = false;
                            if (listBahanBaku[i].Stok == 0)
                            {
                                a.Text = "Stok Bahan Baku '" + listBahanBaku[i].Nama + "' telah habis";
                            }
                            else
                            {
                                a.Text = "Stok Bahan Baku '" + listBahanBaku[i].Nama + "' Hanya tersisa " + listBahanBaku[i].Stok.ToString();
                            }
                            a.Size     = new System.Drawing.Size(panel1.Size.Width, 20);
                            a.Location = new Point(0, pointY);
                            a.Font     = new System.Drawing.Font("Arial", 15);
                            listNotif.Add(listBahanBaku[i].Id);
                            panel1.Controls.Add(a);
                            panel1.Show();
                            panel1.Visible = true;
                            pointY        += 35;
                            panelheight   += 60;
                        }
                        catch (Exception e)
                        {
                            MessageBox.Show(e.ToString());
                        }
                    }
                }
                if (listNotif.Count == listNotifcompare.Count)
                {
                    for (int i = 0; i < listNotif.Count; i++)
                    {
                        if (i != listNotifcompare.Count)
                        {
                            if (listNotif[i] != listNotifcompare[i])
                            {
                                break;
                            }
                        }
                    }
                }
                else
                {
                    listNotifcompare = listNotif;
                }
            }
        }