示例#1
0
        /// <summary>
        ///  获得门诊卡列表
        /// </summary>
        /// <param name="idcardno">身份证号</param>
        /// <param name="name">姓名</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        public int DB_GetmzkListStr(string idcardno, string name, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            values = new ArrayList();

            try
            {
                bool _flag = false;

                string findText = _builder.GetGetmzkListSql(idcardno, name, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findText);

                if (!_flag)
                {
                    ret = 10;
                    return(ret);
                }

                dr = DbHelperOra.ExecuteReader(findText, connection);

                while (dr.Read())
                {
                    PatientInfo paintentInfo = new PatientInfo();

                    paintentInfo.bklx     = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    paintentInfo.cardname = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    paintentInfo.bkhm     = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    paintentInfo.sfzh     = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    paintentInfo.brid     = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                    paintentInfo.brxm     = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                    paintentInfo.birthday = !dr.IsDBNull(6) ? dr.GetDateTime(6).ToString("yyyy-MM-dd") : "";
                    paintentInfo.lxdh     = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                    paintentInfo.balance  = !dr.IsDBNull(8) ? Convert.ToString(dr.GetDouble(8)) : " ";
                    paintentInfo.cost     = !dr.IsDBNull(9) ? Convert.ToString(dr.GetDouble(9)) : " ";
                    values.Add(paintentInfo);
                }
                if (values.Count > 0)
                {
                    msg = "找到病人信息";
                    ret = 00;
                }
                else
                {
                    msg    = "医院端未找到,请核对信息后重试";
                    values = null;
                    ret    = 10;
                }
                dr.Close();

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }