Routine for buying stocks fixed

This commit is contained in:
2022-02-14 08:06:32 +01:00
parent 33640bbd6f
commit aac79f946c
2 changed files with 12 additions and 3 deletions

View File

@ -122,6 +122,7 @@ namespace StockInfoCore
{
AddItemToListView(currStock);
}
lwRegBuffer.Refresh();
}
private void AddItemToListView(StockMember currStock)
@ -131,6 +132,7 @@ namespace StockInfoCore
lv.SubItems.Add(currStock.PostAmount.ToString());
lv.SubItems.Add(currStock.Comment);
//lv.BackColor = Color.Aquamarine;
}
private void AddValidateData()
@ -148,6 +150,11 @@ namespace StockInfoCore
currentStock.SoldValue = decimal.Parse("0");
currentStock.Comment = txtComment.Text;
RegisteredStocks.Add(currentStock);
if (StockGroupTmp != null)
{
_stockRepository.SaveStockGroup(StockGroupTmp);
StockGroupTmp = null;
}
initiateRegWin();
}
@ -172,7 +179,7 @@ namespace StockInfoCore
_stockRepository.InsertMany(RegisteredStocks);
lwRegBuffer.Clear();
RegisteredStocks.Clear();
_stockRepository.SaveStockGroup(StockGroupTmp);
}
}