Prepared for stock edit function + corrected bug , "not possible to buy new stock"!

This commit is contained in:
2021-05-24 22:49:23 +02:00
parent 27db60bbb2
commit 6c32c38296
3 changed files with 31 additions and 2 deletions

View File

@ -57,9 +57,23 @@ namespace StockInfoCore
var stockSold = _stockRepository.LatestSell(stockChosen.StockName.Trim());
if (stockSold != null)
{
txtLatestSoldDate.Text = stockSold.LatestSoldDate.Value.ToString();
txtLatestSoldPrice.Text = stockSold.SoldStockPrice.ToString();
if (stockSold.LatestSoldDate != null)
{
txtLatestSoldDate.Text = stockSold.LatestSoldDate.Value.ToString();
txtLatestSoldPrice.Text = stockSold.SoldStockPrice.ToString();
}
else
{
txtLatestSoldDate.Text = string.Empty;
txtLatestSoldPrice.Text = string.Empty;
}
}
else
{
txtLatestSoldDate.Text = string.Empty;
txtLatestSoldPrice.Text = string.Empty;
}
}
private void btnSaveStock_Click(object sender, EventArgs e)