Example #1
0
        internal Interchange(EdiTools.EdiFile parent, EdiTools.Index isa, EdiTools.Index iea)
        {
            string[] elements = isa.Split();
            _isa.ISA01 = elements[1];
            _isa.ISA02 = elements[2];
            _isa.ISA03 = elements[3];
            _isa.ISA04 = elements[4];
            _isa.ISA05 = elements[5];
            _isa.ISA06 = elements[6];
            _isa.ISA07 = elements[7];
            _isa.ISA08 = elements[8];
            _isa.ISA09 = elements[9];
            _isa.ISA10 = elements[10];
            _isa.ISA11 = elements[11];
            _isa.ISA12 = elements[12];
            _isa.ISA13 = elements[13];
            _isa.ISA14 = elements[14];
            _isa.ISA15 = elements[15];
            _isa.ISA16 = elements[16];
            _isa.Index = isa;

            elements   = iea.Split();
            _iea.IEA01 = elements[1];
            _iea.IEA02 = elements[2];
            _iea.Index = iea;
        }
Example #2
0
        internal FunctionalGroup(EdiTools.EdiFile parent, EdiTools.Index gs, EdiTools.Index ge)
        {
            _parent = parent;

            // gs
            string[] elements = gs.Split();
            _gs.GS01  = elements[1];
            _gs.GS02  = elements[2];
            _gs.GS03  = elements[3];
            _gs.GS04  = elements[4];
            _gs.GS05  = elements[5];
            _gs.GS06  = elements[6];
            _gs.GS07  = elements[7];
            _gs.GS08  = elements[8];
            _gs.Index = gs;

            // ge
            elements  = ge.Split();
            _ge.GE01  = elements[1];
            _ge.GE02  = elements[2];
            _ge.Index = ge;

            // st/se indexes are for getting the start and end of each transaction set in the group
            System.Collections.Generic.List <EdiTools.Index> _stIndexes = new System.Collections.Generic.List <Index>();
            System.Collections.Generic.List <EdiTools.Index> _seIndexes = new System.Collections.Generic.List <Index>();

            System.Collections.Generic.List <EdiTools.Index> segments = new System.Collections.Generic.List <Index>();
            foreach (EdiTools.Index idx in _parent.GetIndexes())
            {
                if (idx.Start <= _gs.Index.Start || idx.Start >= _ge.Index.Start)
                {
                    continue;
                }

                segments.Add(idx);

                if (idx.Name == "ST")
                {
                    _stIndexes.Add(idx);
                }

                if (idx.Name == "SE")
                {
                    _seIndexes.Add(idx);
                    _transactionSetIndexes.Add(segments.ToArray());
                    segments.Clear();
                }
            }
        }
Example #3
0
        public TransactionSet(EdiTools.FunctionalGroup parent, EdiTools.Index[] indexes)
        {
            _parent  = parent;
            _indexes = indexes;

            EdiTools.Index st = indexes[0];
            EdiTools.Index se = indexes[indexes.Length - 1];

            string[] elements = st.Split();
            _st       = new EdiTools.ST();
            _st.ST01  = elements[1];
            _st.ST02  = elements[2];
            _st.Index = st;

            elements  = se.Split();
            _se       = new EdiTools.SE();
            _se.SE01  = elements[1];
            _se.SE02  = elements[2];
            _se.Index = se;
        }