Application is working, register and calculate

This commit is contained in:
2021-02-02 16:25:10 +01:00
parent 3f737a8010
commit 8839d7dff3
9 changed files with 448 additions and 7 deletions

View File

@ -13,7 +13,7 @@ namespace RepositoryPattern
{
public partial class frmRegisterStock : Form
{
Color hdr = Color.Red;
public Dictionary<string, DiTraderStockRow> Stocks { get; set; }
public List<StockMember> RegisteredStocks { get; set; } = new List<StockMember>();
@ -73,6 +73,7 @@ namespace RepositoryPattern
lv.SubItems.Add(currStock.BuyValue.ToString());
lv.SubItems.Add(currStock.PostAmount.ToString());
lv.SubItems.Add(currStock.Comment);
//lv.BackColor = Color.Aquamarine;
}
private void AddValidateData()
@ -83,7 +84,7 @@ namespace RepositoryPattern
currentStock.BuyValue = decimal.Parse(string.IsNullOrEmpty(txtBuyPrice.Text) ? "0" : txtBuyPrice.Text);
currentStock.PostAmount = long.Parse(string.IsNullOrEmpty(txtBoughtAmount.Text) ? "0" : txtBoughtAmount.Text);
currentStock.ActDate = DateTime.Parse(txtActDate.Text);
currentStock.BuyDate = DateTime.Today;
currentStock.BuyDate = string.IsNullOrWhiteSpace(txtBuyDate.Text) ? DateTime.Today : DateTime.Parse(txtBuyDate.Text);
currentStock.ActValue = decimal.Parse(string.IsNullOrEmpty(txtActValue.Text) ? "0" : txtActValue.Text);
currentStock.SoldDate = null; //DateTime.MaxValue;
currentStock.SoldValue = decimal.Parse("0");
@ -115,5 +116,14 @@ namespace RepositoryPattern
{
txtActAmount.Text = txtBoughtAmount.Text;
}
private void lwRegBuffer_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
using (Brush hBr = new SolidBrush(hdr))
{
e.Graphics.FillRectangle(hBr, e.Bounds);
e.DrawText();
}
}
}
}