|
|
|
|
@ -1819,9 +1819,9 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
return await Task.Run(() => UpdateProductsFromCsv());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Account ResolveAccountByName(GremlinContext context, string AccName)
|
|
|
|
|
public static Account ResolveAccountByName(GremlinContext context, string accountName)
|
|
|
|
|
{
|
|
|
|
|
try { return context.Accounts.Include(a => a.AccountType).Include(a => a.SubMarket).Where(a => a.AccountName == AccName).First(); }
|
|
|
|
|
try { return context.Accounts.Include(account => account.AccountType).Include(account => account.SubMarket).Where(account => account.AccountName == accountName).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1837,33 +1837,33 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static AccountType ResolveAccountType(GremlinContext context, string AccTypeCode)
|
|
|
|
|
public static AccountType ResolveAccountType(GremlinContext context, string accountTypeCode)
|
|
|
|
|
{
|
|
|
|
|
try { return context.AccountTypes.Where(account => account.AccountTypeCode == AccTypeCode).First(); }
|
|
|
|
|
try { return context.AccountTypes.Where(account => account.AccountTypeCode == accountTypeCode).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static SubMarket ResolveSubmarket(GremlinContext context, string subMarketCode)
|
|
|
|
|
{
|
|
|
|
|
try { return context.SubMarkets.Where(a => a.SubMarketCode == subMarketCode).First(); }
|
|
|
|
|
try { return context.SubMarkets.Where(submarket => submarket.SubMarketCode == subMarketCode).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Product GetProduct(GremlinContext context, string pn, string option)
|
|
|
|
|
public static Product GetProduct(GremlinContext context, string productNumber, string optionNumber)
|
|
|
|
|
{
|
|
|
|
|
try { return context.Products.Include(p => p.ProductLine).Include(p => p.CustomDescription).Where(a => a.ProductNumber == pn && a.OptionNumber == option).First(); }
|
|
|
|
|
try { return context.Products.Include(product => product.ProductLine).Include(product => product.CustomDescription).Where(product => product.ProductNumber == productNumber && product.OptionNumber == optionNumber).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Product ResolveProduct(GremlinContext context, string pn, string option)
|
|
|
|
|
public static Product ResolveProduct(GremlinContext context, string productNumber, string option)
|
|
|
|
|
{
|
|
|
|
|
try {return context.Products.Where(a => a.ProductNumber == pn && a.OptionNumber == option).First(); }
|
|
|
|
|
try {return context.Products.Where(product => product.ProductNumber == productNumber && product.OptionNumber == option).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ProductLine ResolveProductLine(GremlinContext context, string plCode)
|
|
|
|
|
public static ProductLine ResolveProductLine(GremlinContext context, string productLineCode)
|
|
|
|
|
{
|
|
|
|
|
try { return context.ProductLines.Where(a => a.ProductLineCode == plCode).First(); }
|
|
|
|
|
try { return context.ProductLines.Where(productline => productline.ProductLineCode == productLineCode).First(); }
|
|
|
|
|
catch { return null; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|