コード例 #1
0
        private void SetLabelValues()
        {
            _model = _services.GetByDate(_view.DateTimePickerTanggal.Value.Date);

            var stokAwal        = 0;
            var stokMasuk       = 0;
            var stokKeluar      = 0;
            var stokAkhir       = 0;
            var penyesuaianStok = 0;
            var returnPenjualan = 0;
            var returnPembelian = 0;

            if (_model != null)
            {
                stokAwal        = _model.stok_awal;
                stokMasuk       = _model.stok_masuk;
                stokKeluar      = _model.stok_terjual;
                stokAkhir       = _model.stok_akhir;
                penyesuaianStok = _model.penyesuaian_stok;
                returnPenjualan = _model.penjualan_return_qty;
                returnPembelian = _model.pembelian_return_qty;
            }

            _view.LabelStokAwal.Text        = stokAwal.ToString("N0");
            _view.LabelStokMasuk.Text       = stokMasuk.ToString("N0");
            _view.LabelStokTerjual.Text     = stokKeluar.ToString("N0");
            _view.LabelPenyesuaianStok.Text = penyesuaianStok.ToString("N0");
            _view.LabelStokAkhir.Text       = stokAkhir.ToString("N0");
            _view.LabelReturnPenjualan.Text = returnPenjualan.ToString("N0");
            _view.LabelReturnPembelian.Text = returnPembelian.ToString("N0");
        }
コード例 #2
0
        private void ShouldReturnSuccessForGetByDate()
        {
            IStatusBarangModel model = null;

            try
            {
                model = _services.GetByDate(DateTime.Now.Date);
            }
            catch (DataAccessException ex)
            {
                _testOutputHelper.WriteLine(ex.DataAccessStatusInfo.GetFormatedValues());
            }

            Assert.True(model != null);

            if (model != null)
            {
                TestsHelper.WriteModel(_testOutputHelper, model);
            }
        }