Ejemplo n.º 1
0
        public List <PW_Parameter> getTransactionResult()
        {
            List <PW_Parameter> ret = new List <PW_Parameter>();

            string message = string.Empty;

            foreach (E_PWINFO item in Enum.GetValues(typeof(E_PWINFO)).Cast <E_PWINFO>())
            {
                StringBuilder value      = new StringBuilder(10000);
                int           getInfoRet = Interop.PW_iGetResult((short)item, value, 10001);
                if (getInfoRet == 0)
                {
                    ret.Add(new PW_Parameter(item.ToString(), (ushort)item, value.ToString()));
                }
                if (getInfoRet == 0 && item == E_PWINFO.PWINFO_RESULTMSG)
                {
                    message = value.ToString();
                }
            }

            FormDisplayMessage fdm = new FormDisplayMessage();

            fdm.Show(message, 3000);

            return(ret);
        }
Ejemplo n.º 2
0
        private int loopPP(int timeout = 0)
        {
            FormDisplayMessage fdm = new FormDisplayMessage();
            int ret     = 99;
            int counter = 0;

            do
            {
                ret = (int)E_PWRET.PWRET_TIMEOUT;
                if (counter > timeout && timeout > 0)
                {
                    return(ret);
                }
                counter++;
                Thread.Sleep(200);
                StringBuilder displayMessage = new StringBuilder(1000);
                //Debug.Print(string.Format("CALLED iPPEventLoop", displayMessage.ToString(), ret.ToString()));
                ret = Interop.PW_iPPEventLoop(displayMessage, (uint)1000);
                //Debug.Print(string.Format("CALLED iPPEventLoop COM MESSAGE {0} E RETORNO {1}", displayMessage.ToString(), ret.ToString()));

                if (ret == (int)E_PWRET.PWRET_DISPLAY)
                {
                    fdm.Show(displayMessage.ToString());
                }
            } while (ret == (int)E_PWRET.PWRET_NOTHING ||
                     ret == (int)E_PWRET.PWRET_DISPLAY);

            fdm.Close();
            fdm.Dispose();

            return(ret);
        }