Smärre korrigeringar
This commit is contained in:
@ -61,7 +61,7 @@ namespace StockDal
|
||||
", new { val = price, date = DateTime.Today, id = Id });
|
||||
}
|
||||
|
||||
IEnumerable<StockMember> IStockMemberRepository.GetStocks()
|
||||
public IEnumerable<StockMember> GetStocks()
|
||||
{
|
||||
using IDbConnection db = new SqlConnection(StockDBConnection.ConnectionString);
|
||||
if (db.State == ConnectionState.Closed)
|
||||
@ -77,7 +77,28 @@ namespace StockDal
|
||||
,SoldDate
|
||||
,Comment
|
||||
,PostAmount
|
||||
FROM dbo.StockMember", commandType: CommandType.Text);
|
||||
FROM dbo.StockMember
|
||||
Where SoldDate is null
|
||||
ORDER BY PostAmount * (actvalue - BuyValue) desc", commandType: CommandType.Text);
|
||||
}
|
||||
public IEnumerable<StockMember> GetAllStocks()
|
||||
{
|
||||
using IDbConnection db = new SqlConnection(StockDBConnection.ConnectionString);
|
||||
if (db.State == ConnectionState.Closed)
|
||||
db.Open();
|
||||
return db.Query<StockMember>(@"SELECT Id
|
||||
,StockId
|
||||
,StockExtId
|
||||
,BuyValue
|
||||
,BuyDate
|
||||
,ActValue
|
||||
,ActDate
|
||||
,SoldValue
|
||||
,SoldDate
|
||||
,Comment
|
||||
,PostAmount
|
||||
FROM dbo.StockMember
|
||||
ORDER BY PostAmount * (actvalue - BuyValue) desc", commandType: CommandType.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user