Finjusteringar

This commit is contained in:
2021-03-05 10:32:50 +01:00
parent 2841ada2cf
commit bd20b3b9d3
7 changed files with 67 additions and 52 deletions

Binary file not shown.

View File

@ -38,9 +38,9 @@ namespace StockInfo
this.button1 = new System.Windows.Forms.Button();
this.chbShowBrowser = new System.Windows.Forms.CheckBox();
this.gbStockMgmnt = new System.Windows.Forms.GroupBox();
this.btnStockSale = new System.Windows.Forms.Button();
this.btnValueView = new System.Windows.Forms.Button();
this.btnStockReg = new System.Windows.Forms.Button();
this.btnStockSale = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.gB1.SuspendLayout();
this.gbStockMgmnt.SuspendLayout();
@ -48,19 +48,22 @@ namespace StockInfo
//
// dataGridView
//
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(12, 16);
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowTemplate.Height = 25;
this.dataGridView.Size = new System.Drawing.Size(776, 389);
this.dataGridView.Size = new System.Drawing.Size(776, 363);
this.dataGridView.TabIndex = 0;
//
// lblTotalRecords
//
this.lblTotalRecords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTotalRecords.AutoSize = true;
this.lblTotalRecords.Location = new System.Drawing.Point(12, 408);
this.lblTotalRecords.Location = new System.Drawing.Point(12, 385);
this.lblTotalRecords.Name = "lblTotalRecords";
this.lblTotalRecords.Size = new System.Drawing.Size(98, 15);
this.lblTotalRecords.TabIndex = 2;
@ -68,8 +71,10 @@ namespace StockInfo
//
// gB1
//
this.gB1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gB1.Controls.Add(this.btnReload);
this.gB1.Location = new System.Drawing.Point(157, 411);
this.gB1.Location = new System.Drawing.Point(157, 388);
this.gB1.Name = "gB1";
this.gB1.Size = new System.Drawing.Size(248, 35);
this.gB1.TabIndex = 3;
@ -77,17 +82,21 @@ namespace StockInfo
//
// btnReload
//
this.btnReload.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnReload.Location = new System.Drawing.Point(0, 9);
this.btnReload.Name = "btnReload";
this.btnReload.Size = new System.Drawing.Size(75, 23);
this.btnReload.Size = new System.Drawing.Size(112, 23);
this.btnReload.TabIndex = 2;
this.btnReload.Text = "Reload";
this.btnReload.Text = "Reload Share list";
this.btnReload.UseVisualStyleBackColor = true;
this.btnReload.Click += new System.EventHandler(this.btnReload_Click);
//
// btnTestScrapFunction
//
this.btnTestScrapFunction.Location = new System.Drawing.Point(12, 452);
this.btnTestScrapFunction.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnTestScrapFunction.Location = new System.Drawing.Point(12, 429);
this.btnTestScrapFunction.Name = "btnTestScrapFunction";
this.btnTestScrapFunction.Size = new System.Drawing.Size(75, 23);
this.btnTestScrapFunction.TabIndex = 4;
@ -106,9 +115,11 @@ namespace StockInfo
//
// button1
//
this.button1.Location = new System.Drawing.Point(157, 452);
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(157, 429);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.Size = new System.Drawing.Size(112, 23);
this.button1.TabIndex = 6;
this.button1.Text = "ReLoad";
this.button1.UseVisualStyleBackColor = true;
@ -116,8 +127,10 @@ namespace StockInfo
//
// chbShowBrowser
//
this.chbShowBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.chbShowBrowser.AutoSize = true;
this.chbShowBrowser.Location = new System.Drawing.Point(12, 478);
this.chbShowBrowser.Location = new System.Drawing.Point(12, 455);
this.chbShowBrowser.Name = "chbShowBrowser";
this.chbShowBrowser.Size = new System.Drawing.Size(100, 22);
this.chbShowBrowser.TabIndex = 7;
@ -127,17 +140,33 @@ namespace StockInfo
//
// gbStockMgmnt
//
this.gbStockMgmnt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gbStockMgmnt.Controls.Add(this.btnStockSale);
this.gbStockMgmnt.Controls.Add(this.btnValueView);
this.gbStockMgmnt.Controls.Add(this.btnStockReg);
this.gbStockMgmnt.Location = new System.Drawing.Point(411, 411);
this.gbStockMgmnt.Location = new System.Drawing.Point(411, 388);
this.gbStockMgmnt.Name = "gbStockMgmnt";
this.gbStockMgmnt.Size = new System.Drawing.Size(257, 123);
this.gbStockMgmnt.TabIndex = 8;
this.gbStockMgmnt.TabStop = false;
//
// btnStockSale
//
this.btnStockSale.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnStockSale.Location = new System.Drawing.Point(108, 9);
this.btnStockSale.Name = "btnStockSale";
this.btnStockSale.Size = new System.Drawing.Size(96, 23);
this.btnStockSale.TabIndex = 2;
this.btnStockSale.Text = "Stock Sell";
this.btnStockSale.UseVisualStyleBackColor = true;
this.btnStockSale.Click += new System.EventHandler(this.btnStockSale_Click);
//
// btnValueView
//
this.btnValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnValueView.Location = new System.Drawing.Point(7, 39);
this.btnValueView.Name = "btnValueView";
this.btnValueView.Size = new System.Drawing.Size(95, 23);
@ -148,6 +177,8 @@ namespace StockInfo
//
// btnStockReg
//
this.btnStockReg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnStockReg.Location = new System.Drawing.Point(6, 9);
this.btnStockReg.Name = "btnStockReg";
this.btnStockReg.Size = new System.Drawing.Size(96, 23);
@ -156,21 +187,11 @@ namespace StockInfo
this.btnStockReg.UseVisualStyleBackColor = true;
this.btnStockReg.Click += new System.EventHandler(this.btnStockReg_Click);
//
// btnStockSale
//
this.btnStockSale.Location = new System.Drawing.Point(108, 9);
this.btnStockSale.Name = "btnStockSale";
this.btnStockSale.Size = new System.Drawing.Size(96, 23);
this.btnStockSale.TabIndex = 2;
this.btnStockSale.Text = "Stock Sell";
this.btnStockSale.UseVisualStyleBackColor = true;
this.btnStockSale.Click += new System.EventHandler(this.btnStockSale_Click);
//
// frmInitial
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 546);
this.ClientSize = new System.Drawing.Size(800, 520);
this.Controls.Add(this.gbStockMgmnt);
this.Controls.Add(this.chbShowBrowser);
this.Controls.Add(this.button1);
@ -182,7 +203,7 @@ namespace StockInfo
this.MinimizeBox = false;
this.Name = "frmInitial";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Repository Pattern";
this.Text = "Stock Overview";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmInitial_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();

