Refresh of frmInitial

This commit is contained in:
2021-03-07 17:54:36 +01:00
parent 126722bada
commit 00b407f790
2 changed files with 48 additions and 40 deletions

View File

@ -37,8 +37,7 @@ namespace StockInfo
this.btnBackupShares = new System.Windows.Forms.Button(); this.btnBackupShares = new System.Windows.Forms.Button();
this.btnReload = new System.Windows.Forms.Button(); this.btnReload = new System.Windows.Forms.Button();
this.btnTestScrapFunction = new System.Windows.Forms.Button(); this.btnTestScrapFunction = new System.Windows.Forms.Button();
this.lblStockRows = new System.Windows.Forms.Label(); this.btnReloadShares = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.chbShowBrowser = new System.Windows.Forms.CheckBox(); this.chbShowBrowser = new System.Windows.Forms.CheckBox();
this.gbStockMgmnt = new System.Windows.Forms.GroupBox(); this.gbStockMgmnt = new System.Windows.Forms.GroupBox();
this.btnStockSale = new System.Windows.Forms.Button(); this.btnStockSale = new System.Windows.Forms.Button();
@ -46,6 +45,7 @@ namespace StockInfo
this.btnStockReg = new System.Windows.Forms.Button(); this.btnStockReg = new System.Windows.Forms.Button();
this.sfdSaver = new System.Windows.Forms.SaveFileDialog(); this.sfdSaver = new System.Windows.Forms.SaveFileDialog();
this.ofdOpener = new System.Windows.Forms.OpenFileDialog(); this.ofdOpener = new System.Windows.Forms.OpenFileDialog();
this.lblStockRows = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.gB1.SuspendLayout(); this.gB1.SuspendLayout();
this.gbStockMgmnt.SuspendLayout(); this.gbStockMgmnt.SuspendLayout();
@ -60,7 +60,7 @@ namespace StockInfo
this.dataGridView.Location = new System.Drawing.Point(12, 16); this.dataGridView.Location = new System.Drawing.Point(12, 16);
this.dataGridView.Name = "dataGridView"; this.dataGridView.Name = "dataGridView";
this.dataGridView.RowTemplate.Height = 25; this.dataGridView.RowTemplate.Height = 25;
this.dataGridView.Size = new System.Drawing.Size(829, 363); this.dataGridView.Size = new System.Drawing.Size(829, 360);
this.dataGridView.TabIndex = 0; this.dataGridView.TabIndex = 0;
// //
// lblTotalRecords // lblTotalRecords
@ -80,9 +80,9 @@ namespace StockInfo
this.gB1.Controls.Add(this.btnRestoreShares); this.gB1.Controls.Add(this.btnRestoreShares);
this.gB1.Controls.Add(this.btnBackupShares); this.gB1.Controls.Add(this.btnBackupShares);
this.gB1.Controls.Add(this.btnReload); this.gB1.Controls.Add(this.btnReload);
this.gB1.Location = new System.Drawing.Point(157, 388); this.gB1.Location = new System.Drawing.Point(157, 385);
this.gB1.Name = "gB1"; this.gB1.Name = "gB1";
this.gB1.Size = new System.Drawing.Size(264, 123); this.gB1.Size = new System.Drawing.Size(203, 144);
this.gB1.TabIndex = 3; this.gB1.TabIndex = 3;
this.gB1.TabStop = false; this.gB1.TabStop = false;
this.gB1.Text = "Sharelist"; this.gB1.Text = "Sharelist";
@ -90,7 +90,7 @@ namespace StockInfo
// chkEnableBackRes // chkEnableBackRes
// //
this.chkEnableBackRes.AutoSize = true; this.chkEnableBackRes.AutoSize = true;
this.chkEnableBackRes.Location = new System.Drawing.Point(7, 54); this.chkEnableBackRes.Location = new System.Drawing.Point(6, 61);
this.chkEnableBackRes.Name = "chkEnableBackRes"; this.chkEnableBackRes.Name = "chkEnableBackRes";
this.chkEnableBackRes.Size = new System.Drawing.Size(144, 19); this.chkEnableBackRes.Size = new System.Drawing.Size(144, 19);
this.chkEnableBackRes.TabIndex = 5; this.chkEnableBackRes.TabIndex = 5;
@ -100,7 +100,7 @@ namespace StockInfo
// //
// btnRestoreShares // btnRestoreShares
// //
this.btnRestoreShares.Location = new System.Drawing.Point(131, 84); this.btnRestoreShares.Location = new System.Drawing.Point(6, 111);
this.btnRestoreShares.Name = "btnRestoreShares"; this.btnRestoreShares.Name = "btnRestoreShares";
this.btnRestoreShares.Size = new System.Drawing.Size(118, 23); this.btnRestoreShares.Size = new System.Drawing.Size(118, 23);
this.btnRestoreShares.TabIndex = 4; this.btnRestoreShares.TabIndex = 4;
@ -110,7 +110,7 @@ namespace StockInfo
// //
// btnBackupShares // btnBackupShares
// //
this.btnBackupShares.Location = new System.Drawing.Point(7, 84); this.btnBackupShares.Location = new System.Drawing.Point(6, 82);
this.btnBackupShares.Name = "btnBackupShares"; this.btnBackupShares.Name = "btnBackupShares";
this.btnBackupShares.Size = new System.Drawing.Size(118, 23); this.btnBackupShares.Size = new System.Drawing.Size(118, 23);
this.btnBackupShares.TabIndex = 3; this.btnBackupShares.TabIndex = 3;
@ -121,7 +121,7 @@ namespace StockInfo
// btnReload // btnReload
// //
this.btnReload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnReload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnReload.Location = new System.Drawing.Point(6, 22); this.btnReload.Location = new System.Drawing.Point(6, 32);
this.btnReload.Name = "btnReload"; this.btnReload.Name = "btnReload";
this.btnReload.Size = new System.Drawing.Size(112, 23); this.btnReload.Size = new System.Drawing.Size(112, 23);
this.btnReload.TabIndex = 2; this.btnReload.TabIndex = 2;
@ -132,7 +132,7 @@ namespace StockInfo
// btnTestScrapFunction // btnTestScrapFunction
// //
this.btnTestScrapFunction.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnTestScrapFunction.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnTestScrapFunction.Location = new System.Drawing.Point(12, 439); this.btnTestScrapFunction.Location = new System.Drawing.Point(12, 467);
this.btnTestScrapFunction.Name = "btnTestScrapFunction"; this.btnTestScrapFunction.Name = "btnTestScrapFunction";
this.btnTestScrapFunction.Size = new System.Drawing.Size(75, 23); this.btnTestScrapFunction.Size = new System.Drawing.Size(75, 23);
this.btnTestScrapFunction.TabIndex = 4; this.btnTestScrapFunction.TabIndex = 4;
@ -140,31 +140,22 @@ namespace StockInfo
this.btnTestScrapFunction.UseVisualStyleBackColor = true; this.btnTestScrapFunction.UseVisualStyleBackColor = true;
this.btnTestScrapFunction.Click += new System.EventHandler(this.btnTestScrapFunction_Click); this.btnTestScrapFunction.Click += new System.EventHandler(this.btnTestScrapFunction_Click);
// //
// lblStockRows // btnReloadShares
// //
this.lblStockRows.AutoSize = true; this.btnReloadShares.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblStockRows.Location = new System.Drawing.Point(93, 456); this.btnReloadShares.Location = new System.Drawing.Point(12, 417);
this.lblStockRows.Name = "lblStockRows"; this.btnReloadShares.Name = "btnReloadShares";
this.lblStockRows.Size = new System.Drawing.Size(14, 15); this.btnReloadShares.Size = new System.Drawing.Size(75, 23);
this.lblStockRows.TabIndex = 5; this.btnReloadShares.TabIndex = 6;
this.lblStockRows.Text = "#"; this.btnReloadShares.Text = "ReLoad";
// this.btnReloadShares.UseVisualStyleBackColor = true;
// button1 this.btnReloadShares.Click += new System.EventHandler(this.btnReloadShares_Click);
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.Location = new System.Drawing.Point(12, 410);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 6;
this.button1.Text = "ReLoad";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
// //
// chbShowBrowser // chbShowBrowser
// //
this.chbShowBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.chbShowBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chbShowBrowser.AutoSize = true; this.chbShowBrowser.AutoSize = true;
this.chbShowBrowser.Location = new System.Drawing.Point(12, 474); this.chbShowBrowser.Location = new System.Drawing.Point(12, 497);
this.chbShowBrowser.Name = "chbShowBrowser"; this.chbShowBrowser.Name = "chbShowBrowser";
this.chbShowBrowser.Size = new System.Drawing.Size(100, 22); this.chbShowBrowser.Size = new System.Drawing.Size(100, 22);
this.chbShowBrowser.TabIndex = 7; this.chbShowBrowser.TabIndex = 7;
@ -178,9 +169,9 @@ namespace StockInfo
this.gbStockMgmnt.Controls.Add(this.btnStockSale); this.gbStockMgmnt.Controls.Add(this.btnStockSale);
this.gbStockMgmnt.Controls.Add(this.btnValueView); this.gbStockMgmnt.Controls.Add(this.btnValueView);
this.gbStockMgmnt.Controls.Add(this.btnStockReg); this.gbStockMgmnt.Controls.Add(this.btnStockReg);
this.gbStockMgmnt.Location = new System.Drawing.Point(427, 388); this.gbStockMgmnt.Location = new System.Drawing.Point(366, 385);
this.gbStockMgmnt.Name = "gbStockMgmnt"; this.gbStockMgmnt.Name = "gbStockMgmnt";
this.gbStockMgmnt.Size = new System.Drawing.Size(257, 123); this.gbStockMgmnt.Size = new System.Drawing.Size(216, 144);
this.gbStockMgmnt.TabIndex = 8; this.gbStockMgmnt.TabIndex = 8;
this.gbStockMgmnt.TabStop = false; this.gbStockMgmnt.TabStop = false;
this.gbStockMgmnt.Text = "Working"; this.gbStockMgmnt.Text = "Working";
@ -188,7 +179,7 @@ namespace StockInfo
// btnStockSale // btnStockSale
// //
this.btnStockSale.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnStockSale.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStockSale.Location = new System.Drawing.Point(108, 22); this.btnStockSale.Location = new System.Drawing.Point(108, 82);
this.btnStockSale.Name = "btnStockSale"; this.btnStockSale.Name = "btnStockSale";
this.btnStockSale.Size = new System.Drawing.Size(96, 23); this.btnStockSale.Size = new System.Drawing.Size(96, 23);
this.btnStockSale.TabIndex = 2; this.btnStockSale.TabIndex = 2;
@ -199,7 +190,7 @@ namespace StockInfo
// btnValueView // btnValueView
// //
this.btnValueView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnValueView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnValueView.Location = new System.Drawing.Point(7, 51); this.btnValueView.Location = new System.Drawing.Point(6, 32);
this.btnValueView.Name = "btnValueView"; this.btnValueView.Name = "btnValueView";
this.btnValueView.Size = new System.Drawing.Size(95, 23); this.btnValueView.Size = new System.Drawing.Size(95, 23);
this.btnValueView.TabIndex = 1; this.btnValueView.TabIndex = 1;
@ -210,7 +201,7 @@ namespace StockInfo
// btnStockReg // btnStockReg
// //
this.btnStockReg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnStockReg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStockReg.Location = new System.Drawing.Point(6, 22); this.btnStockReg.Location = new System.Drawing.Point(6, 82);
this.btnStockReg.Name = "btnStockReg"; this.btnStockReg.Name = "btnStockReg";
this.btnStockReg.Size = new System.Drawing.Size(96, 23); this.btnStockReg.Size = new System.Drawing.Size(96, 23);
this.btnStockReg.TabIndex = 0; this.btnStockReg.TabIndex = 0;
@ -222,15 +213,23 @@ namespace StockInfo
// //
this.ofdOpener.FileName = "openFileDialog1"; this.ofdOpener.FileName = "openFileDialog1";
// //
// lblStockRows
//
this.lblStockRows.AutoSize = true;
this.lblStockRows.Location = new System.Drawing.Point(13, 446);
this.lblStockRows.Name = "lblStockRows";
this.lblStockRows.Size = new System.Drawing.Size(0, 15);
this.lblStockRows.TabIndex = 9;
//
// frmInitial // frmInitial
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(853, 520); this.ClientSize = new System.Drawing.Size(853, 538);
this.Controls.Add(this.lblStockRows);
this.Controls.Add(this.gbStockMgmnt); this.Controls.Add(this.gbStockMgmnt);
this.Controls.Add(this.chbShowBrowser); this.Controls.Add(this.chbShowBrowser);
this.Controls.Add(this.button1); this.Controls.Add(this.btnReloadShares);
this.Controls.Add(this.lblStockRows);
this.Controls.Add(this.btnTestScrapFunction); this.Controls.Add(this.btnTestScrapFunction);
this.Controls.Add(this.gB1); this.Controls.Add(this.gB1);
this.Controls.Add(this.lblTotalRecords); this.Controls.Add(this.lblTotalRecords);
@ -257,8 +256,7 @@ namespace StockInfo
private System.Windows.Forms.GroupBox gB1; private System.Windows.Forms.GroupBox gB1;
private System.Windows.Forms.Button btnReload; private System.Windows.Forms.Button btnReload;
private System.Windows.Forms.Button btnTestScrapFunction; private System.Windows.Forms.Button btnTestScrapFunction;
private System.Windows.Forms.Label lblStockRows; private System.Windows.Forms.Button btnReloadShares;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox chbShowBrowser; private System.Windows.Forms.CheckBox chbShowBrowser;
private System.Windows.Forms.GroupBox gbStockMgmnt; private System.Windows.Forms.GroupBox gbStockMgmnt;
private System.Windows.Forms.Button btnStockReg; private System.Windows.Forms.Button btnStockReg;
@ -269,6 +267,7 @@ namespace StockInfo
private System.Windows.Forms.Button btnBackupShares; private System.Windows.Forms.Button btnBackupShares;
private System.Windows.Forms.SaveFileDialog sfdSaver; private System.Windows.Forms.SaveFileDialog sfdSaver;
private System.Windows.Forms.OpenFileDialog ofdOpener; private System.Windows.Forms.OpenFileDialog ofdOpener;
private System.Windows.Forms.Label lblStockRows;
} }
} }

