Ejemplo n.º 1
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     txtHarga.Text      = "";
     txtNamaPaket.Text  = "";
     CmbViewVendor.Text = "";
     CmbViewVendor.Focus();
     lblID.Show();
     txtID.Hide();
 }
Ejemplo n.º 2
0
 public frmPaket()
 {
     koneksi   = KoneksiDB.Koneksi.getKoneksi();
     impPaket  = new ImpPaket();
     impVendor = new ImpVendor();
     entPaket  = new EntPaket();
     InitializeComponent();
     cmbVendor();
     CmbViewVendor.Focus();
 }
Ejemplo n.º 3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            txtID.Enabled = false;
            if (txtNamaPaket.Text == "" || txtHarga.Text == "" || CmbViewVendor.Text == "")
            {
                MessageBox.Show("Form harus diisi !");
                CmbViewVendor.Focus();
            }
            else
            {
                id_paket  = Int16.Parse(txtID.Text);
                harga     = Int32.Parse(txtHarga.Text);
                id_vendor = Int32.Parse(CmbViewVendor.Text);
                entPaket.setNamaPaket(txtNamaPaket.Text);
                entPaket.setHarga(harga);
                entPaket.setIDVendor(id_vendor);

                status = impPaket.updatePaket(entPaket, id_paket);

                if (status == false)
                {
                    MessageBox.Show("Update Failed !!");
                    txtNamaPaket.Text  = "";
                    txtHarga.Text      = "";
                    CmbViewVendor.Text = "";
                    CmbViewVendor.Focus();
                }
                else
                {
                    MessageBox.Show("Update Success !!");
                    txtNamaPaket.Text  = "";
                    txtHarga.Text      = "";
                    CmbViewVendor.Text = "";
                    CmbViewVendor.Focus();
                }
                viewPaket();
            }
        }
Ejemplo n.º 4
0
        private void btnInput_Click(object sender, EventArgs e)
        {
            if (txtNamaPaket.Text == "" || txtHarga.Text == "" || CmbViewVendor.Text == "")
            {
                MessageBox.Show("Form harus diisi !");
                CmbViewVendor.Focus();
            }
            else
            {
                id_vendor = Int32.Parse(CmbViewVendor.Text);
                harga     = Int32.Parse(txtHarga.Text);
                entPaket.setNamaPaket(txtNamaPaket.Text);
                entPaket.setHarga(harga);
                entPaket.setIDVendor(id_vendor);

                status = impPaket.insertPaket(entPaket);

                if (status == false)
                {
                    MessageBox.Show("Input Failed !!");
                    txtNamaPaket.Text  = "";
                    txtHarga.Text      = "";
                    CmbViewVendor.Text = "";
                    CmbViewVendor.Focus();
                }
                else
                {
                    MessageBox.Show("Input Success !!");
                    txtNamaPaket.Text  = "";
                    txtHarga.Text      = "";
                    CmbViewVendor.Text = "";
                    CmbViewVendor.Focus();
                }
                viewPaket();
            }
        }