Beispiel #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ClassOrder m = new ClassOrder();

            m.Status = cbStatus.Text;

            md.updateAmbil(m, id);
            viewData();
        }
Beispiel #2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string TanggalOrder      = dtpOrder.Value.ToString("yyyy-MM-dd");
            string TanggalRenSelesai = dtpRs.Value.ToString("yyyy-MM-dd");

            ClassOrder m = new ClassOrder();

            if (rbDiantar.Checked)
            {
                m.Id_order        = tbIdOrder.Text;
                m.Paket           = cbPaket.Text;
                m.Nama            = tbNama.Text;
                m.No_hp           = tbNohp.Text;
                m.Alamat          = rtbAlamat.Text;
                m.Tgl_order       = TanggalOrder;
                m.Tgl_ren_selesai = TanggalRenSelesai;
                m.Pengiriman      = rbDiantar.Text;
                m.Berat           = tbBerat.Text;
                m.Harga           = tbHarga.Text;
                m.Biaya_antar     = tbBiaya.Text;
                m.Total_dibayar   = tbTotal.Text;
                m.Uang_dibayar    = tbDibayar.Text;
                m.Uang_kembali    = tbKembali.Text;
                m.Status          = "Progress";
            }
            else
            {
                m.Id_order        = tbIdOrder.Text;
                m.Paket           = cbPaket.Text;
                m.Nama            = tbNama.Text;
                m.No_hp           = tbNohp.Text;
                m.Alamat          = rtbAlamat.Text;
                m.Tgl_order       = TanggalOrder;
                m.Tgl_ren_selesai = TanggalRenSelesai;
                m.Pengiriman      = rbDiambil.Text;
                m.Berat           = tbBerat.Text;
                m.Harga           = tbHarga.Text;
                m.Biaya_antar     = tbBiaya.Text;
                m.Total_dibayar   = tbTotal.Text;
                m.Uang_dibayar    = tbDibayar.Text;
                m.Uang_kembali    = tbKembali.Text;
                m.Status          = "Progress";
            }


            md.insertOrder(m);
            MessageBox.Show("Data order berhasil ditambahkan!");
            ClearAll();
        }
Beispiel #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ClassOrder m = new ClassOrder();

            m.Id_order   = tbIdOrder.Text;
            m.Paket      = cbPaket.Text;
            m.Nama       = cbNama.Text;
            m.Alamat     = tbAlamat.Text;
            m.No_hp      = tbNoHp.Text;
            m.Pengiriman = cbPengiriman.Text;
            m.Status     = cbStatus.Text;

            md.updateOrder(m, id);
            viewData();
        }
Beispiel #4
0
        public bool updateAmbil(ClassOrder m, string id)
        {
            Boolean stat = false;

            try
            {
                koneksi.Open();
                perintah             = new MySqlCommand();
                perintah.Connection  = koneksi;
                perintah.CommandType = CommandType.Text;
                perintah.CommandText = "UPDATE tbl_order SET status='" + m.Status + "' WHERE id='" + id + "'";
                perintah.ExecuteNonQuery();
                stat = true;
                koneksi.Close();
            }
            catch (MySqlException) { }
            return(stat);
        }
Beispiel #5
0
        public bool updateOrder(ClassOrder m, string id)
        {
            Boolean stat = false;

            try
            {
                koneksi.Open();
                perintah             = new MySqlCommand();
                perintah.Connection  = koneksi;
                perintah.CommandType = CommandType.Text;
                perintah.CommandText = "UPDATE tbl_order SET id_order='" + m.Id_order + "', paket='" + m.Paket + "', nama='" + m.Nama + "', alamat='" + m.Alamat + "', no_hp='" + m.No_hp + "', pengiriman='" + m.Pengiriman + "', status='" + m.Status + "' WHERE id='" + id + "'";
                perintah.ExecuteNonQuery();
                stat = true;
                koneksi.Close();
            }
            catch (MySqlException) { }
            return(stat);
        }
Beispiel #6
0
        public bool insertOrder(ClassOrder m)
        {
            Boolean stat = false;

            try
            {
                koneksi.Open();
                perintah             = new MySqlCommand();
                perintah.Connection  = koneksi;
                perintah.CommandType = CommandType.Text;
                perintah.CommandText = "INSERT INTO tbl_order (id, id_order, paket, nama, no_hp, alamat, tgl_order, tgl_ren_selesai, pengiriman, berat, harga, biaya_antar, total_dibayar, uang_dibayar, uang_kembali, status) VALUES('" + "" + "','" + m.Id_order + "', '" + m.Paket + "','" + m.Nama + "', '" + m.No_hp + "', '" + m.Alamat + "', '" + m.Tgl_order + "', '" + m.Tgl_ren_selesai + "', '" + m.Pengiriman + "', '" + m.Berat + "', '" + m.Harga + "', '" + m.Biaya_antar + "', '" + m.Total_dibayar + "', '" + m.Uang_dibayar + "', '" + m.Uang_kembali + "', '" + m.Status + "')";
                perintah.ExecuteNonQuery();
                stat = true;
                koneksi.Close();
            }
            catch (MySqlException) { }
            return(stat);
        }