Edit stocklist. add stocks,

This commit is contained in:
2022-02-07 23:58:10 +01:00
parent b3d1a46c6c
commit d56e69b448
12 changed files with 87 additions and 43 deletions

View File

@ -34,7 +34,7 @@ namespace StockInfoCore
private readonly frmPerson _personWindow;
private readonly frmPersonShareConnect _personShareConnect;
private readonly frmBackup _backupWindow;
private readonly frmEditStock _editStock;
bool loading = false;
//private frmRegisterStock regWindow;
//private frmMyStocks stockWindow;
@ -58,7 +58,8 @@ namespace StockInfoCore
frmSelling sellWindow,
frmPerson personWindow,
frmPersonShareConnect personShareConnect,
frmBackup backupWindow
frmBackup backupWindow,
frmEditStock editStock
)
{
InitializeComponent();
@ -76,6 +77,7 @@ namespace StockInfoCore
_personWindow = personWindow;
_personShareConnect = personShareConnect;
_backupWindow = backupWindow;
_editStock = editStock;
}
private void Form1_Load(object sender, EventArgs e)
@ -141,9 +143,9 @@ namespace StockInfoCore
private void btnValueView_Click(object sender, EventArgs e)
{
if(!GlobalStopwatch.IsRunning && GlobalStopwatch.EllapsedMillis>0)
GlobalStopwatch.Restart();
else GlobalStopwatch.Start();
//if(!GlobalStopwatch.IsRunning && GlobalStopwatch.EllapsedMillis>0)
// GlobalStopwatch.Restart();
//else GlobalStopwatch.Start();
if (SelectedPersonId == 0)
{
@ -159,8 +161,8 @@ namespace StockInfoCore
_stockWindow.Stocks = _stockMarketRepository.StockMarketList;
Cursor.Current = DefaultCursor;
GlobalStopwatch.Stop();
GlobalStopwatch.PrintSecs("Before Show Stockwindow");
//GlobalStopwatch.Stop();
//GlobalStopwatch.PrintSecs("Before Show Stockwindow");
_stockWindow.ShowDialog();
}
}
@ -272,7 +274,7 @@ namespace StockInfoCore
private void btnBackupAll_Click(object sender, EventArgs e)
{
// backupWindow = new frmBackup(_backupRepository, _backupRoutines);
// backupWindow = new frmBackup(_backupRepository, _backupRoutines);
_backupWindow.ShowDialog();
}
@ -282,7 +284,11 @@ namespace StockInfoCore
{
//MessageBox.Show($"{((DataGridView)sender).SelectedRows.ToString()} eventargs = {e.ToString()}" );
int id = Convert.ToInt32(dataGridView.Rows[dataGridView.CurrentRow.Index].Cells[0].Value);
MessageBox.Show($"Vald rads id = {id}");
if (DialogResult.OK == MessageBox.Show($"Vald rads id = {id}{Environment.NewLine}Ändra ?", "Fråga", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
{
_editStock.CurrentStockMember = id;
_editStock.ShowDialog();
};
}
}
}