コード例 #1
0
        private void buttonHapus_Click(object sender, EventArgs e)
        {
            string h = "";

            if (checkBox1.Checked == true)
            {
                h = BOM.HapusData(comboBox1.Text, "");
            }
            else
            {
                h = BOM.HapusData(comboBox1.Text, comboBox2.Text);
            }
            if (h == "1")
            {
                MessageBox.Show("BOM telah dihapus");
                FormDaftarBOM f = (FormDaftarBOM)this.Owner;
                f.FormDaftarBOM_Load(sender, e);
                textBoxbahan.Text       = "";
                textBoxNamaJabatan.Text = "";
                comboBox1.Text          = "";
                comboBox2.Text          = "";
                FormHapusBOM_Load(sender, e);
            }
            else
            {
                MessageBox.Show("BOM gagal dihapus. Pesan: " + h);
            }
        }
コード例 #2
0
        private void buttonSimpan_Click(object sender, EventArgs e)
        {
            BOM bom = new BOM(comboBoxBahan.Text, comboBoxKodeBarang.Text, ((int)
                                                                            numericUpDownJumlahBagian.Value).ToString(), ((int)numericUpDownJumlahSpesifik.Value).ToString(),
                              (int)numericUpDownTotalBiaya.Value, (int)numericUpDownBiayaOperasional.Value,
                              (int)numericUpDownBiayaTukang.Value, (int)numericUpDownPengajuanHarga.Value);

            string hasil = BOM.TambahData(bom);

            if (hasil == "1")
            {
                MessageBox.Show("BOM telah ditambahkan");
            }
            else
            {
                MessageBox.Show("BOM gagal ditambahkan. Pesan error: " + hasil);
            }

            FormTambahBOM_Load(sender, e);
            frmDaftar.FormDaftarBOM_Load(sender, e);
        }
コード例 #3
0
        private void buttonUbahData_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text != "" && comboBox2.Text != "")
            {
                BOM b = new BOM(comboBox2.Text, comboBox1.Text, numericUpDownJumlahBagian.Value.ToString(),
                                numericUpDownJumlahSpesifik.Value.ToString(), (int)numericUpDownTotalBiaya.Value, (int)numericUpDownBiayaOperasional.Value,
                                (int)numericUpDownBiayaTukang.Value, (int)numericUpDownPengajuanHarga.Value);

                string hasil = BOM.UbahData(b);
                if (hasil == "1")
                {
                    MessageBox.Show("BOM telah diubah");
                    FormDaftarBOM d = (FormDaftarBOM)this.Owner;
                    d.FormDaftarBOM_Load(sender, e);
                    comboBox2.Enabled = true;
                    comboBox1.Enabled = true;
                    comboBox1.Text    = "";
                    comboBox2.Text    = "";

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

                    numericUpDownBiayaOperasional.Enabled = false;
                    numericUpDownBiayaTukang.Enabled      = false;
                    numericUpDownPengajuanHarga.Enabled   = false;
                    numericUpDownJumlahBagian.Enabled     = false;
                    numericUpDownJumlahSpesifik.Enabled   = false;
                    FormUbahBOM_Load(sender, e);
                }
            }
            else
            {
                MessageBox.Show("Silahkan mengisi data yang dibutuhkan terlebih dahulu");
            }
        }