mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-05-18 19:48:23 +00:00
Migration from Amazon MWS to Selling Partner API
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
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
|
||||
{
|
||||
public class ReadRandomData : Connection
|
||||
{
|
||||
public List<string> GetSkuNumber(int listCount)
|
||||
{
|
||||
var returnList = new List<string>();
|
||||
if (listCount < 1)
|
||||
return returnList;
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(
|
||||
"SELECT TOP "+ listCount + " [skuSkuNumber] FROM [e2A].[dbo].[tblSku] ORDER BY newid()", conn))
|
||||
{
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
returnList.Add(reader.GetString(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
public List<string> GetAsinNumber(int listCount)
|
||||
{
|
||||
var returnList = new List<string>();
|
||||
if (listCount < 1)
|
||||
return returnList;
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(
|
||||
"SELECT TOP " + listCount + " prdAmazonASIN FROM [e2A].[dbo].[tblProduct] WHERE prdAmazonASIN IS NOT NULL ORDER BY newid()", conn))
|
||||
{
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
returnList.Add(reader.GetString(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user