2024-02-24
This commit is contained in:
parent
3552246c8d
commit
60f570c947
BIN
Websites/SharePrices/.vs/SharePrices/v16/.suo
Normal file
BIN
Websites/SharePrices/.vs/SharePrices/v16/.suo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -180,14 +180,25 @@ Public Class DataAccessLayer
|
||||
' DeleteHolding = DataReaderToJSONString(c.ExecuteReader())
|
||||
' DisposeSQLCommand(c)
|
||||
'End Function
|
||||
Public Shared Function SoldHolding(HoldingID As Integer, SoldDate As DateTime) As String
|
||||
Public Shared Function SoldHolding(HoldingID As Integer, SoldDate As DateTime, SoldCurrency As String, SoldProceeds As Double) As String
|
||||
Dim c As SqlCommand = GetSQLCommand("usp_SoldHolding")
|
||||
c.Parameters.AddWithValue("HoldingID", HoldingID)
|
||||
c.Parameters.AddWithValue("SoldDate", SoldDate)
|
||||
c.Parameters.AddWithValue("SoldCurrency", SoldCurrency)
|
||||
c.Parameters.AddWithValue("SoldProceeds", SoldProceeds)
|
||||
SoldHolding = DataReaderToJSONString(c.ExecuteReader())
|
||||
DisposeSQLCommand(c)
|
||||
End Function
|
||||
|
||||
Public Shared Function SetAccountCashValue(AccountName As String, Currency As String, Value As Double) As String
|
||||
Dim c As SqlCommand = GetSQLCommand("usp_SetAccountCashValue")
|
||||
c.Parameters.AddWithValue("AccountName", AccountName)
|
||||
c.Parameters.AddWithValue("Currency", Currency)
|
||||
c.Parameters.AddWithValue("Value", Value)
|
||||
SetAccountCashValue = DataReaderToJSONString(c.ExecuteReader())
|
||||
DisposeSQLCommand(c)
|
||||
End Function
|
||||
|
||||
Public Shared Function SwapInstrumentDisplayOrders(Symbol1 As String, Symbol2 As String) As String
|
||||
Dim c As SqlCommand = GetSQLCommand("usp_SwapDisplayOrder")
|
||||
c.Parameters.AddWithValue("Symbol1", Symbol1)
|
||||
@ -196,6 +207,19 @@ Public Class DataAccessLayer
|
||||
DisposeSQLCommand(c)
|
||||
End Function
|
||||
|
||||
Public Shared Function SetTotalHoldingsValues(TotalValue As Double) As String
|
||||
Dim c As SqlCommand = GetSQLCommand("usp_SetTotalHoldingsValue")
|
||||
c.Parameters.AddWithValue("TotalValueGBP", TotalValue)
|
||||
SetTotalHoldingsValues = DataReaderToJSONString(c.ExecuteReader())
|
||||
DisposeSQLCommand(c)
|
||||
End Function
|
||||
|
||||
Public Shared Function GetTotalHoldingsHistory() As String
|
||||
Dim c As SqlCommand = GetSQLCommand("usp_GetTotalHoldingsHistory")
|
||||
GetTotalHoldingsHistory = DataReaderToJSONString(c.ExecuteReader())
|
||||
DisposeSQLCommand(c)
|
||||
End Function
|
||||
|
||||
Private Shared Function GetSQLConnection() As SqlConnection
|
||||
Dim c As New SqlConnection("Server=OZHOST1\SQL2008;Database=SharePrices;Trusted_Connection=True;Application Name=Share Prices Web;")
|
||||
c.Open()
|
||||
|
@ -5,6 +5,8 @@ GO
|
||||
DROP VIEW vErroneousPrices_Intraday
|
||||
DROP VIEW vErroneousPrices_Daily
|
||||
DROP VIEW vHolding
|
||||
DROP FUNCTION dbo.fn_GetExchangeRate
|
||||
DROP FUNCTION dbo.fn_GetPriceAtDate
|
||||
DROP PROCEDURE usp_SwapDisplayOrder
|
||||
DROP PROCEDURE usp_GetHoldingsHistory
|
||||
--DROP PROCEDURE usp_DeleteHolding
|
||||
@ -25,6 +27,7 @@ DROP TABLE Account
|
||||
DROP TABLE InstrumentHistory_Daily
|
||||
DROP TABLE InstrumentHistory_Intraday
|
||||
DROP TABLE Instrument
|
||||
DROP TABLE TotalHoldingsHistory_Daily
|
||||
--DROP TABLE Exchange
|
||||
*/
|
||||
GO
|
||||
@ -67,6 +70,7 @@ CREATE TABLE Instrument (
|
||||
CurrentPrice real NULL,
|
||||
InstrumentType VARCHAR(15) NULL,
|
||||
ShowInMarquee CHAR(1) NULL, -- A = Always, O = Only when open, NULL = Never
|
||||
WatchlistID tinyint NULL, --Not a real ID yet
|
||||
TradeDayStart datetime NULL,
|
||||
TradeDayEnd datetime NULL,
|
||||
LastUpdated datetime NULL,
|
||||
@ -139,15 +143,31 @@ CREATE TABLE Holding (
|
||||
AccountID tinyint NOT NULL,
|
||||
InstrumentID smallint NOT NULL,
|
||||
--NoUnits int NOT NULL,
|
||||
NoUnits real NOT NULL,
|
||||
--NoUnits real NOT NULL,
|
||||
NoUnits numeric(36, 12) NOT NULL,
|
||||
--PurchasePricePerUnit money NOT NULL,
|
||||
PurchasePricePerUnit real NOT NULL,
|
||||
ActualExchangeRate real NULL,
|
||||
--PurchasePricePerUnit real NOT NULL,
|
||||
PurchasePricePerUnit numeric(36, 12) NOT NULL,
|
||||
--ActualExchangeRate real NULL,
|
||||
ActualExchangeRate numeric(36, 12) NULL,
|
||||
PurchaseDate datetime NOT NULL,
|
||||
SoldDate datetime NULL,
|
||||
SoldCurrencyID smallint NULL,
|
||||
SoldProceeds numeric(36, 12) NULL,
|
||||
CONSTRAINT PK_Holding PRIMARY KEY CLUSTERED (HoldingID),
|
||||
CONSTRAINT FK_Holding_Account FOREIGN KEY (AccountID) REFERENCES Account (AccountID),
|
||||
CONSTRAINT FK_Holding_Instrument FOREIGN KEY (InstrumentID) REFERENCES Instrument (InstrumentID)
|
||||
CONSTRAINT FK_Holding_Instrument FOREIGN KEY (InstrumentID) REFERENCES Instrument (InstrumentID),
|
||||
CONSTRAINT FK_Holding_SoldCurrencyInstrument FOREIGN KEY (SoldCurrencyID) REFERENCES Instrument (InstrumentID)
|
||||
)
|
||||
GO
|
||||
|
||||
CREATE TABLE TotalHoldingsHistory_Daily (
|
||||
HistoryDate date NOT NULL,
|
||||
[Open] int NOT NULL,
|
||||
Low int NOT NULL,
|
||||
High int NOT NULL,
|
||||
[Close] int NOT NULL,
|
||||
CONSTRAINT PK_TotalHoldingsHistory_Daily PRIMARY KEY CLUSTERED (HistoryDate)
|
||||
)
|
||||
GO
|
||||
|
||||
@ -227,6 +247,47 @@ BEGIN
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE FUNCTION dbo.fn_GetPriceAtDate(@InstrumentID INT, @DT DATETIME)
|
||||
RETURNS REAL
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @Rate REAL
|
||||
|
||||
IF @InstrumentID IS NULL OR @DT IS NULL
|
||||
BEGIN
|
||||
RETURN 0.0
|
||||
END
|
||||
|
||||
--Is there a rate for this exact datetime?
|
||||
SELECT @Rate = ClosePrice FROM InstrumentHistory_Intraday WHERE InstrumentID = @InstrumentID AND HistoryDT = @DT
|
||||
IF @Rate IS NULL
|
||||
BEGIN
|
||||
--No exect match
|
||||
DECLARE @StartDT DATETIME, @EndDT DATETIME, @StartRate REAL, @EndRate REAL
|
||||
--@StartID INT, @EndID INT,
|
||||
SELECT TOP 1 @StartDT = HistoryDT, @StartRate = ClosePrice FROM InstrumentHistory_Intraday WHERE InstrumentID = @InstrumentID AND HistoryDT < @DT ORDER BY HistoryDT DESC
|
||||
SELECT TOP 1 @EndDT = HistoryDT, @EndRate = OpenPrice FROM InstrumentHistory_Intraday WHERE InstrumentID = @InstrumentID AND HistoryDT > @DT ORDER BY HistoryDT
|
||||
IF @StartDT IS NOT NULL AND @EndDT IS NOT NULL
|
||||
BEGIN
|
||||
--Work out how far between the 2 dates our DT is, and calculate rate accordingly
|
||||
DECLARE @TotalSeconds BIGINT
|
||||
DECLARE @Percent REAL
|
||||
SELECT @TotalSeconds = DATEDIFF(second, @StartDT, @EndDT)
|
||||
SET @Percent = CONVERT(REAL, DATEDIFF(second, @StartDT, @DT)) / @TotalSeconds * 100
|
||||
SET @Rate = @StartRate + ((@EndRate - @StartRate) / 100 * @Percent)
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
--We don't have BOTH a start AND end price
|
||||
--Return the non-NULL rate if we have one, zero otherwise
|
||||
SET @Rate = COALESCE(@StartRate, @EndRate, 0)
|
||||
END
|
||||
END
|
||||
|
||||
RETURN @Rate
|
||||
END
|
||||
GO
|
||||
|
||||
--CREATE PROCEDURE usp_InsertInstrument (@ExchangeShortName varchar(10), @Symbol varchar(7), @FullName varchar(100))
|
||||
CREATE PROCEDURE usp_InsertInstrument (@Symbol varchar(8), @FullName varchar(100))
|
||||
AS
|
||||
@ -350,29 +411,50 @@ BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
i.DisplayOrder,
|
||||
--e.ShortName as [Exchange],
|
||||
i.FullName as [InstrumentName],
|
||||
ISNULL(i.DisplayName, LEFT(i.FullName, 30)) as [DisplayName],
|
||||
i.Symbol as [Symbol],
|
||||
i.PostPandemicDilution as [PostPandemicDilution],
|
||||
i.GMTOffset as [GMTOffset],
|
||||
i.Currency as [Currency],
|
||||
i.CurrentPrice as [CurrentPrice],
|
||||
i.InstrumentType as [InstrumentType],
|
||||
i.ShowInMarquee as [ShowInMarquee],
|
||||
i.TradeDayStart as [SingleDayStartDate],
|
||||
i.TradeDayEnd as [SingleDayEndDate],
|
||||
ISNULL((SELECT MIN(dd.HistoryDT) FROM InstrumentHistory_Daily dd WHERE dd.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '2030-12-31')) as [MinDailyDate],
|
||||
ISNULL((SELECT MAX(dd.HistoryDT) FROM InstrumentHistory_Daily dd WHERE dd.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '1970-01-01')) as [MaxDailyDate],
|
||||
ISNULL((SELECT MIN(id.HistoryDT) FROM InstrumentHistory_Intraday id WHERE id.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '2030-12-31')) as [MinIntradayDate],
|
||||
ISNULL((SELECT MAX(id.HistoryDT) FROM InstrumentHistory_Intraday id WHERE id.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '1970-01-01')) as [MaxIntradayDate]
|
||||
DisplayOrder,
|
||||
[InstrumentName],
|
||||
[DisplayName],
|
||||
[Symbol],
|
||||
[PostPandemicDilution],
|
||||
[GMTOffset],
|
||||
[Currency],
|
||||
[CurrentPrice],
|
||||
[InstrumentType],
|
||||
[ShowInMarquee],
|
||||
[WatchlistID],
|
||||
[SingleDayStartDate],
|
||||
[SingleDayEndDate],
|
||||
[MinDailyDate],
|
||||
[MaxDailyDate],
|
||||
[MinIntradayDate],
|
||||
[MaxIntradayDate],
|
||||
[LastSoldDate],
|
||||
dbo.fn_GetPriceAtDate(dt.InstrumentID, LastSoldDate) as [LastSoldPrice]
|
||||
FROM
|
||||
Instrument i
|
||||
/*INNER JOIN Exchange e
|
||||
ON e.ExchangeID = i.ExchangeID*/
|
||||
(SELECT
|
||||
i.InstrumentID,
|
||||
i.DisplayOrder,
|
||||
i.FullName as [InstrumentName],
|
||||
ISNULL(i.DisplayName, LEFT(i.FullName, 30)) as [DisplayName],
|
||||
i.Symbol as [Symbol],
|
||||
i.PostPandemicDilution as [PostPandemicDilution],
|
||||
i.GMTOffset as [GMTOffset],
|
||||
i.Currency as [Currency],
|
||||
i.CurrentPrice as [CurrentPrice],
|
||||
i.InstrumentType as [InstrumentType],
|
||||
i.ShowInMarquee as [ShowInMarquee],
|
||||
i.WatchlistID as [WatchlistID],
|
||||
i.TradeDayStart as [SingleDayStartDate],
|
||||
i.TradeDayEnd as [SingleDayEndDate],
|
||||
ISNULL((SELECT MIN(dd.HistoryDT) FROM InstrumentHistory_Daily dd WHERE dd.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '2030-12-31')) as [MinDailyDate],
|
||||
ISNULL((SELECT MAX(dd.HistoryDT) FROM InstrumentHistory_Daily dd WHERE dd.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '1970-01-01')) as [MaxDailyDate],
|
||||
ISNULL((SELECT MIN(id.HistoryDT) FROM InstrumentHistory_Intraday id WHERE id.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '2030-12-31')) as [MinIntradayDate],
|
||||
ISNULL((SELECT MAX(id.HistoryDT) FROM InstrumentHistory_Intraday id WHERE id.InstrumentID = i.InstrumentID), CONVERT(DATETIME, '1970-01-01')) as [MaxIntradayDate],
|
||||
(SELECT MAX(h.SoldDate) FROM Holding h WHERE h.InstrumentID = i.InstrumentID AND h.SoldDate IS NOT NULL) as [LastSoldDate]
|
||||
FROM
|
||||
Instrument i) as dt
|
||||
ORDER BY
|
||||
i.DisplayOrder
|
||||
DisplayOrder
|
||||
END
|
||||
GO
|
||||
GRANT EXECUTE ON usp_GetInstruments TO WebApp_Role
|
||||
@ -406,7 +488,7 @@ GO
|
||||
CREATE PROCEDURE usp_GetIntradayData (@Symbol varchar(8), @StartDate datetime, @EndDate datetime)
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @MAX_DAYS INT = 90
|
||||
DECLARE @MAX_DAYS INT = 30
|
||||
|
||||
IF DATEDIFF(dd, @StartDate, @EndDate) > @MAX_DAYS
|
||||
BEGIN
|
||||
@ -761,16 +843,84 @@ GO
|
||||
GRANT EXECUTE ON usp_DeleteHolding TO WebApp_Role
|
||||
GO
|
||||
*/
|
||||
CREATE PROCEDURE usp_SoldHolding (@HoldingID int, @SoldDate datetime)
|
||||
CREATE PROCEDURE usp_SoldHolding (@HoldingID int, @SoldDate datetime, @SoldCurrency varchar(8), @SoldProceeds numeric(36, 12))
|
||||
AS
|
||||
BEGIN
|
||||
UPDATE Holding SET SoldDate = @SoldDate WHERE HoldingID = @HoldingID
|
||||
UPDATE
|
||||
Holding
|
||||
SET
|
||||
SoldDate = @SoldDate,
|
||||
SoldCurrencyID = (SELECT InstrumentID FROM Instrument WHERE Symbol = @SoldCurrency),
|
||||
SoldProceeds = @SoldProceeds
|
||||
WHERE
|
||||
HoldingID = @HoldingID
|
||||
|
||||
SELECT @@ROWCOUNT AS [RecordsUpdated]
|
||||
END
|
||||
GO
|
||||
GRANT EXECUTE ON usp_SoldHolding TO WebApp_Role
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE usp_SetAccountCashValue (@AccountName varchar(20), @Currency varchar(8), @Value numeric(36, 12))
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @AccountID int
|
||||
DECLARE @CurrencyID int
|
||||
|
||||
SELECT @AccountID = AccountID FROM Account WHERE ShortName = @AccountName
|
||||
SELECT @CurrencyID = InstrumentID FROM Instrument WHERE Symbol = @Currency
|
||||
|
||||
|
||||
IF EXISTS (SELECT NULL FROM Holding WHERE AccountID = @AccountID AND InstrumentID = @CurrencyID)
|
||||
BEGIN
|
||||
UPDATE
|
||||
Holding
|
||||
SET
|
||||
NoUnits = @Value
|
||||
WHERE
|
||||
AccountID = @AccountID
|
||||
AND InstrumentID = @CurrencyID
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT Holding (
|
||||
AccountID,
|
||||
InstrumentID,
|
||||
NoUnits,
|
||||
PurchasePricePerUnit,
|
||||
PurchaseDate)
|
||||
VALUES (
|
||||
@AccountID,
|
||||
@CurrencyID,
|
||||
@Value,
|
||||
1.0,
|
||||
'2020-01-01')
|
||||
END
|
||||
|
||||
SELECT
|
||||
h.HoldingID,
|
||||
a.ShortName as [AccountName],
|
||||
i.Symbol as [Symbol],
|
||||
h.PurchaseDate,
|
||||
h.NoUnits,
|
||||
h.PurchasePricePerUnit,
|
||||
ISNULL(h.ActualExchangeRate, dbo.fn_GetExchangeRate(i.Currency, h.PurchaseDate)) as [PurchaseExchangeRate],
|
||||
h.NoUnits * h.PurchasePricePerUnit / ISNULL(h.ActualExchangeRate, dbo.fn_GetExchangeRate(i.Currency, h.PurchaseDate)) as [BookCostGBP],
|
||||
h.SoldDate
|
||||
FROM
|
||||
Holding h
|
||||
INNER JOIN Instrument i
|
||||
ON h.InstrumentID = i.InstrumentID
|
||||
INNER JOIN Account a
|
||||
ON a.AccountID = h.AccountID
|
||||
WHERE
|
||||
a.AccountID = @AccountID
|
||||
AND h.InstrumentID = @CurrencyID
|
||||
END
|
||||
GO
|
||||
GRANT EXECUTE ON usp_SetAccountCashValue TO WebApp_Role
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE usp_SwapDisplayOrder (@Symbol1 varchar(8), @Symbol2 varchar(8))
|
||||
AS
|
||||
BEGIN
|
||||
@ -800,10 +950,82 @@ GO
|
||||
GRANT EXECUTE ON usp_SwapDisplayOrder TO WebApp_Role
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE usp_SetTotalHoldingsValue (@TotalValueGBP money)
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @Rounded INT = CONVERT(int, FLOOR(@TotalValueGBP))
|
||||
DECLARE @EndOfPreviousWeek DATE = DATEADD(day, 1 - DATEPART(weekday, CURRENT_TIMESTAMP), convert(date, CURRENT_TIMESTAMP))
|
||||
DECLARE @PreviousDay DATE = DATEADD(day, -1, CONVERT(DATE, CURRENT_TIMESTAMP))
|
||||
|
||||
IF DATENAME(WEEKDAY, CURRENT_TIMESTAMP) NOT IN ('Saturday', 'Sunday')
|
||||
BEGIN
|
||||
IF EXISTS (SELECT NULL FROM TotalHoldingsHistory_Daily WHERE HistoryDate = CONVERT(date, CURRENT_TIMESTAMP))
|
||||
BEGIN
|
||||
UPDATE
|
||||
TotalHoldingsHistory_Daily
|
||||
SET
|
||||
Low = CASE WHEN @Rounded < Low THEN @Rounded ELSE Low END,
|
||||
High = CASE WHEN @Rounded > High THEN @Rounded ELSE High END,
|
||||
[Close] = @Rounded
|
||||
WHERE
|
||||
HistoryDate = CONVERT(date, CURRENT_TIMESTAMP)
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT TotalHoldingsHistory_Daily (HistoryDate, [Open], Low, High, [Close]) VALUES (CONVERT(date, CURRENT_TIMESTAMP), @Rounded, @Rounded, @Rounded, @Rounded)
|
||||
END
|
||||
END
|
||||
|
||||
SELECT
|
||||
pw.HistoryDate as [PreviousWeekDate],
|
||||
pw.[Close] as [PreviousWeekClose],
|
||||
pd.HistoryDate as [PreviousDay],
|
||||
pd.[Close] as [PreviousClose]
|
||||
FROM
|
||||
(SELECT TOP 1
|
||||
*
|
||||
FROM
|
||||
TotalHoldingsHistory_Daily
|
||||
WHERE
|
||||
HistoryDate <= @EndOfPreviousWeek
|
||||
ORDER BY
|
||||
HistoryDate DESC) as [pw],
|
||||
(SELECT TOP 1
|
||||
*
|
||||
FROM
|
||||
TotalHoldingsHistory_Daily
|
||||
WHERE
|
||||
HistoryDate <= @PreviousDay
|
||||
ORDER BY
|
||||
HistoryDate DESC) as [pd]
|
||||
END
|
||||
GO
|
||||
GRANT EXECUTE ON usp_SetTotalHoldingsValue TO WebApp_Role
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE usp_GetTotalHoldingsHistory
|
||||
AS
|
||||
BEGIN
|
||||
SELECT
|
||||
h.HistoryDate,
|
||||
h.[Open],
|
||||
h.[High],
|
||||
h.[Low],
|
||||
h.[Close]
|
||||
FROM
|
||||
TotalHoldingsHistory_Daily h
|
||||
ORDER BY
|
||||
HistoryDate
|
||||
END
|
||||
GO
|
||||
GRANT EXECUTE ON usp_GetTotalHoldingsHistory TO WebApp_Role
|
||||
GO
|
||||
|
||||
CREATE VIEW vHolding
|
||||
AS
|
||||
SELECT
|
||||
h.HoldingID,
|
||||
i.InstrumentID,
|
||||
a.ShortName as [AccountName],
|
||||
i.Symbol,
|
||||
i.FullName as [InstrumentName],
|
||||
|
@ -26,24 +26,28 @@
|
||||
<script src="scripts/SharePrices.js" type="text/javascript"></script>
|
||||
<script src="scripts/FlotGaps.js" type="text/javascript"></script>
|
||||
|
||||
<script src="scripts/highcharts_9.3.1/highcharts.js" type="text/javascript"></script>
|
||||
<script src="scripts/highcharts_9.3.1/modules/broken-axis.js" type="text/javascript"></script>
|
||||
<!--<script src="scripts/highcharts_9.3.1/highcharts.js" type="text/javascript"></script>!--
|
||||
<!--<script src="scripts/highcharts_9.3.1/modules/broken-axis.js" type="text/javascript"></script>!-->
|
||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/stock/modules/stock.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/broken-axis.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 40%;">
|
||||
<td class="navbarlink" style="width: 35%;">
|
||||
<a id="navCharts" class="activenav" onclick="showTab(this)" data-div="chartDiv">Charts</a>
|
||||
<a id="navCurrentHoldings" onclick="showTab(this);" data-div="holdingsDiv">Holdings</a>
|
||||
<a id="navAccounts" onclick="showTab(this);" data-div="accoountsDiv">Accounts</a>
|
||||
<a id="navAnal" onclick="showTab(this);" data-div="analDiv">Analysis</a>
|
||||
<a id="navHist" onclick="showTab(this); refreshHistoryChart();" data-div="histDiv">History</a>
|
||||
<a id="navLog" onclick="showTab(this);" data-div="logDiv">Log</a>
|
||||
</td>
|
||||
<td style="width: 20%; text-align: center;">
|
||||
<td style="width: 30%; text-align: center;">
|
||||
<span id="spnTotalHoldings"></span>
|
||||
</td>
|
||||
<td style="width: 40%; text-align: right;">
|
||||
<td style="width: 35%; text-align: right;">
|
||||
<span id="spnCurrencies"></span>
|
||||
</td>
|
||||
</tr>
|
||||
@ -74,6 +78,8 @@
|
||||
</div>
|
||||
<div id="holdingsTableDiv">Holdings table</div>
|
||||
<br />
|
||||
<div id="watchlistTableDiv">Watchlist table</div>
|
||||
<br />
|
||||
<table>
|
||||
<tr>
|
||||
<td>Book Cost currencies<div id="divHoldingCurrenciesChart" class="HoldingCurrenciesChart"></div></td>
|
||||
@ -95,6 +101,10 @@
|
||||
<div class="tabParent">
|
||||
<div class="tabContainer" id="analDiv">Analysis</div>
|
||||
</div>
|
||||
<div class="tabParent">
|
||||
<div class="tabContainer" id="histDiv" style="height: 85%;">History Chart</div>
|
||||
<!--<span onclick="refreshHistoryChart();">Refresh Chart</span>!-->
|
||||
</div>
|
||||
<div class="tabParent">
|
||||
<div class="tabContainer" id="logDiv">Log</div>
|
||||
</div>
|
||||
@ -109,6 +119,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="modalChart" class="modal-chart">
|
||||
<div style-"height: 70px;"> </div>
|
||||
<div class="modal-chart-content">
|
||||
<table style="height: 100%; width:100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
|
@ -133,10 +133,16 @@ Public Class SharePrices
|
||||
' SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
'End Sub
|
||||
<WebMethod()>
|
||||
Public Shared Sub SoldHolding(HoldingID As Integer, SoldDate As Int64)
|
||||
Public Shared Sub SoldHolding(HoldingID As Integer, SoldDate As Int64, SoldCurrency As String, SoldProceeds As Double)
|
||||
'Debug.Print(Now().ToString("yyyy-MM-dd HH:mm:ss") + " - SharePrices.SoldHolding webmethod: " + HoldingID.ToString() + ". " + SoldDate.TYoString())
|
||||
|
||||
Dim responseText As String = DataAccessLayer.SoldHolding(HoldingID, FromEpochTime(SoldDate))
|
||||
Dim responseText As String = DataAccessLayer.SoldHolding(HoldingID, FromEpochTime(SoldDate), SoldCurrency, SoldProceeds)
|
||||
SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
End Sub
|
||||
|
||||
<WebMethod()>
|
||||
Public Shared Sub SetAccountCashValue(AccountName As String, Currency As String, Value As Double)
|
||||
Dim responseText As String = DataAccessLayer.SetAccountCashValue(AccountName, Currency, Value)
|
||||
SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
End Sub
|
||||
|
||||
@ -262,6 +268,24 @@ Public Class SharePrices
|
||||
SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
End Sub
|
||||
|
||||
<WebMethod()>
|
||||
Public Shared Sub SetTotalHoldingsValue(TotalValue As Double)
|
||||
Debug.Print(Now().ToString("yyyy-MM-dd HH:mm:ss") + " - SharePrices.SetTotalHoldingsValue webmethod: " + CStr(TotalValue))
|
||||
|
||||
Dim responseText As String = DataAccessLayer.SetTotalHoldingsValues(TotalValue)
|
||||
SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
End Sub
|
||||
|
||||
<WebMethod()>
|
||||
Public Shared Sub GetTotalHoldingsHistory()
|
||||
Debug.Print(Now().ToString("yyyy-MM-dd HH:mm:ss") + " - SharePrices.GetTotalHoldingsHistory")
|
||||
|
||||
Dim responseText As String = DataAccessLayer.GetTotalHoldingsHistory()
|
||||
SetResponseAndCompleteRequest(HttpContext.Current, "application/json", responseText)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,8 +10,10 @@ body { font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; /*margin
|
||||
.navbar { /*overflow: hidden; */background-color: #333; position: fixed; top: 0; /*height: 28px;*/ width: 100%; z-index: 100; /*padding-top: 6px;*/ }
|
||||
.navbar table { border-collapse: collapse; width: 100%; }
|
||||
.navbar td { padding: 4px 0px 4px 0px } /*.navbar td { padding: 7px 0px 7px 0px }*/
|
||||
.navbar a { /*float: left; display: block;*/ color: #f2f2f2; text-align: center; padding: 7px 12px 7px 12px; text-decoration: none; }
|
||||
.navbar a:hover { background: #ddd; color: white; }
|
||||
/*.navbar a { color: #f2f2f2; text-align: center; padding: 7px 12px 7px 12px; text-decoration: none; }
|
||||
.navbar a:hover { background: #ddd; color: white; }*/
|
||||
.navbarlink a { color: #f2f2f2; text-align: center; padding: 7px 12px 7px 12px; text-decoration: none; }
|
||||
.navbarlink a:hover { background: #ddd; color: white; }
|
||||
.navbar label { color: #f2f2f2; }
|
||||
.activenav { /*float: left; display: block;*/ color: #f2f2f2 !important; background-color: #307D30 !important; text-align: center; /*padding: 7px 16px;*/ text-decoration: none; }
|
||||
.main { height: 100%; width: 100%; /*margin-top: 34px;*/ /* Add a top margin to avoid content overlay */ }
|
||||
@ -34,6 +36,8 @@ td {vertical-align: top;}
|
||||
.instrumentName { color: white; }
|
||||
#spnTotalHoldings { color: white; /*padding-left: 50px;*/ }
|
||||
#spnCurrencies { color: white; font-size: small; padding-right: 10px; }
|
||||
#spnCurrencies a { color: white; }
|
||||
#spnCurrencies a:visited { color: white; }
|
||||
|
||||
a:link { color: #f473ff; }
|
||||
a:visited { color: #9a34b7; }
|
||||
@ -51,6 +55,11 @@ table.mainHoldings { width: 100%; }
|
||||
table.mainHoldings th, table.mainHoldings td { padding-left: 5px; padding-right: 5px; }
|
||||
table.mainHoldings tr:hover { background-color: #404090; }
|
||||
|
||||
.watchlist { font-size: small; }
|
||||
/*table.watchlist { width: 100%; }*/
|
||||
table.watchlist th, table.watchlist td { padding-left: 5px; padding-right: 5px; }
|
||||
table.watchlist tr:hover { background-color: #404090; }
|
||||
|
||||
.accounts { font-size: small; }
|
||||
/*table.accounts { width: 100%; }*/
|
||||
table.accounts th, table.accounts td { padding-left: 5px; padding-right: 5px; }
|
||||
@ -140,8 +149,21 @@ span.addHolding { cursor: pointer; }
|
||||
.marquee div { padding: 1px 0px 1px 0px; }
|
||||
|
||||
|
||||
/*
|
||||
.highcharts-hollowcandlestick-series .highcharts-point-down {
|
||||
fill: #ff4141;
|
||||
stroke: #ff4141;
|
||||
}*/
|
||||
|
||||
|
||||
/*.highcharts-hollowcandlestick-series .highcharts-point-down-bearish-up {
|
||||
fill: #35bd00;
|
||||
stroke: #35bd00;
|
||||
}*/
|
||||
/*
|
||||
.highcharts-hollowcandlestick-series .highcharts-point-up {
|
||||
fill: #07b200;
|
||||
stroke: #07b200;
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user