Пример #1
0
        private void buttonPenerimaan_Click(object sender, EventArgs e)
        {
            Form form = Application.OpenForms["FormDaftarPenerimaan"];

            if (form == null)
            {
                FormDaftarPenerimaan fp = new FormDaftarPenerimaan();
                fp.MdiParent = this;
                fp.Show();
            }
            else
            {
                form.Show();
                form.BringToFront();
            }
        }
Пример #2
0
        private void buttonSimpan_Click(object sender, EventArgs e)
        {
            FormUtama            frmUtama = (FormUtama)this.Owner.MdiParent;
            FormDaftarPenerimaan form     = (FormDaftarPenerimaan)this.Owner;

            NotaPembelian nota = new NotaPembelian();

            nota.NoNotaPembelian = comboBoxNoNotaBeli.Text;

            string kode  = textBoxIdPengiriman.Text;
            string jenis = "";

            if (comboBoxJenisPengiriman.Text == "Shipping Point")
            {
                jenis = "SP";
            }
            else
            {
                jenis = "DP";
            }
            int        biaya = int.Parse(textBoxBiaya.Text);
            string     nama  = textBoxNama.Text;
            DateTime   tgl   = dateTimePickerTerima.Value;
            string     ket   = textBoxKeterangan.Text;
            Penerimaan peng  = new Penerimaan(kode, jenis, nama, ket, biaya, tgl, nota);

            string hasilTambah = Penerimaan.TambahData(peng);

            if (hasilTambah == "1")
            {
                MessageBox.Show("Berhasil Menambahkan Penerimaan");
                this.Close();
                form.FormDaftarPenerimaan_Load(sender, e);
            }
            else
            {
                MessageBox.Show("pengiriman gagal tersimpan. Pesan kesalahan : " + hasilTambah, "Kesalahan");
            }
        }