コード例 #1
0
 /// <summary>
 /// 读取状态
 /// </summary>
 /// <param name="CardType"></param>
 /// <returns></returns>
 public bool GetCardType(ref InsertCardType card)
 {
     if (m_SB == null)
     {
         return(false);
     }
     return(m_SB.GetCardType(ref card));
 }
コード例 #2
0
        public bool ReadCardNoNC(ref InsertCardType card, ref string CardNo)
        {
            if (MoveCardToIC())//移到IC位读社保卡
            {
                string insuRegStr = string.Empty;


                return(true);
            }
            return(false);
        }
コード例 #3
0
        /// <summary>
        /// 读取状态
        /// 限制卡号位数,卡号长度等于JZKCardCount时 为健康卡 ,等于28位时,是磁条社保卡
        /// 否则为芯片卡
        /// </summary>
        /// <param name="CardType"></param>
        /// <returns></returns>
        public bool ReadCardNo(ref InsertCardType card, ref string CardNo)
        {
            if (ReadMagCardNo(ref CardNo))
            {
                //if (CardNo.Length ==12)
                //{
                //    card = InsertCardType.HealthCard;
                //    return true;
                //}
                //else
                //{
                //    if (Config.IsUseTJCard)
                //    {
                //        if (CardNo.Length == Config.TJCardCount)
                //        {
                //            card = InsertCardType.HealthCard;
                //            return true;
                //        }

                //    }
                //}


                if (Config.LayoutName == LayoutEnum.AI || Config.LayoutName == LayoutEnum.JinYun)
                {
                    #region  丽水社保长度37
                    if (CardNo.Length >= 36)
                    {
                        SunRise.HOSP.Common.Log.WriteModuleLogLn(SunRise.HOSP.Common.LogType.ErrorLog,
                                                                 SunRise.HOSP.Common.LogModule.SocialSecurity, "社保卡:" + CardNo);
                        MoveCardToIC();
                        card = InsertCardType.SocialSecurityCard;
                        return(true);
                    }

                    #region 丽水用
                    if (CardNo.Length == 12)
                    {
                        card = InsertCardType.HealthCard;
                        return(true);
                    }
                    #endregion
                }

                card = InsertCardType.Unknown;

                return(false);

                #endregion
            }



            if (ReadMagCardNo(ref CardNo) && CardNo.Length == 28)
            {
                card = InsertCardType.SocialSecurityCard;
                return(true);
            }

            if (Config.IsLoopReadCard)
            {
                if (ReadMagCardNo(ref CardNo))
                {
                    if (CardNo.Length == Config.JZKCardCount)
                    {
                        card = InsertCardType.HealthCard;
                        return(true);
                    }
                    else
                    {
                        if (Config.IsUseTJCard)
                        {
                            if (CardNo.Length == Config.TJCardCount)
                            {
                                card = InsertCardType.HealthCard;
                                return(true);
                            }
                        }
                    }
                }



                if (ReadMagCardNo(ref CardNo) && CardNo.Length == 28)
                {
                    card = InsertCardType.SocialSecurityCard;
                    return(true);
                }
            }

            if (m_SB != null && MoveCardToIC())//移到IC位读社保卡
            {
                card = InsertCardType.SocialSecurityCard;
                return(true);

                #region    读卡 以为社保读卡,所以这里就直接返回
                //if (m_SB.ReadCardNo(ref CardNo))// && ci.CardIdentifier == "1"
                //{
                //    if (String.IsNullOrWhiteSpace(CardNo))
                //        return false;
                //    card = InsertCardType.SocialSecurityCard;
                //    return true;
                //}
                //return false;
                #endregion
            }
            return(false);
        }