Latest sold info implemented
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using DataDomain;
|
||||
using StockDAL.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -14,12 +15,15 @@ namespace StockInfoCore
|
||||
public partial class frmRegisterStock : Form
|
||||
{
|
||||
Color hdr = Color.Red;
|
||||
private readonly IStockRepository _stockRepository;
|
||||
|
||||
public Dictionary<string, DiTraderStockRow> Stocks { get; set; }
|
||||
public List<StockMember> RegisteredStocks { get; set; } = new List<StockMember>();
|
||||
|
||||
public frmRegisterStock()
|
||||
public frmRegisterStock(IStockRepository stockRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_stockRepository = stockRepository;
|
||||
}
|
||||
|
||||
private void LoadStockCombo()
|
||||
@ -50,6 +54,12 @@ namespace StockInfoCore
|
||||
txtStockExtId.Text = stockChosen.StockName;
|
||||
txtActValue.Text = stockChosen.LatestPrice.ToString();
|
||||
txtActDate.Text = (DateTime.Today + stockChosen.TimeOfDay).ToString();
|
||||
var stockSold = _stockRepository.LatestSell(stockChosen.StockName.Trim());
|
||||
if (stockSold != null)
|
||||
{
|
||||
txtLatestSoldDate.Text = stockSold.LatestSoldDate.Value.ToString();
|
||||
txtLatestSoldPrice.Text = stockSold.SoldStockPrice.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSaveStock_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user