Esempio n. 1
0
        private void FormTambahBarang_Load(object sender, EventArgs e)
        {
            frmDaftar = (FormDaftarBarang)this.Owner;

            listHasilData.Clear();
            textBoxKodeBarang.Text         = "";
            textBoxNamaBarang.Text         = "";
            textBoxSatuanBarang.Text       = "";
            numericUpDownHargaSatuan.Value = 0;
            numericUpDownJumlah.Value      = 0;
            numericUpDownJumlah.Enabled    = false;
            comboBoxPO.Text = "";
            pictureBoxGambar.BackgroundImage = null;
            richTextBoxKeterangan.Text       = "";
            string hasil = OrderPenjualan.BacaData("", "", listHasilData);

            if (hasil == "1")
            {
                for (int i = 0; i < listHasilData.Count; i++)
                {
                    comboBoxPO.Items.Add(listHasilData[i].NoOrder + " - " + listHasilData[i].Customer.Nama);
                }
            }
            else
            {
                MessageBox.Show("ERROR");
            }
        }
        private void barangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form form = Application.OpenForms["FormDaftarBarang"];

            if (form == null)
            {
                FormDaftarBarang frm = new FormDaftarBarang();
                frm.Owner = this;
                frm.Show();
            }
            else
            {
                form.Show();
                form.BringToFront();
            }
        }
Esempio n. 3
0
        public void FormUbahBarang_Load(object sender, EventArgs e)
        {
            frmDaftar = (FormDaftarBarang)this.Owner;

            listHasilData.Clear();

            string hasil = Barang.BacaData("", "", listHasilData);

            if (hasil == "1")
            {
                for (int i = 0; i < listHasilData.Count; i++)
                {
                    comboBoxKodeBarang.Items.Add(listHasilData[i].Kode);
                }
            }

            //textBoxIdOrder.Enabled = false;
            //textBoxKeterangan.Enabled = false;
            //textBoxSatuan.Enabled = false;
            //textBoxNama.Enabled = false;
            //numericUpDownJumlah.Enabled = false;
            //numericUpDownHargaSatuan.Enabled = false;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string hasil = Barang.HapusData(comboBoxKodeBarang.Text);
                if (hasil == "1")
                {
                    MessageBox.Show("Barang telah dihapus");

                    FormDaftarBarang frm = (FormDaftarBarang)this.Owner;
                    frm.FormDaftarBarang_Load(sender, e);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Error. Pesan : " + hasil);
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }