49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Dapper;
|
|
using RepositoryPattern;
|
|
using StockDal.Interface;
|
|
using StockDomain;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace StockDal
|
|
{
|
|
public class StockMemberRepository : IStockMemberRepository
|
|
{
|
|
public bool Delete(string stockMemberId)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool Insert(StockMember stockMember)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool Update(StockMember stockMember)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
IEnumerable<StockMember> IStockMemberRepository.GetStocks()
|
|
{
|
|
using System.Data.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", commandType: CommandType.Text);
|
|
}
|
|
}
|
|
}
|