mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 06:27:15 +00:00
wip
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Data.Database.Purchase
|
||||
{
|
||||
internal class PurchaseLineStatus : Connection
|
||||
{
|
||||
public List<Model.Purchase.PurchaseLineStatus> Read()
|
||||
{
|
||||
var returnList = new List<Model.Purchase.PurchaseLineStatus>();
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(@"
|
||||
SELECT [PurchaseLineStatusID]
|
||||
,[PurchaseLineStatus]
|
||||
,[ListSort]
|
||||
,[TimeStamp]
|
||||
FROM [e2A].[dbo].[tblPurchaseLineStatus]
|
||||
ORDER BY [ListSort]
|
||||
", conn))
|
||||
{
|
||||
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (!reader.HasRows)
|
||||
{
|
||||
// do something
|
||||
}
|
||||
else
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int id = reader.GetInt32(0);
|
||||
string name = reader.GetString(1);
|
||||
int lineSort = reader.GetInt32(2);
|
||||
|
||||
var returnItem = new Model.Purchase.PurchaseLineStatus(id, name,lineSort);
|
||||
returnList.Add( returnItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/bnhtrade.Core/Logic/Purchase/PurchaseLineStatus.cs
Normal file
16
src/bnhtrade.Core/Logic/Purchase/PurchaseLineStatus.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Logic.Purchase
|
||||
{
|
||||
public class PurchaseLineStatus
|
||||
{
|
||||
public List<Model.Purchase.PurchaseLineStatus> ReadAll()
|
||||
{
|
||||
return new Data.Database.Purchase.PurchaseLineStatus().Read();
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/bnhtrade.Core/Model/Purchase/PurchaseLineStatus.cs
Normal file
18
src/bnhtrade.Core/Model/Purchase/PurchaseLineStatus.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace bnhtrade.Core.Model.Purchase
|
||||
{
|
||||
public class PurchaseLineStatus
|
||||
{
|
||||
public PurchaseLineStatus(int statusId, string statusName, int listSort)
|
||||
{
|
||||
PurchaseLineStatusId = statusId;
|
||||
PurchaseLineStatusName = statusName;
|
||||
ListSort = listSort;
|
||||
}
|
||||
|
||||
public int PurchaseLineStatusId {get; private set;}
|
||||
|
||||
public string PurchaseLineStatusName { get; private set;}
|
||||
|
||||
public int ListSort { get; private set;}
|
||||
}
|
||||
}
|
||||
@@ -177,6 +177,7 @@
|
||||
<Compile Include="Data\Database\Import\AmazonFbaInventoryLedgerDetail.cs" />
|
||||
<Compile Include="Data\Database\Product\ReadProduct.cs" />
|
||||
<Compile Include="Data\Database\Product\ReadProductId.cs" />
|
||||
<Compile Include="Data\Database\Purchase\PurchaseLineStatus.cs" />
|
||||
<Compile Include="Data\Database\ReadRandomData.cs" />
|
||||
<Compile Include="Data\Database\Sku\InsertSku.cs" />
|
||||
<Compile Include="Data\Database\Sku\ReadSku.cs" />
|
||||
@@ -236,6 +237,7 @@
|
||||
<Compile Include="Logic\Product\AmazonCompetitivePrice.cs" />
|
||||
<Compile Include="Logic\Product\AmazonEstimateFee.cs" />
|
||||
<Compile Include="Logic\Product\GetProductInfo.cs" />
|
||||
<Compile Include="Logic\Purchase\PurchaseLineStatus.cs" />
|
||||
<Compile Include="Logic\Sku\GetSkuInfo.cs" />
|
||||
<Compile Include="Logic\Stock\StatusTypeBalance.cs" />
|
||||
<Compile Include="Logic\Stock\SkuTransactionImport.cs" />
|
||||
@@ -294,6 +296,7 @@
|
||||
<Compile Include="Model\Product\CompetitivePrice.cs" />
|
||||
<Compile Include="Model\Product\ProductInfo.cs" />
|
||||
<Compile Include="Model\Amazon\ProductCompetitivePrice.cs" />
|
||||
<Compile Include="Model\Purchase\PurchaseLineStatus.cs" />
|
||||
<Compile Include="Model\Sku\Price\DetailRequest.cs" />
|
||||
<Compile Include="Model\Sku\Price\DetailResponce.cs" />
|
||||
<Compile Include="Model\Sku\Price\PriceInfo.cs" />
|
||||
|
||||
Reference in New Issue
Block a user