Exemple #1
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     lblID.Show();
     txtID.Hide();
     CmbViewCustomer.Text = "";
     CmbViewPaket.Text    = "";
     dtpTgl.Checked       = false;
     CmbViewCustomer.Focus();
 }
Exemple #2
0
 public frmPesanan()
 {
     koneksi     = KoneksiDB.Koneksi.getKoneksi();
     impPesanan  = new ImpPesanan();
     impCustomer = new ImpCustomer();
     impPaket    = new ImpPaket();
     entPesanan  = new EntPesanan();
     InitializeComponent();
     CmbViewCustomer.Focus();
     cmbCustomer();
     cmbPaket();
 }
Exemple #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            txtID.Enabled = false;
            if (txtAcara.Text == "" || CmbViewCustomer.Text == "" || txtTempat.Text == "" || dtpTgl.Checked == false)
            {
                MessageBox.Show("Form harus diisi !");
                CmbViewCustomer.Focus();
            }
            else
            {
                id_agenda   = Int32.Parse(txtID.Text);
                id_customer = Int32.Parse(CmbViewCustomer.Text);
                entAgenda.setIDCustomer(id_customer);
                entAgenda.setJudul(txtAcara.Text);
                entAgenda.setTempat(txtTempat.Text);
                entAgenda.setTgl(dtpTgl.Text);

                status = impAgenda.updateAgenda(entAgenda, id_agenda);

                if (status == false)
                {
                    MessageBox.Show("Update Failed !!");
                    CmbViewCustomer.Text = "";
                    txtAcara.Text        = "";
                    txtTempat.Text       = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Text = "";
                    CmbViewCustomer.Focus();
                }
                else
                {
                    MessageBox.Show("Update Success !!");
                    CmbViewCustomer.Text = "";
                    txtAcara.Text        = "";
                    txtTempat.Text       = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Text = "";
                    CmbViewCustomer.Focus();
                }
                viewAgenda();
            }
        }
Exemple #4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            txtID.Enabled = false;

            if (CmbViewCustomer.Text == "" || CmbViewPaket.Text == "" || dtpTgl.Checked == false)
            {
                MessageBox.Show("Form harus diisi !");
                CmbViewCustomer.Focus();
            }
            else
            {
                id_pesanan  = Int16.Parse(txtID.Text);
                id_customer = Int16.Parse(CmbViewCustomer.Text);
                id_paket    = Int16.Parse(CmbViewPaket.Text);
                entPesanan.setIDCustomer(id_customer);
                entPesanan.setIDPaket(id_paket);
                entPesanan.setTgl(dtpTgl.Text);

                status = impPesanan.updatePesanan(entPesanan, id_pesanan);

                if (status == false)
                {
                    MessageBox.Show("Update Failed !!");
                    CmbViewCustomer.Text = "";
                    CmbViewPaket.Text    = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Focus();
                }
                else
                {
                    MessageBox.Show("Update Success !!");
                    CmbViewCustomer.Text = "";
                    CmbViewPaket.Text    = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Focus();
                }
                viewPesanan();
            }
        }
Exemple #5
0
        private void btnInput_Click(object sender, EventArgs e)
        {
            if (CmbViewCustomer.Text == "" || CmbViewPaket.Text == "" || dtpTgl.Checked == false)
            {
                MessageBox.Show("Form harus diisi !");
                CmbViewCustomer.Focus();
            }
            else
            {
                id_customer = Int32.Parse(CmbViewCustomer.Text);
                id_paket    = Int32.Parse(CmbViewPaket.Text);
                entPesanan.setIDCustomer(id_customer);
                entPesanan.setIDPaket(id_paket);
                entPesanan.setTgl(dtpTgl.Text);

                status = impPesanan.insertPesanan(entPesanan);

                if (status == false)
                {
                    MessageBox.Show("Input Failed !!");
                    CmbViewCustomer.Text = "";
                    CmbViewPaket.Text    = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Focus();
                }
                else
                {
                    MessageBox.Show("Input Success !!");
                    CmbViewCustomer.Text = "";
                    CmbViewPaket.Text    = "";
                    dtpTgl.Checked       = false;
                    CmbViewCustomer.Focus();
                }
                viewPesanan();
            }
        }