Searching in tbody and jump over not wished stocks improved performance

This commit is contained in:
2022-02-07 12:28:01 +01:00
parent 8b74067a10
commit b3d1a46c6c
8 changed files with 199 additions and 47 deletions

View File

@ -141,6 +141,10 @@ namespace StockInfoCore
private void btnValueView_Click(object sender, EventArgs e)
{
if(!GlobalStopwatch.IsRunning && GlobalStopwatch.EllapsedMillis>0)
GlobalStopwatch.Restart();
else GlobalStopwatch.Start();
if (SelectedPersonId == 0)
{
MessageBox.Show($"Ingen person vald ({SelectedPersonId})");
@ -155,6 +159,8 @@ namespace StockInfoCore
_stockWindow.Stocks = _stockMarketRepository.StockMarketList;
Cursor.Current = DefaultCursor;
GlobalStopwatch.Stop();
GlobalStopwatch.PrintSecs("Before Show Stockwindow");
_stockWindow.ShowDialog();
}
}

View File

@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using StockDAL.Interface;
using Helpers;
//
namespace StockInfoCore
{
@ -72,6 +73,8 @@ namespace StockInfoCore
}
lblOwnerName.Text = $"* {ConnectedPerson.FirstName} {ConnectedPerson.LastName} *";
GlobalStopwatch.PrintSecs("In reload (New window)");
txtBuyTotal.Text = BoughtSum.ToString();
txtBuyTotal.Refresh();
txtCurrValue.Text = CurrentSum.ToString();