Beispiel #1
0
        public void selectHtrans(int selected)
        {
            if (selected != -1 && selected < htrans.Table.Rows.Count)
            {
                ViewComponent.checkboxTerimaSemua.IsChecked = false;
                this.h_trans_selected = selected;
                DataRow dr = htrans.Table.Rows[selected];
                forselectdata = new D_Trans_ItemModel();
                forselectdata.initAdapter($"select h.KODE, to_char(h.TANGGAL_TRANSAKSI,'dd-mm-yyyy'), k.NAMA, c.NAMA, c.ALAMAT from H_TRANS_ITEM h, D_TRANS_ITEM d, KURIR k, CUSTOMER c, ITEM i where d.ID_ITEM = i.ID and h.ID_CUSTOMER = c.ID and d.ID_H_TRANS_ITEM = h.ID and h.KODE = '{dr[0].ToString()}' {status}");
                dr = forselectdata.Table.Rows[0];
                ViewComponent.labelKodePesanan.Content        = dr[0].ToString();
                ViewComponent.labelTanggalTransaksi.Content   = dr[1].ToString();
                ViewComponent.labelKurir.Content              = dr[2].ToString();
                ViewComponent.labelNamaPembeli.Content        = dr[3].ToString();
                ViewComponent.textboxAlamatPesanan.Text       = dr[4].ToString();
                ViewComponent.textboxAlamatPesanan.IsReadOnly = true;
                dtrans = new D_Trans_ItemModel();
                dtrans.initAdapter($"select d.JUMLAH as \"Jumlah\", i.NAMA as \"Nama Barang\", to_char(i.HARGA) as \"Harga\", to_char(i.HARGA * d.JUMLAH) as \"Total\", case d.STATUS when 'W' then 'Pesanan Baru' when 'P' then 'Siap Kirim' when 'S' then 'Dalam Pengiriman' when 'D' then 'Pesanan Selesai' when 'C' then 'Pesanan Dibatalkan' end as \"Status\" from ITEM i, H_TRANS_ITEM h, D_TRANS_ITEM d where h.ID = d.ID_H_TRANS_ITEM and i.ID = d.ID_ITEM and h.KODE = '{dr[0].ToString()}' and i.ID_SELLER = '{seller["ID"]}' {status}");
                dtrans_helper = new D_Trans_ItemModel();
                dtrans_helper.initAdapter($"select d.ID , d.STATUS, i.STOK, d.JUMLAH, i.ID, to_char(i.HARGA * d.JUMLAH) as \"Total\" from ITEM i, H_TRANS_ITEM h, D_TRANS_ITEM d where h.ID = d.ID_H_TRANS_ITEM and i.ID = d.ID_ITEM and h.KODE = '{dr[0].ToString()}' and i.ID_SELLER = '{seller["ID"]}' {status}");
                ViewComponent.datagridProdukPesanan.ItemsSource = dtrans.Table.DefaultView;

                Utility.toCurrency(dtrans.Table, 2);
                Utility.toCurrency(dtrans.Table, 3);
                ViewComponent.canvasDetailPesanan.Visibility = System.Windows.Visibility.Visible;
                hitungTotal();
            }
        }
        public DataTable getDTrans()
        {
            DataRow dr = hm_helper.Table.Rows[selected];

            dm = new D_Trans_ItemModel();
            dm.initAdapter($"select i.NAMA as \"Nama Item\"" +
                           $", s.NAMA_SELLER as \"Nama Toko\"" +
                           $", to_char(i.HARGA) as \"Harga\"" +
                           $", to_char(d.JUMLAH) as \"Jumlah\"" +
                           $", to_char(d.JUMLAH * i.HARGA) as \"Total\" " +
                           $"from D_TRANS_ITEM d, ITEM i, SELLER s where d.ID_ITEM = i.ID and s.ID = i.ID_SELLER and d.ID_H_TRANS_ITEM = '{dr[0].ToString()}'");

            return(dm.Table);
        }
Beispiel #3
0
 public void viewSemuaPesanan(string keyword = "")
 {
     lastclick = 1;
     ViewComponent.textboxCariPesanan.Text = "";
     htrans.initAdapter($"select distinct h.KODE as \"Kode Pesanan\", c.NAMA as \"Nama Customer\", to_char(sum(i.HARGA * d.JUMLAH)) as \"Total\", h.TANGGAL_TRANSAKSI as \"Tanggal Transaksi\", k.NAMA as \"Kurir\", case h.STATUS when 'C' then 'Canceled' when 'W' then 'Waiting Payment' when 'P' then 'Paid' end as \"Status\" from H_TRANS_ITEM h, D_TRANS_ITEM d, CUSTOMER c, ITEM i, KURIR k where i.ID = d.ID_ITEM and h.ID = d.ID_H_TRANS_ITEM and c.ID = h.ID_CUSTOMER and i.ID_SELLER = '{seller["ID"]}' and k.ID = d.ID_KURIR {keyword} group by h.KODE, c.NAMA, h.TANGGAL_TRANSAKSI, k.NAMA, h.STATUS {orderby}");
     toCurrencyHtrans();
     status = "";
     ViewComponent.datagridPesanan.ItemsSource    = htrans.Table.DefaultView;
     ViewComponent.canvasDetailPesanan.Visibility = System.Windows.Visibility.Hidden;
 }