This commit is contained in:
@@ -262,7 +262,9 @@ namespace Sockeye.Biz
|
||||
{
|
||||
//create product if not exist then import
|
||||
//Get product id if exists
|
||||
var p = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.Name == jPurchase["name"].Value<string>());
|
||||
var ProductName = jPurchase["name"].Value<string>();
|
||||
ProductName = ProductName.Replace("- Renewal", "").Replace(" Renewal", "").Replace(" RENEWAL", "").Replace("CANCELLED ", "");
|
||||
var p = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.Name == ProductName);
|
||||
if (p == null)
|
||||
{
|
||||
//Create it here
|
||||
@@ -290,7 +292,7 @@ namespace Sockeye.Biz
|
||||
s.RenewNoticeSent = jPurchase["renewNoticeSent"].Value<bool>();
|
||||
s.SalesOrderNumber = jPurchase["salesOrderNumber"].Value<string>();
|
||||
s.VendorData = jPurchase["notes"].Value<string>();
|
||||
PurchaseBiz biz=PurchaseBiz.GetBiz(ct);
|
||||
PurchaseBiz biz = PurchaseBiz.GetBiz(ct);
|
||||
await biz.CreateAsync(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,17 +155,15 @@ namespace Sockeye.Util
|
||||
|
||||
public static DateTime? EpochToDateNullIsNull(long? uepoch)
|
||||
{
|
||||
DateTime dt = DateTime.Now;
|
||||
if (uepoch == null) return null;
|
||||
return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).DateTime;
|
||||
return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).UtcDateTime;
|
||||
}
|
||||
|
||||
|
||||
public static DateTime EpochToDateNullIsMin(long? uepoch)
|
||||
{
|
||||
DateTime dt = DateTime.Now;
|
||||
if (uepoch == null) return DateTime.MinValue;
|
||||
return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).DateTime;
|
||||
return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).UtcDateTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user