Files
bnhtrade/src/bnhtrade.Core/Test/InboundShipmentInfo.cs
2024-04-11 12:26:13 +01:00

65 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Test
{
public class InboundShipmentInfo
{
private string sqlConnectionString;
public InboundShipmentInfo(string sqlConnectionString)
{
this.sqlConnectionString = sqlConnectionString;
}
public void SetDatabase()
{
var info = new Model.AmazonFba.ShipmentInfo();
info.FbaShipmentId = "BOBBIE2";
info.DestinationFulfillmentCenterId = "HODG";
info.LastUpdated = DateTime.Now;
info.ShipmentName = "the one";
info.ShipmentStatus = "WORKING";
bool all = info.IsSetAll();
bool allHead = info.IsSetAllHeaderInfo();
var itemInfoList = new List<Model.AmazonFba.ShipmentItemInfo>();
var itemInfo01 = new Model.AmazonFba.ShipmentItemInfo();
itemInfo01.AmazonFNSKU = "Z0000000";
itemInfo01.AmazonShipmentId = "BOBBIE2";
itemInfo01.QuantityReceived = 4;
itemInfo01.QuantityAllocated = 2;
itemInfo01.SKUNumber = "000291-10";
itemInfoList.Add(itemInfo01);
var itemInfo02 = new Model.AmazonFba.ShipmentItemInfo();
itemInfo02.AmazonFNSKU = "Z0000001";
itemInfo02.AmazonShipmentId = "BOBBIE2";
itemInfo02.QuantityReceived = 3;
itemInfo02.QuantityAllocated = 5;
itemInfo02.SKUNumber = "000292-10";
itemInfoList.Add(itemInfo02);
info.ShipmentItemInfoList = itemInfoList;
//foreach (var item in itemInfoList)
//{
// Console.WriteLine("Qty Allocated: " + item.SKUNumber);
// Console.WriteLine("Qty Allocated: " + item.QuantityAllocated);
// Console.WriteLine("Qty Received: " + item.QuantityReceived);
//}
var howto = new Data.Database.AmazonShipment.SetShipmentInfo();
howto.Excecute(info);
var testkkkk = new Data.Database.AmazonShipment.ReadShipmentPrimaryKey();
int pknumber = testkkkk.ByAmazonShipmentId("FBA15CJCZ12");
Console.WriteLine("ShipmentPK: " + pknumber);
}
}
}