It is now possible to register owned stocks for keeping track on them
This commit is contained in:
@ -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