Esempio n. 1
0
        public void unpack()
        {
            /*
             * TODO: Add code to start application here
             **/
            try
            {
                loadPackager();
                iIsoAscii = isoMsg.ASCIIMessage;

                /// Max Field
                isoMsg.MaxField = ISOMaxField;
                /// MTI First
                iXWork              = (ISOFieldAttribute)iField["0"];
                isoMsg.MTI          = ISOBaseField.pickField(ref iIsoAscii, iXWork);
                isoMsg.FieldHash[0] = isoMsg.MTI;
                if (isdebug)
                {
                    Console.WriteLine("<id_" + iXWork.id + ">"
                                      + "<" + iXWork.name + ">" + isoMsg.MTI + "</" + iXWork.name + ">"
                                      + "</id_" + iXWork.id + ">");
                }
                /// BitMap
                iXWork = (ISOFieldAttribute)iField["1"];
                string    bit    = ISOBaseField.pickField(ref iIsoAscii, iXWork);
                Hashtable bitmap = ISOBaseField.HashBitMap(bit);
                isoMsg.BitMapHash   = bitmap;
                isoMsg.FieldHash[1] = bit;
                /// Next Field Automatic Hashmap
                for (int c = 2; c < ISOMaxField + 1; c++)
                {
                    if (isoMsg.hasField(c))
                    {
                        iXWork = (ISOFieldAttribute)iField[c.ToString()];
                        isoMsg.FieldHash[c] = ISOBaseField.pickField(ref iIsoAscii, iXWork);
                        if (isdebug)
                        {
                            Console.WriteLine("<id_" + iXWork.id + ">"
                                              + "<" + iXWork.name + ">" + isoMsg.FieldHash[c] + "</" + iXWork.name + ">"
                                              + "</ID_" + iXWork.id + ">");
                        }
                    }
                }
            }
            catch (Exception ee)
            {
                Console.WriteLine(("Invalid ISO Message") + " - " + ee.Message);
            }
        }
Esempio n. 2
0
        public void pack()
        {
            string r = "";

            try
            {
                loadPackager();

                /*
                 * MTI First
                 * */
                iXWork = (ISOFieldAttribute)iField["0"];
                r     += ISOBaseField.putField(isoMsg.FieldHash, iXWork);
                if (isdebug)
                {
                    Console.WriteLine("MTI:" + r);
                }

                /*
                 * Bitmap Generator
                 * */
                iXWork = (ISOFieldAttribute)iField["1"];
                r     += ISOBaseField.putField(isoMsg.BitMapHash, iXWork);

                for (int i = 2; i < isoMsg.MaxField + 1; i++)
                {
                    if (isoMsg.hasField(i))
                    {
                        iXWork = (ISOFieldAttribute)iField[i.ToString()];
                        r     += ISOBaseField.putField(isoMsg.FieldHash, iXWork);
                        if (isdebug)
                        {
                            Console.WriteLine("<id_" + iXWork.id + ">"
                                              + "<" + iXWork.name + ">"
                                              + ISOBaseField.putField(isoMsg.FieldHash, iXWork)
                                              + "</" + iXWork.name + ">"
                                              + "</id_" + iXWork.id + ">");
                        }
                    }
                }
                isoMsg.ASCIIMessage = r;
            }
            catch (Exception ee)
            {
                Console.WriteLine("Packing error occured: " + ee.Message);
            }
        }