private void LoadData(string supplierName) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfBeli = _bll.GetByName(supplierName); GridListControlHelper.Refresh <BeliProduk>(this.gridList, _listOfBeli); } ResetButton(); }
private void LoadData(string supplierName) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfBeli = _bll.GetByName(supplierName, _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(); }
public void GetByNameTest() { var name = "pix"; var index = 0; var oList = _bll.GetByName(name); var obj = oList[index]; // tes header table beli Assert.IsNotNull(obj); Assert.AreEqual("70c46d69-ca7c-46b2-bd18-ebf03a28d02b", obj.beli_produk_id); Assert.AreEqual("00b5acfa-b533-454b-8dfd-e7881edd180f", obj.pengguna_id); Assert.AreEqual("e6201c8e-74e3-467c-a463-c8ea1763668e", obj.supplier_id); Assert.IsNull(obj.retur_beli_produk_id); Assert.AreEqual("22222", obj.nota); Assert.AreEqual(new DateTime(2017, 1, 1), obj.tanggal); Assert.AreEqual(new DateTime(2017, 1, 25), 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("e6201c8e-74e3-467c-a463-c8ea1763668e", obj.Supplier.supplier_id); Assert.AreEqual("Pixel Computer", obj.Supplier.nama_supplier); Assert.AreEqual("Solo", obj.Supplier.alamat); // 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); }