View File

@ -36,6 +36,7 @@ namespace StockInfo
ReloadData(); ReloadData();
btnRestoreShares.Enabled = false; btnRestoreShares.Enabled = false;
btnBackupShares.Enabled = false; btnBackupShares.Enabled = false;
btnReloadShares.Enabled = false;
} }
private void ReloadData() private void ReloadData()
@ -57,6 +58,7 @@ namespace StockInfo
_stockMarketRepository.LoadStockMarketList(chbShowBrowser.Checked); _stockMarketRepository.LoadStockMarketList(chbShowBrowser.Checked);
var stocklist = _stockMarketRepository.StockMarketList; var stocklist = _stockMarketRepository.StockMarketList;
lblStockRows.Text = stocklist.Count().ToString(); lblStockRows.Text = stocklist.Count().ToString();
btnReloadShares.Enabled = true;
} }
private void frmInitial_FormClosing(object sender, FormClosingEventArgs e) private void frmInitial_FormClosing(object sender, FormClosingEventArgs e)
@ -64,7 +66,9 @@ namespace StockInfo
_stockMarketRepository.Clean(); _stockMarketRepository.Clean();
} }
private void button1_Click(object sender, EventArgs e)
private void Button1reload()
{ {
lblStockRows.Text = ""; lblStockRows.Text = "";
_stockMarketRepository.RefreshMarketList(); _stockMarketRepository.RefreshMarketList();
@ -147,5 +151,10 @@ namespace StockInfo
_stockRepository.RestoreStockMembers(stockList); _stockRepository.RestoreStockMembers(stockList);
}; };
} }
private void btnReloadShares_Click(object sender, EventArgs e)
{
Button1reload();
}
} }
} }