mirror of
https://github.com/mgroves/MonodroidStockPortfolio.git
synced 2025-03-30 01:13:32 -09:00
issue from Amazon AppStore team - casing in ticker could cause duplicate tickers (and crashing), fixed to always uppercase tickers when saving & checking for duplication
This commit is contained in:
parent
d6eba45a2d
commit
d4e1ac708e
1 changed files with 2 additions and 2 deletions
|
@ -118,7 +118,7 @@ namespace MonoStockPortfolio.Core.PortfolioRepositories
|
|||
public bool IsTickerAlreadyBeingTracked(string ticker, long portfolioId)
|
||||
{
|
||||
var cursor = Db.RawQuery("SELECT 1 FROM " + POSITION_TABLE_NAME + " WHERE Ticker = ? AND ContainingPortfolioID = ?",
|
||||
new[] { ticker, portfolioId.ToString() });
|
||||
new[] { ticker.ToUpper(), portfolioId.ToString() });
|
||||
var result = cursor.Count > 0;
|
||||
if(!cursor.IsClosed) cursor.Close();
|
||||
return result;
|
||||
|
@ -189,7 +189,7 @@ namespace MonoStockPortfolio.Core.PortfolioRepositories
|
|||
{
|
||||
var positionValues = new ContentValues();
|
||||
positionValues.Put("PricePerShare", (double)position.PricePerShare);
|
||||
positionValues.Put("Ticker", position.Ticker);
|
||||
positionValues.Put("Ticker", position.Ticker.ToUpper());
|
||||
positionValues.Put("Shares", (double)position.Shares);
|
||||
positionValues.Put("ContainingPortfolioID", position.ContainingPortfolioID);
|
||||
return positionValues;
|
||||
|
|
Loading…
Add table
Reference in a new issue