Example #1
0
        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();
        }
Example #2
0
        public void loadItemRec(Object[] a_rec)
        {
            //the array of objects is set in stone.  Any changes will need changed everywhere
            saleItem si = new saleItem();

            si.item_code_kdbrg    = a_rec[23].ToString();
            si.category_kdgol     = a_rec[24].ToString();
            si.vendor_code_kdsupp = a_rec[25].ToString();
            si.hbeli            = double.Parse(a_rec[26].ToString());
            si.item_price_hjual = double.Parse(a_rec[27].ToString());
            si.quantity_qty     = int.Parse(a_rec[28].ToString());
            si.disc             = double.Parse(a_rec[29].ToString());
            si.discrp           = double.Parse(a_rec[30].ToString());
            si.location_lokasi  = a_rec[31].ToString();
            si.t           = a_rec[33].ToString();
            si.description = a_rec[34].ToString();
            this.sales_items.Add(si);
        }