små justeringar i visningen av aktiehistorien
This commit is contained in:
@ -61,7 +61,7 @@ public class StockEquityServices : IStockEquityServices
|
|||||||
|
|
||||||
if (note.TransactionType == null && note.StockCode != null) { }
|
if (note.TransactionType == null && note.StockCode != null) { }
|
||||||
else
|
else
|
||||||
|
{
|
||||||
// Kontrollera om TransactionType är en köpnotering
|
// Kontrollera om TransactionType är en köpnotering
|
||||||
// (ignorera null-värden)
|
// (ignorera null-värden)
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ public class StockEquityServices : IStockEquityServices
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
47
StockHistory/frmStockHistoryAnalyse.Designer.cs
generated
47
StockHistory/frmStockHistoryAnalyse.Designer.cs
generated
@ -35,17 +35,17 @@
|
|||||||
lwStocks = new ListView();
|
lwStocks = new ListView();
|
||||||
chStock = new ColumnHeader();
|
chStock = new ColumnHeader();
|
||||||
chBought = new ColumnHeader();
|
chBought = new ColumnHeader();
|
||||||
chPrize = new ColumnHeader();
|
|
||||||
chNumber = new ColumnHeader();
|
chNumber = new ColumnHeader();
|
||||||
|
chPrize = new ColumnHeader();
|
||||||
chValue = new ColumnHeader();
|
chValue = new ColumnHeader();
|
||||||
lblTotalValue = new Label();
|
lblTotalValue = new Label();
|
||||||
lwStockHistory = new ListView();
|
lwStockHistory = new ListView();
|
||||||
histDatum = new ColumnHeader();
|
histAktie = new ColumnHeader();
|
||||||
histKöptSålt = new ColumnHeader();
|
histKöptSålt = new ColumnHeader();
|
||||||
histAntal = new ColumnHeader();
|
histAntal = new ColumnHeader();
|
||||||
histPris = new ColumnHeader();
|
histPris = new ColumnHeader();
|
||||||
histTotBelopp = new ColumnHeader();
|
histTotBelopp = new ColumnHeader();
|
||||||
columnHeader1 = new ColumnHeader();
|
histType = new ColumnHeader();
|
||||||
btnStockHistory = new Button();
|
btnStockHistory = new Button();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -97,7 +97,7 @@
|
|||||||
//
|
//
|
||||||
// lwStocks
|
// lwStocks
|
||||||
//
|
//
|
||||||
lwStocks.Columns.AddRange(new ColumnHeader[] { chStock, chBought, chPrize, chNumber, chValue });
|
lwStocks.Columns.AddRange(new ColumnHeader[] { chStock, chBought, chNumber, chPrize, chValue });
|
||||||
lwStocks.FullRowSelect = true;
|
lwStocks.FullRowSelect = true;
|
||||||
lwStocks.Location = new Point(111, 103);
|
lwStocks.Location = new Point(111, 103);
|
||||||
lwStocks.Name = "lwStocks";
|
lwStocks.Name = "lwStocks";
|
||||||
@ -115,21 +115,25 @@
|
|||||||
// chBought
|
// chBought
|
||||||
//
|
//
|
||||||
chBought.Text = "Köpt";
|
chBought.Text = "Köpt";
|
||||||
chBought.Width = 100;
|
chBought.Width = 120;
|
||||||
//
|
|
||||||
// chPrize
|
|
||||||
//
|
|
||||||
chPrize.Text = "Köpkurs";
|
|
||||||
chPrize.Width = 100;
|
|
||||||
//
|
//
|
||||||
// chNumber
|
// chNumber
|
||||||
//
|
//
|
||||||
|
chNumber.DisplayIndex = 3;
|
||||||
chNumber.Text = "Antal";
|
chNumber.Text = "Antal";
|
||||||
chNumber.Width = 100;
|
chNumber.TextAlign = HorizontalAlignment.Right;
|
||||||
|
//
|
||||||
|
// chPrize
|
||||||
|
//
|
||||||
|
chPrize.DisplayIndex = 2;
|
||||||
|
chPrize.Text = "Köpkurs";
|
||||||
|
chPrize.TextAlign = HorizontalAlignment.Right;
|
||||||
|
chPrize.Width = 100;
|
||||||
//
|
//
|
||||||
// chValue
|
// chValue
|
||||||
//
|
//
|
||||||
chValue.Text = "Total";
|
chValue.Text = "Total";
|
||||||
|
chValue.TextAlign = HorizontalAlignment.Right;
|
||||||
chValue.Width = 90;
|
chValue.Width = 90;
|
||||||
//
|
//
|
||||||
// lblTotalValue
|
// lblTotalValue
|
||||||
@ -144,7 +148,7 @@
|
|||||||
//
|
//
|
||||||
// lwStockHistory
|
// lwStockHistory
|
||||||
//
|
//
|
||||||
lwStockHistory.Columns.AddRange(new ColumnHeader[] { histDatum, histKöptSålt, histAntal, histPris, histTotBelopp, columnHeader1 });
|
lwStockHistory.Columns.AddRange(new ColumnHeader[] { histAktie, histKöptSålt, histAntal, histPris, histTotBelopp, histType });
|
||||||
lwStockHistory.Location = new Point(113, 311);
|
lwStockHistory.Location = new Point(113, 311);
|
||||||
lwStockHistory.Name = "lwStockHistory";
|
lwStockHistory.Name = "lwStockHistory";
|
||||||
lwStockHistory.Size = new Size(676, 153);
|
lwStockHistory.Size = new Size(676, 153);
|
||||||
@ -152,25 +156,36 @@
|
|||||||
lwStockHistory.UseCompatibleStateImageBehavior = false;
|
lwStockHistory.UseCompatibleStateImageBehavior = false;
|
||||||
lwStockHistory.View = View.Details;
|
lwStockHistory.View = View.Details;
|
||||||
//
|
//
|
||||||
// histDatum
|
// histAktie
|
||||||
//
|
//
|
||||||
histDatum.Text = "Datum";
|
histAktie.Text = "Aktie";
|
||||||
|
histAktie.Width = 100;
|
||||||
//
|
//
|
||||||
// histKöptSålt
|
// histKöptSålt
|
||||||
//
|
//
|
||||||
histKöptSålt.Text = "Köpt/Sålt";
|
histKöptSålt.Text = "Köpt/Sålt";
|
||||||
|
histKöptSålt.Width = 120;
|
||||||
//
|
//
|
||||||
// histAntal
|
// histAntal
|
||||||
//
|
//
|
||||||
histAntal.Text = "Antal";
|
histAntal.Text = "Antal";
|
||||||
|
histAntal.TextAlign = HorizontalAlignment.Right;
|
||||||
//
|
//
|
||||||
// histPris
|
// histPris
|
||||||
//
|
//
|
||||||
histPris.Text = "Betalt/Erhållit";
|
histPris.Text = "Betalt/Erhållit";
|
||||||
|
histPris.TextAlign = HorizontalAlignment.Right;
|
||||||
|
histPris.Width = 100;
|
||||||
//
|
//
|
||||||
// histTotBelopp
|
// histTotBelopp
|
||||||
//
|
//
|
||||||
histTotBelopp.Text = "Summa";
|
histTotBelopp.Text = "Summa";
|
||||||
|
histTotBelopp.TextAlign = HorizontalAlignment.Right;
|
||||||
|
histTotBelopp.Width = 100;
|
||||||
|
//
|
||||||
|
// histType
|
||||||
|
//
|
||||||
|
histType.Text = "K/S/B";
|
||||||
//
|
//
|
||||||
// btnStockHistory
|
// btnStockHistory
|
||||||
//
|
//
|
||||||
@ -220,11 +235,11 @@
|
|||||||
private ColumnHeader chValue;
|
private ColumnHeader chValue;
|
||||||
private ListView lwStockHistory;
|
private ListView lwStockHistory;
|
||||||
private Button btnStockHistory;
|
private Button btnStockHistory;
|
||||||
private ColumnHeader histDatum;
|
private ColumnHeader histAktie;
|
||||||
private ColumnHeader histKöptSålt;
|
private ColumnHeader histKöptSålt;
|
||||||
private ColumnHeader histAntal;
|
private ColumnHeader histAntal;
|
||||||
private ColumnHeader histPris;
|
private ColumnHeader histPris;
|
||||||
private ColumnHeader histTotBelopp;
|
private ColumnHeader histTotBelopp;
|
||||||
private ColumnHeader columnHeader1;
|
private ColumnHeader histType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,15 +58,15 @@ public partial class frmStockHistoryAnalyse : Form
|
|||||||
{
|
{
|
||||||
var item = new ListViewItem(equityTemp.StockCode);
|
var item = new ListViewItem(equityTemp.StockCode);
|
||||||
item.SubItems.Add(equityTemp.Bought.ToString());
|
item.SubItems.Add(equityTemp.Bought.ToString());
|
||||||
item.SubItems.Add(equityTemp.BoughtPrice.ToString());
|
|
||||||
item.SubItems.Add(equityTemp.Quantity.ToString());
|
item.SubItems.Add(equityTemp.Quantity.ToString());
|
||||||
|
item.SubItems.Add(equityTemp.BoughtPrice.ToString());
|
||||||
item.SubItems.Add((equityTemp.TotalValue).ToString("C"));
|
item.SubItems.Add((equityTemp.TotalValue).ToString("C"));
|
||||||
lwStocks.Items.Add(item);
|
lwStocks.Items.Add(item);
|
||||||
}
|
}
|
||||||
equityTemp.StockCode = t.StockCode;
|
equityTemp.StockCode = t.StockCode;
|
||||||
equityTemp.Bought = t.Bought;
|
equityTemp.Bought = t.Bought;
|
||||||
equityTemp.BoughtPrice = t.BoughtPrice;
|
|
||||||
equityTemp.Quantity = t.Quantity;
|
equityTemp.Quantity = t.Quantity;
|
||||||
|
equityTemp.BoughtPrice = t.BoughtPrice;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -81,8 +81,8 @@ public partial class frmStockHistoryAnalyse : Form
|
|||||||
}
|
}
|
||||||
var l_item = new ListViewItem(equityTemp.StockCode);
|
var l_item = new ListViewItem(equityTemp.StockCode);
|
||||||
l_item.SubItems.Add(equityTemp.Bought.ToString());
|
l_item.SubItems.Add(equityTemp.Bought.ToString());
|
||||||
l_item.SubItems.Add(equityTemp.BoughtPrice.ToString());
|
|
||||||
l_item.SubItems.Add(equityTemp.Quantity.ToString());
|
l_item.SubItems.Add(equityTemp.Quantity.ToString());
|
||||||
|
l_item.SubItems.Add(equityTemp.BoughtPrice.ToString());
|
||||||
l_item.SubItems.Add((equityTemp.TotalValue).ToString("C"));
|
l_item.SubItems.Add((equityTemp.TotalValue).ToString("C"));
|
||||||
lwStocks.Items.Add(l_item);
|
lwStocks.Items.Add(l_item);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ public partial class frmStockHistoryAnalyse : Form
|
|||||||
LoadHistoryRecsAsync(item.Text).Wait();
|
LoadHistoryRecsAsync(item.Text).Wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private async Task LoadHistoryRecsAsync(string stockName)
|
private async Task LoadHistoryRecsAsync(string stockName) //, DateTime equityDate)
|
||||||
{
|
{
|
||||||
//MessageBox.Show("Du klickade på: " + item.Text);
|
//MessageBox.Show("Du klickade på: " + item.Text);
|
||||||
var result = _equityServices.GetByCodeAsync(stockName);
|
var result = _equityServices.GetByCodeAsync(stockName);
|
||||||
@ -121,11 +121,12 @@ public partial class frmStockHistoryAnalyse : Form
|
|||||||
{
|
{
|
||||||
var l_item = new ListViewItem(histRec.StockCode);
|
var l_item = new ListViewItem(histRec.StockCode);
|
||||||
l_item.SubItems.Add(histRec.Bought.ToString());
|
l_item.SubItems.Add(histRec.Bought.ToString());
|
||||||
l_item.SubItems.Add(histRec.BoughtPrice.ToString());
|
|
||||||
l_item.SubItems.Add(histRec.Quantity.ToString());
|
l_item.SubItems.Add(histRec.Quantity.ToString());
|
||||||
|
l_item.SubItems.Add(histRec.BoughtPrice.ToString());
|
||||||
Debug.WriteLine(histRec.ToString());
|
Debug.WriteLine(histRec.ToString());
|
||||||
var totval = (histRec.SoldQuant > 0) ? histRec.SoldQuant * histRec.SoldPrice - histRec.BoughtPrice * histRec.Quantity : histRec.BoughtPrice * histRec.Quantity;
|
var totval = (histRec.SoldQuant > 0) ? histRec.SoldQuant * histRec.SoldPrice - histRec.BoughtPrice * histRec.Quantity : histRec.BoughtPrice * histRec.Quantity;
|
||||||
l_item.SubItems.Add((totval).ToString("C"));
|
l_item.SubItems.Add((totval).ToString("C"));
|
||||||
|
l_item.SubItems.Add((histRec.SoldQuant > 0) ? "B" : "K");
|
||||||
lwStockHistory.Items.Add(l_item);
|
lwStockHistory.Items.Add(l_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user