|
|
|
|
@ -1060,7 +1060,7 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
CoverletterText = fields[5],
|
|
|
|
|
Notes = fields[6],
|
|
|
|
|
};
|
|
|
|
|
ImportedCD.Product = new();
|
|
|
|
|
ImportedCD.Products = new();
|
|
|
|
|
ImportedCD.Supplier = new();
|
|
|
|
|
ImportedCD.Supplier.AccountName = fields[2] is "" or "RB" ? "Agilent Technologies" : fields[2];
|
|
|
|
|
MetaDataSetter.ForImport(ImportedCD, "Importer", "Initial Importer by CD-ImporterFomCsv");
|
|
|
|
|
@ -1117,12 +1117,12 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
foreach (CustomDescription CD in CDsReadFromFile)
|
|
|
|
|
{
|
|
|
|
|
//Skip Desciptions, if it has been already imported above (as part from 3PP)
|
|
|
|
|
if (thirdPartyProductsFromImportedCDs.Contains(CD.Product)) continue;
|
|
|
|
|
if (thirdPartyProductsFromImportedCDs.Intersect(CD.Products).Any()) continue;
|
|
|
|
|
|
|
|
|
|
//Establish EF Reference. If no PN/Opt found, then skip this custom description.
|
|
|
|
|
//CD.Product = GetProduct(db, CD.ProductNumber, CD.OptionNumber); //ResolveXY-functions return null, if no match is found in db.
|
|
|
|
|
CD.Product = productsInDb.Find(p => p.ProductNumber == CD.ProductNumber && p.OptionNumber == CD.OptionNumber);
|
|
|
|
|
if (CD.Product == null)
|
|
|
|
|
CD.Products = productsInDb.Where(product => product.ProductNumber == CD.ProductNumber && product.OptionNumber == CD.OptionNumber).ToList();
|
|
|
|
|
if (CD.Products == null)
|
|
|
|
|
{
|
|
|
|
|
CDsWithoutEFReferences.Add(CD);
|
|
|
|
|
continue;
|
|
|
|
|
@ -1206,7 +1206,7 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
importedCD.CoverletterText = stringsRead.ElementAt(5);
|
|
|
|
|
|
|
|
|
|
importedCDs.Add(importedCD);
|
|
|
|
|
if (importedCDs.Count >= 1200 && importedCDs.Count % 100 == 0) MessageBox.Show(importedCDs.Count.ToString()); //DEBUGGING
|
|
|
|
|
//if (importedCDs.Count >= 1200 && importedCDs.Count % 100 == 0) MessageBox.Show(importedCDs.Count.ToString()); //DEBUGGING
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1260,11 +1260,12 @@ namespace Gremlin.GremlinData.DBClasses
|
|
|
|
|
foreach (CustomDescription CD in importedCDs)
|
|
|
|
|
{
|
|
|
|
|
//Skip Desciptions, if it has been already imported above (as part from 3PP)
|
|
|
|
|
if (thirdPartyProductsFromImportedCDs.Contains(CD.Product)) continue;
|
|
|
|
|
if (thirdPartyProductsFromImportedCDs.Intersect(CD.Products).Any()) continue;
|
|
|
|
|
|
|
|
|
|
//Establish EF Reference. If no PN/Opt found, then skip this custom description.
|
|
|
|
|
CD.Product = ResolveProduct(db, CD.ProductNumber, CD.OptionNumber); //ResolveXY-functions return null, if no match is found in db.
|
|
|
|
|
if (CD.Product == null)
|
|
|
|
|
CD.Products.Add(ResolveProduct(db, CD.ProductNumber, CD.OptionNumber)); //ResolveXY-functions return null, if no match is found in db.
|
|
|
|
|
|
|
|
|
|
if (CD.Products == null)
|
|
|
|
|
{
|
|
|
|
|
CDsWithoutEFReferences.Add(CD);
|
|
|
|
|
continue;
|
|
|
|
|
|