private void load_items() { OracleHandler oh = new OracleHandler(); string sql = "select dj.KDBRG, dj.KDGOL, dj.KDSUPP, dj.HBELI, dj.HJUAL, " + " dj.QTY, dj.DISC, dj.DISCRP, dj.LOKASI, dj.NM_UPDATE, " + " dj.TG_UPDATE, dj.TGL_INSERT, dj.SPID, dj.TXT, nvl(v.T,'N') " + "from d_jual dj, vendor v " + "where dj.kdsupp = v.vendor_code " + " and nobukti = '" + this.base_data.nobukti + "'"; if (!oh.connect()) { return; } if (!oh.DoQuery(sql)) { return; } if (oh.getRowCount() >= 1) { OracleDataReader odr = oh.odr; while (odr.Read()) { saleItem tmp_si = new saleItem(); tmp_si.item_code_kdbrg = odr.GetString(0); tmp_si.category_kdgol = odr.GetString(1); tmp_si.vendor_code_kdsupp = odr.GetString(2); tmp_si.item_price_hjual = double.Parse(odr.GetString(4)); tmp_si.quantity_qty = Int32.Parse(odr.GetString(5)); tmp_si.t = odr.GetString(14); this.sales_items.Add(tmp_si); // tmpTs.nmkas = odr.GetString(2); // tmpTs.total = double.Parse(odr.GetString(3)); // tmpTs.jnsbyr = odr.GetString(4); // tmpTs.tvch = double.Parse(odr.GetString(5)); // tmpTs.tbyr = double.Parse(odr.GetString(6)); // tmpTs.tdbt = double.Parse(odr.GetString(7)); // tmpTs.tccd = double.Parse(odr.GetString(8)); // tmpTs.tpiutang = double.Parse(odr.GetString(9)); // tmpTs.kembali = double.Parse(odr.GetString(10)); // tmpTs.tother = double.Parse(odr.GetString(11)); // tmpTs.total_quantity = Int32.Parse(odr.GetString(12)); } odr.Dispose(); } oh.disconnect(); }
private void load_base() { OracleHandler oh = new OracleHandler(); // OracleDataReader odr; string sql = "select NOBUKTI, TGL, JAM, NMKAS, TOTAL, JNSBYR, TVCH, TBYR, " + " TDBT, TCCD, KEMBALI, NOCARD, PEMILIK, NMCARD, KET, LOKASI, " + " NM_UPDATE, TG_UPDATE, TGL_INSERT, TPIUTANG, TOTHER, MEMBERID, TXT " + "from ERP.H_JUAL " + "where nobukti = '" + this.base_data.nobukti + "'"; if (!oh.connect()) { return; } if (!oh.DoQuery(sql)) { return; } if (oh.getRowCount() >= 1) { OracleDataReader odr = oh.odr; while (odr.Read()) { //already have nobukti so skip that one this.base_data.tgl = odr.GetDateTime(1); this.base_data.jam = odr.GetDateTime(2); this.base_data.nmkas = odr.GetString(3); base_data.total = double.Parse(odr.GetString(4)); } odr.Dispose(); } oh.disconnect(); }