View File

@ -42,31 +42,6 @@ namespace StockInfo
lblTotalRecords.Text = $"Total records: {dataGridView.RowCount}";
}
//private static async void SaveStocks(IEnumerable<DataDomain.StockMember> allStocks)
//{
// allStocks.ToList().ForEach(async s => await StockProcessor.SaveStockMember(new ApiClient.StockMember
// {
// ActAmount = s.ActAmount,
// ActDate = s.ActDate,
// ActValue = (double)s.ActValue,
// BuyDate = s.BuyDate,
// BuyValue = (double)s.BuyValue,
// Comment = s.Comment,
// PostAmount = s.PostAmount,
// SoldDate = s.SoldDate,
// SoldValue = (double)s.SoldValue,
// StockExtId = s.StockExtId,
// StockId = s.StockId
// }));
//}
//private async void GetApiStocks()
//{
// dataGridView.DataSource = await StockProcessor.LoadStocksInformation();
//}
private void btnReload_Click(object sender, EventArgs e)
{

View File

@ -55,7 +55,7 @@ namespace StockInfo
_stockRepository.UpdateActualPrice(stock.Id, stock.ActValue);
tmpStocks.Add(stock);
}
foreach(var stk in tmpStocks.OrderByDescending(s => s.PostAmount * (s.ActValue -s.BuyValue)))
foreach(var stk in tmpStocks.OrderByDescending(s => s.ActAmount * (s.ActValue -s.BuyValue)))
{
AddItemToListView(stk);
}
@ -109,7 +109,7 @@ namespace StockInfo
//currValue.ForeColor = valueLevel > 5 ? Color.Red : saveBcolor;
var priceDiff = currStock.ActValue - currStock.BuyValue;
lv.SubItems.Add(priceDiff.ToString());
lv.SubItems.Add(currStock.PostAmount.ToString());
lv.SubItems.Add(currStock.ActAmount.ToString());
lv.SubItems.Add(currStock.BuyDate.ToString());
var buyValue = currStock.PostAmount * currStock.BuyValue;
var actValue = currStock.PostAmount * currStock.ActValue;

View File

@ -63,6 +63,7 @@ namespace StockInfo
this.label8 = new System.Windows.Forms.Label();
this.txtSoldDate = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
this.gbInfo.SuspendLayout();
this.gbSell.SuspendLayout();
this.SuspendLayout();
@ -379,11 +380,22 @@ namespace StockInfo
this.label7.TabIndex = 2;
this.label7.Text = "Sold Date";
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(417, 440);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 3;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// frmSelling
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(544, 450);
this.ClientSize = new System.Drawing.Size(543, 478);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.gbSell);
this.Controls.Add(this.gbInfo);
this.Controls.Add(this.lvSellCandidates);
@ -435,5 +447,6 @@ namespace StockInfo
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtGainLoose;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button btnClose;
}
}

View File

@ -132,5 +132,11 @@ namespace StockInfo
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}