Prepared for stock edit function + corrected bug , "not possible to buy new stock"!
This commit is contained in:
@ -35,6 +35,7 @@ namespace StockInfoCore
|
||||
private readonly frmPersonShareConnect _personShareConnect;
|
||||
private readonly frmBackup _backupWindow;
|
||||
|
||||
bool loading = false;
|
||||
//private frmRegisterStock regWindow;
|
||||
//private frmMyStocks stockWindow;
|
||||
//private frmSelling sellWindow;
|
||||
@ -88,10 +89,12 @@ namespace StockInfoCore
|
||||
|
||||
private void ReloadData()
|
||||
{
|
||||
loading = true;
|
||||
var allStocks = _stockRepository.GetAllStocks();
|
||||
dataGridView.DataSource = allStocks;
|
||||
// SaveStocks(allStocks);
|
||||
lblTotalRecords.Text = $"Total records: {dataGridView.RowCount}";
|
||||
loading = false;
|
||||
}
|
||||
|
||||
|
||||
@ -264,5 +267,15 @@ namespace StockInfoCore
|
||||
// backupWindow = new frmBackup(_backupRepository, _backupRoutines);
|
||||
_backupWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void dataGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!loading)
|
||||
{
|
||||
//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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user