Beispiel #1
0
        //==================klik data di tabel agar masuk ke transaksi line==============================================
        private void dgv_hold_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            id_inv = dgv_hold.SelectedRows[0].Cells[2].Value.ToString();
            //ambil article id, masukan ke variable
            art_id = dgv_hold.SelectedRows[0].Cells[0].Value.ToString();
            //MessageBox.Show(art_id + "");
            //======mencari data article sesuai article code==
            search_data_article();
            //===========masukan ke transaksi line
            insert();
            //===========potong inventory article===
            //MEMOTONG ARTICLE
            Inv_Line inv          = new Inv_Line();
            int      qty_min_plus = -1;
            String   type_trans   = "1";

            inv.cek_qty_inv(id_inv);
            inv.cek_type_trans(type_trans);
            inv.cek_inv_line(id_trans, qty_min_plus);
            //==panggil method di uc_coba(halaman transaksi)

            DiscountAfterUsePromNew afteruser = new DiscountAfterUsePromNew();

            afteruser.retreive(trans_id, kodetoko3, custid3);

            //uc_coba.Instance.retreive();
            //uc_coba.Instance.itung_total();
            //====tutup dialog===
            this.Close();
        }
        //===========================================================================================================

        //========================UPDATE VALUES DISKON INTO DATABASE TRANSACTION HEADER==============================
        public void update()
        {
            String cmd_update = "UPDATE transaction_line SET DISCOUNT='" + total_kotor + "', SUBTOTAL = '" + total_bersih + "', DISCOUNT_CODE = '" + diskon_kode + "', DISCOUNT_DESC = '" + disc_desc + "' WHERE TRANSACTION_ID='" + id_transaksi + "' AND ARTICLE_ID='" + art_id_diskon + "'";
            CRUD   update     = new CRUD();

            update.ExecuteNonQuery(cmd_update);

            DiscountAfterUsePromNew afteruser = new DiscountAfterUsePromNew();

            afteruser.retreive(id_transaksi, kodetoko2, custid2);

            uc_coba.Instance.retreive();
            uc_coba.Instance.itung_total();
            this.Close();
        }