This commit is contained in:
2022-12-27 23:45:08 +00:00
parent 8390f9aa33
commit d015e79043
2 changed files with 6 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -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;
}