private void _view_LoadData(object sender, EventArgs e) { using (new WaitCursorHandler()) { _listObjs = _barangServices.GetAll().ToList(); _bindingView = new BindingListView <BarangModel>(_listObjs); _view.ListDataGrid.DataSource = _bindingView; } }
private void _view_LoadData(object sender, EventArgs e) { using (new WaitCursorHandler()) { if (_view.ListDataGrid != null) { _bindingView = new BindingListView <StokBarangModel>(new List <StokBarangModel> { new StokBarangModel() }); _view.ListDataGrid.DataSource = _bindingView; _bindingView.DataSource.Clear(); _bindingView.Refresh(); var tipeBarangList = new TipeBarangServices(new TipeBarangRepository(), new ModelDataAnnotationCheck()).GetAll(); var barangList = _barangServices.GetAll().ToList(); foreach (var tipe in tipeBarangList) { var node = _view.TreeViewTipeBarang.Nodes.Add(tipe.id.ToString(), tipe.nama); var barangMatched = barangList.Where(b => b.tipe_id == tipe.id).ToList(); foreach (var barang in barangMatched) { node.Nodes.Add(barang.id.ToString(), barang.nama); barangList.Remove(barang); } } _view.TreeViewTipeBarang.ExpandAll(); } } }
public void ShouldReturnListOfModels() { var listModels = _services.GetAll().ToList(); Assert.NotEmpty(listModels); TestsHelper.WriteListModels(_testOutputHelper, listModels); }
private void buttonCari_Click(object sender, EventArgs e) { _listBarangs = _barangServices.GetAll().Where(b => b.stok > b.minimal_stok).ToList(); var view = new CariBarangView(_listBarangs, TipePencarian.PenyesuaianStok); view.OnSendData += CariBarangPembelianView_OnSendData; view.ShowDialog(); }
private void _view_LoadData(object sender, EventArgs e) { using (new WaitCursorHandler()) { _listObjs = _barangServices.GetAll().ToList(); if (_view.ListDataGrid != null && _view.ComboBoxTipe != null && _view.ComboBoxSubTipe != null && _view.ComboBoxSupplier != null) { _bindingView = new BindingListView <BarangModel>(_listObjs); _view.ListDataGrid.DataSource = _bindingView; _view.ComboBoxTipe.Enabled = false; _view.ComboBoxSubTipe.Enabled = false; _view.ComboBoxSupplier.Enabled = false; ((Form)_view).ActiveControl = _view.ButtonTampilkan; } } }
private void BersihkanDataListPenjualan() { if (_statusBayar) { _view.ListDataGrid.Enabled = true; _view.TextBoxNoNota.Text = string.Empty; _listsBarangs = _barangServices.GetAll().Where(b => b.harga_jual > 0).ToList(); _statusBayar = false; } _kodeOrNamaForSearching = string.Empty; _listPenjualanDetails.Clear(); AddDummyPenjualanModel(30); _bindingView.DataSource = _listPenjualanDetails; _view.ListDataGrid.MoveToCurrentCell(new RowColumnIndex(1, 1)); }
private void BersihkanDataListPemelian() { if (_statusSimpan) { _view.ListDataGrid.Enabled = true; _view.TextBoxNoNota.Text = string.Empty; _listsBarangs = _barangServices.GetAll().ToList(); _grandTotal = 0; _statusSimpan = false; } _kodeOrNamaForSearching = string.Empty; _listsPembelianDetails.Clear(); AddDummyPembelianModel(30); _bindingView.DataSource = _listsPembelianDetails; _view.ListDataGrid.MoveToCurrentCell(new RowColumnIndex(1, 1)); }
public PenjualanPresenter() { _view = new PenjualanView(); _penjualannServices = new PenjualanServices(new PenjualanRepository(), new ModelDataAnnotationCheck()); _barangServices = new BarangServices(new BarangRepository(), new ModelDataAnnotationCheck()); _listsBarangs = _barangServices.GetAll().Where(b => b.harga_jual > 0).ToList(); _view.OnLoadData += _view_OnLoadData; _view.OnCariData += _view_OnCariData; _view.OnHapusData += _view_OnHapusData; _view.OnSimpanData += _view_OnBayarPenjualan; _view.OnBersihkanData += _view_OnBersihkanData; _view.OnCetakNota += _view_OnCetakNota; _view.OnListDataGridCurrentCellKeyDown += _view_OnListDataGridCurrentCellKeyDown; _view.OnListDataGridCurrentCellActivated += _view_OnListDataGridCurrentCellActivated; _view.OnListDataGridCurrentCellEndEdit += _view_OnListDataGridCurrentCellEndEdit; _view.OnListDataGridPreviewKeyDown += _view_OnListDataGridPreviewKeyDown; }
private void OnBarangViewLoadEventRaised(object sender, EventArgs e) { var listBarang = _barangServices.GetAll().ToList(); _barangView.BindingLitViewBarang = new BindingListView <DomainLayer.Models.Barang.BarangModel>(listBarang); }