public static void AddTransactionSetDetails(this InterchangeErrors errors, int tsNumber, string idCode, string ctrlNumber, bool updateExisting) { if (errors == null) { throw new ArgumentNullException("errors"); } TransactionSetErrors transactionSetErrors = new TransactionSetErrors(tsNumber, idCode, ctrlNumber, new EdiSectionErrors()); FunctionalGroupErrors functionalGroupErrors; if (errors.FunctionalGroupErrors.Count == 0) { // TODO: Handle this error condition properly - Need to consider scenario where ST segment appear before GS // this should be error since TransactionSetDetails should be added only after functionalGroup functionalGroupErrors = errors.CreateNewFunctionalGroupErrorInfo(-1, "---", "----"); } else { functionalGroupErrors = errors.FunctionalGroupErrors.Last(); } if (functionalGroupErrors.TransactionSetErrors.Count > 0 && updateExisting == true) { functionalGroupErrors.TransactionSetErrors.Clear(); } functionalGroupErrors.TransactionSetErrors.Add(transactionSetErrors); }
public void AddTransactionSetErrorInfo(TransactionSetErrors tsError) { transactionSetErrors.Add(tsError); }