Exemplo n.º 1
0
        private void btnIsNewCard_Click(object sender, EventArgs e)
        {
            ComItem port = cboPort.SelectedItem as ComItem;

            if (port != null)
            {
                try
                {
                    short com  = Convert.ToInt16(port.PortNum);
                    int   baud = Convert.ToInt32(cboBaud.SelectedItem);

                    QwCardICLib.MWOperate4442 obj = QwCardICLib.MWOperate4442.GetInstance();
                    int result = obj.CheckGasCard(com, baud);//, buyGasCount);
                    if (result >= 0)
                    {
                        switch (result)
                        {
                        case 0:
                            txtCardType.Text = "无效卡";
                            break;

                        case 1:
                            txtCardType.Text = "新卡";
                            break;

                        case 2:
                            txtCardType.Text = "开户卡";
                            break;

                        case 3:
                            txtCardType.Text = "用户卡";
                            break;

                        case 4:
                            txtCardType.Text = "工具卡";
                            break;

                        default:
                            txtCardType.Text = result.ToString() + " 未知";
                            break;
                        }
                    }
                    else
                    {
                        ClearIcData();
                        lbMsg.Items.Add(DateTime.Now.ToString("MM-dd hh:mm:ss") + "  信息号:" + result.ToString());
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("请选择合适的端口");
            }
        }
Exemplo n.º 2
0
        public int CheckGasCard(short com, int baud)
        {
            QwCardICLib.MWOperate4442 obj = QwCardICLib.MWOperate4442.GetInstance();
            int result = obj.CheckGasCard(com, baud);

            //2-开户卡,3-用户卡
            if (result == 2 || result == 3)
            {
                return(0);
            }
            return(-1);
        }
Exemplo n.º 3
0
        public int CheckGasCard(short com, int baud)
        {
            Log.Debug("Check KeLuoMu start");
            QwCardICLib.MWOperate4442 obj = QwCardICLib.MWOperate4442.GetInstance();
            int result = obj.CheckGasCard(com, baud);

            Log.Debug("Check KeLuoMu card result=" + result);
            //1-本厂新卡,2-开户卡,3-用户卡
            if (result == 1 || result == 2 || result == 3)
            {
                return(0);
            }
            return(-1);
        }