From bd20b3b9d36d9b79760fd8f9cccc2855e449d437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Fri, 5 Mar 2021 10:32:50 +0100 Subject: [PATCH] Finjusteringar --- StockInfo/Stocks.db-shm | Bin 32768 -> 0 bytes StockInfo/Stocks.db-wal | 0 StockInfo/frmInitial.Designer.cs | 69 ++++++++++++++++++++----------- StockInfo/frmInitial.cs | 25 ----------- StockInfo/frmMyStocks.cs | 4 +- StockInfo/frmSelling.Designer.cs | 15 ++++++- StockInfo/frmSelling.cs | 6 +++ 7 files changed, 67 insertions(+), 52 deletions(-) delete mode 100644 StockInfo/Stocks.db-shm delete mode 100644 StockInfo/Stocks.db-wal diff --git a/StockInfo/Stocks.db-shm b/StockInfo/Stocks.db-shm deleted file mode 100644 index fe9ac2845eca6fe6da8a63cd096d9cf9e24ece10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIuAr62r3 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) { diff --git a/StockInfo/frmMyStocks.cs b/StockInfo/frmMyStocks.cs index 726db6c..06def74 100644 --- a/StockInfo/frmMyStocks.cs +++ b/StockInfo/frmMyStocks.cs @@ -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; diff --git a/StockInfo/frmSelling.Designer.cs b/StockInfo/frmSelling.Designer.cs index 5481b35..f91f870 100644 --- a/StockInfo/frmSelling.Designer.cs +++ b/StockInfo/frmSelling.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/StockInfo/frmSelling.cs b/StockInfo/frmSelling.cs index cc8af3c..cf4eaa2 100644 --- a/StockInfo/frmSelling.cs +++ b/StockInfo/frmSelling.cs @@ -132,5 +132,11 @@ namespace StockInfo } } + + private void btnClose_Click(object sender, EventArgs e) + { + this.Close(); + } + } }