Only show owners stock when selling

This commit is contained in:
2022-02-22 07:11:18 +01:00
parent 40d869b5de
commit d8f6ce4650
4 changed files with 34 additions and 13 deletions

View File

@ -14,6 +14,7 @@ namespace StockInfoCore
private readonly IStockRepository _stockRepository;
private List<StockMember> remainingStocks = new();
public StockMember stkMemSelected { get; set; } = null;
public int selectedPersonId { get; set; }
public frmSelling(IStockRepository stockRepository)
{
@ -31,7 +32,8 @@ namespace StockInfoCore
private void ReloadRemainingStocks()
{
remainingStocks = _stockRepository.GetAllRemainingStocks().ToList();
if (selectedPersonId == 0) return;
remainingStocks = _stockRepository.GetAllRemainingStocks(selectedPersonId).ToList();
foreach (var stock in remainingStocks)
{
var lvRow = lvSellCandidates.Items.Add(stock.StockId);