Ejemplo n.º 1
0
        /// <summary>
        /// 医生信息列表_按医生代码查
        /// </summary>
        /// <param name="code">医生代码</param>
        /// <param name="values">医生信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_DoctorInfoDaiMa(string code, out ArrayList values, out string msg)
        {
            msg = "";

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

            try
            {
                bool flag = false;
                int  ret  = -99;

                string findId1 = _builder.DoctorInfoByCodeSql(code, out flag, out msg);

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    values = new ArrayList();
                    while (dr.Read())
                    {
                        AlipayDoctorInfo pd = new AlipayDoctorInfo();

                        pd.code       = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.name       = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.sex        = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        pd.pictureurl = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        pd.level      = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        pd.recommend  = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                        pd.adept      = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                        pd.departcode = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                        pd.departname = !dr.IsDBNull(8) ? dr.GetString(8) : "";

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 16;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-99);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }