Only show owners stock when selling
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user