Esempio n. 1
0
 //倒计时结束后清除缓存
 public static void ClearCookie()
 {
     SkyComm.cardInfoStruct = new CardInformationStruct();
     SkyComm.eCardAuthorizationData.Tables[0].Clear();
     SkyComm.DiagnoseID   = string.Empty;
     SkyComm.cardBlance   = 0;
     SkyComm.cardallmoney = 0;
 }
        /// <summary>
        /// 写卡,第1磁道为卡帐号,第2磁道为卡面号
        /// </summary>
        /// <param name="message">卡信息</param>
        public override void Write(CardInformationStruct message)
        {
            if (string.IsNullOrEmpty(message.CardNo))
            {
                throw new Exception("卡号不能为空!");
            }

            StringBuilder setdata = new StringBuilder(1024);

            setdata.Append(message.CardNo);
            Open();

            int returnValue = SLE_302H_DLL.Wcard(setdata, 2);

            Close();

            switch (returnValue)
            {
            case -1:
                throw new Exception("串口打开失败!");

            case -8:
                throw new Exception("写磁卡失败!");

            case -3:
                throw new Exception("串口没有打开!");

            case -4:
                throw new Exception("(发给动态库的)命令参数错!");

            case -5:
                throw new Exception("与磁卡读写机通信失败(磁卡机没有与主机连接或连接不正确)!");

            case -6:
                throw new Exception("操作超时,退出操作!");

            case -7:
                throw new Exception("按 ESC 键退出当前操作!");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 读卡返回病人信息实体
        /// </summary>
        /// <param name="mark">区别门诊【mark="C"】或者住院【mark!="H"】或者出院【mark!="L"】</param>
        /// <param name="cardInfoStruct">卡信息</param>
        /// <param name="isZz">是否是自助打印</param>
        /// <returns>病人信息实体</returns>
        public override DataSet OpenAndGetPatiantInfo(string mark, ref CardInformationStruct cardInfoStruct)
        {
            if (mark.ToUpper() == "R")//若为挂号,采用原有刷卡操作逻辑
            {
                try
                {
                    SkyComm.cardInfoStruct = this.Read();

                    //FrmMain.cardInfoStruct.CardNo = "000118247826721";//仅作测试 需要删除
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            int     IS_FEECHARGING_CARD = -1;
            DataSet dsReturn            = new DataSet();

            BusinessFacade.His.CardClubManager.CardAuthorizationFacade eCardAuthorizationFacade =
                new BusinessFacade.His.CardClubManager.CardAuthorizationFacade();

            //判断当前卡状态
            //0 正常1 冻结2 注销
            if (cardInfoStruct.CardNo != null)
            {
                DataSet dsCard = eCardAuthorizationFacade.getCardStatusByAccount_ID(SkyComm.cardInfoStruct.CardNo);
                if (dsCard != null && dsCard.Tables.Count <= 0 && dsCard.Tables[0].Rows.Count <= 0)
                {
                    throw new Exception("卡号不存在或此卡已被注销,不能继续使用!");
                }
                if (dsCard.Tables[0].Rows.Count <= 0)
                {
                    throw new Exception("卡号不存在或此卡已被注销,不能继续使用!");
                }
                //SkyComm.cardData = dsCard.Copy();
                SkyComm.cardInfoStruct.CardAccountID = dsCard.Tables[0].Rows[0]["ACCOUNT_ID"].ToString();
                string cir_sta          = dsCard.Tables[0].Rows[0]["CIRCUIT_STATE"].ToString();
                string cir_sta_auditing = dsCard.Tables[0].Rows[0]["AUDITING_STATE"].ToString();
                SkyComm.cardInfoStruct.CardTypeID = Convert.ToInt32(dsCard.Tables[0].Rows[0]["TYPEID"]);
                SkyComm.DiagnoseID = dsCard.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                if (cir_sta == "1")
                {
                    throw new Exception("此卡已冻结,不能继续使用!");
                }
                else if (cir_sta == "2")
                {
                    throw new Exception("此卡已注销,不能继续使用!");
                }
                else if (cir_sta_auditing == "1")//当卡没有冻结或注销时,才判断是否需要审核
                {
                    //卡未审核
                    throw new Exception("此卡还未审核,不能继续使用!");
                }

                if (mark.ToUpper() == "C" || mark.ToUpper() == "R")//门诊
                {
                    dsReturn = eCardAuthorizationFacade.OpenAndGetPatiantInfoByAccount_IDForClinic(SkyComm.cardInfoStruct.CardAccountID, ref IS_FEECHARGING_CARD);
                }
                else if (mark.ToUpper() == "H")//住院
                {
                    dsReturn = eCardAuthorizationFacade.OpenAndGetPatiantInfoByAccount_IDForInpatient(SkyComm.cardInfoStruct.CardAccountID, ref IS_FEECHARGING_CARD);
                }
                else if (mark.ToUpper() == "L")//出院
                {
                    dsReturn = eCardAuthorizationFacade.OpenAndGetPatiantInfoByAccount_IDForLeave(SkyComm.cardInfoStruct.CardAccountID, ref IS_FEECHARGING_CARD);
                }
                else
                {
                    throw new Exception("参数错误,不能继续使用!");
                }

                if (!Directory.Exists(Application.StartupPath + "\\ReportXML"))
                {
                    Directory.CreateDirectory(Application.StartupPath + "\\ReportXML");//
                }
                SkyComm.cardInfoStruct.Is_FEECHARGING_CARD = IS_FEECHARGING_CARD;
                dsReturn.WriteXml(Application.StartupPath + "\\ReportXML\\CardInterface.xml");
                return(dsReturn);
            }
            return(null);
        }
Esempio n. 4
0
 /// <summary>
 /// 写卡
 /// </summary>
 /// <param name="message"></param>
 public override void Write(CardInformationStruct message)
 {
     return;
 }