private static void ImportData(ConfigurationPCNCodeItem[] configuration, Entities edc) { List <PCNCode> list = new List <PCNCode>(); foreach (ConfigurationPCNCodeItem item in configuration) { PCNCode pcn = new PCNCode { Disposal = item.Disposal, CompensationGood = item.CompensationGood.ParseCompensationGood(), ProductCodeNumber = item.ProductCodeNumber, Title = item.Title, }; list.Add(pcn); } ; edc.PCNCode.InsertAllOnSubmit(list); }
/// <summary> /// Initializes a new instance of the <see cref="AccountData" /> class. /// </summary> /// <param name="edc">The <see cref="Entities" /> object.</param> /// <param name="clearance">The clearance.</param> /// <param name="messageType">Type of the customs message.</param> /// <param name="warnings">The list of warnings.</param> /// <param name="trace">The trace.</param> public virtual void GetAccountData(Entities edc, Clearence clearance, MessageType messageType, List <Warnning> warnings, NamedTraceLogger.TraceAction trace) { trace("Entering AccountData.GetAccountData", 50, TraceSeverity.Verbose); DocumentNo = clearance.DocumentNo; DateTime _customsDebtDate = clearance.Clearence2SadGoodID.SADDocumentIndex.CustomsDebtDate.Value; this.CustomsDebtDate = _customsDebtDate; AnalizeGood(edc, clearance.Clearence2SadGoodID, messageType); IEnumerable <SADRequiredDocuments> _rdoc = clearance.Clearence2SadGoodID.SADRequiredDocuments(edc); this.Invoice = (from _dx in _rdoc let CustomsProcedureCode = _dx.Code.ToUpper() where CustomsProcedureCode.Contains("N380") || CustomsProcedureCode.Contains("N935") select new { Number = _dx.Number } ).First().Number; FindConsentRecord(edc, _rdoc, _customsDebtDate, warnings, trace); AnalyzeGoodsDescription(edc, clearance.Clearence2SadGoodID.GoodsDescription); //TODO to IPR PCNTariffCodeLookup = PCNCode.AddOrGet(edc, clearance.Clearence2SadGoodID.PCNTariffCode, TobaccoName).Id.Value; }