Exemple #1
0
        private void LoadData()
        {
            using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0)))
            {
                _listOfBeli = _bll.GetAll();
                GridListControlHelper.Refresh <BeliProduk>(this.gridList, _listOfBeli);
            }

            ResetButton();
        }
Exemple #2
0
        public void GetAllTest()
        {
            var index = 0;
            var oList = _bll.GetAll();
            var obj   = oList[index];

            // tes header table (beli)
            Assert.IsNotNull(obj);
            Assert.AreEqual("3d4ce868-3f9d-4a6a-88ba-a88ee70ef013", obj.beli_produk_id);
            Assert.AreEqual("00b5acfa-b533-454b-8dfd-e7881edd180f", obj.pengguna_id);
            Assert.AreEqual("7560fd72-0538-4307-8f15-14ef32cf5158", obj.supplier_id);
            Assert.IsNull(obj.retur_beli_produk_id);
            Assert.AreEqual("1234447", obj.nota);
            Assert.AreEqual(new DateTime(2017, 1, 1), obj.tanggal);
            Assert.IsNull(obj.tanggal_tempo);
            Assert.AreEqual(20000, obj.ppn);
            Assert.AreEqual(7500, obj.diskon);
            Assert.AreEqual(2021000, obj.total_nota);
            Assert.AreEqual(0, obj.total_pelunasan);
            Assert.AreEqual("tesssss", obj.keterangan);

            Assert.AreEqual("7560fd72-0538-4307-8f15-14ef32cf5158", obj.Supplier.supplier_id);
            Assert.AreEqual("Toko Komputer \"XYZ\"", obj.Supplier.nama_supplier);

            // tes detail table (item beli)
            index = 2;
            Assert.AreEqual(3, obj.item_beli.Count);

            var itemBeli = obj.item_beli[index];

            Assert.AreEqual("7f09a4aa-e660-4de3-a3aa-4b3244675f9f", itemBeli.Produk.produk_id);
            Assert.AreEqual("201607000000051", itemBeli.Produk.kode_produk);
            Assert.AreEqual("Access Point TPLINK TC-WA 500G", itemBeli.Produk.nama_produk);

            Assert.AreEqual(71000, itemBeli.harga);
            Assert.AreEqual(16, itemBeli.jumlah);
        }
Exemple #3
0
        private void LoadData()
        {
            using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0)))
            {
                _listOfBeli = _bll.GetAll(_pageNumber, _pageSize, ref _pagesCount);
                GridListControlHelper.Refresh <BeliProduk>(this.gridList, _listOfBeli);

                base.SetInfoHalaman(_pageNumber, _pagesCount);
                base.SetStateBtnNavigation(_pageNumber, _pagesCount);

                if (!(_listOfBeli.Count > 0))
                {
                    base.SetInfoHalaman(0, 0);
                    base.SetStateBtnNavigation(0, 0); // non aktifkan button navigasi
                }
            }

            ResetButton();
        }