It is now possible to register owned stocks for keeping track on them
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -185,7 +185,7 @@ namespace StockDal
|
||||
|
||||
public void Clean()
|
||||
{
|
||||
driver.Quit();
|
||||
driver?.Quit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,9 +16,35 @@ namespace StockDal
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool Insert(StockMember stockMember)
|
||||
public void InsertMany(List<StockMember> stockMembers)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
using IDbConnection db = new SqlConnection(StockDBConnection.ConnectionString);
|
||||
if (db.State == ConnectionState.Closed)
|
||||
db.Open();
|
||||
db.Execute(
|
||||
@"INSERT INTO [dbo].[StockMember]
|
||||
(StockId
|
||||
,StockExtId
|
||||
,BuyValue
|
||||
,BuyDate
|
||||
,ActValue
|
||||
,ActDate
|
||||
,SoldValue
|
||||
,SoldDate
|
||||
,Comment
|
||||
,PostAmount)
|
||||
VALUES
|
||||
(@StockId
|
||||
,@StockExtId
|
||||
,@BuyValue
|
||||
,@BuyDate
|
||||
,@ActValue
|
||||
,@ActDate
|
||||
,@SoldValue
|
||||
,@SoldDate
|
||||
,@Comment
|
||||
,@PostAmount)
|
||||
", stockMembers);
|
||||
}
|
||||
|
||||
public bool Update(StockMember stockMember)
|
||||
@ -28,7 +54,7 @@ namespace StockDal
|
||||
|
||||
IEnumerable<StockMember> IStockMemberRepository.GetStocks()
|
||||
{
|
||||
using System.Data.IDbConnection db = new SqlConnection(StockDBConnection.ConnectionString);
|
||||
using IDbConnection db = new SqlConnection(StockDBConnection.ConnectionString);
|
||||
if (db.State == ConnectionState.Closed)
|
||||
db.Open();
|
||||
return db.Query<StockMember>(@"SELECT Id
|
||||
|
||||
Reference in New Issue
Block a user