Ejemplo n.º 1
0
        private void btn_Start_Click(object sender, EventArgs e)
        {
            try
            {
                ReaderType readerType = ReaderType.P17;
                if (rb_Wisepad.Checked)
                {
                    readerType = ReaderType.P15;
                }
                else if (rb_Wisepad2.Checked)
                {
                    readerType = ReaderType.P16;
                }
                else if (rb_Qpos_mini.Checked)
                {
                    readerType = ReaderType.P17;
                }

                PortInfo selectedPort = null;
                if (!cb_Usb.Checked && portInfos != null && portInfos.Count > 0)
                {
                    selectedPort = portInfos[cmb_Paired.SelectedIndex];
                }

                //P17 only
                Dictionary <String, object> settings = new Dictionary <string, object>();
                settings["NOTUP"] = cb_notup.Checked;

                m_PaymentController.SetReaderType(readerType, (cb_Usb.Checked || selectedPort == null) ? null : selectedPort.portName, settings);
            }
            catch (InvalidOperationException ex)
            {
                log(string.Format("ERROR : {0}", ex.Message));
            }

            //DEBUG
            m_PaymentController.Logger = delegate(string s_log) { log(s_log, Color.Blue); };
            //

            m_PaymentController.Enable();
        }