コード例 #1
0
        /// <summary>
        /// 检验报告单列表
        /// </summary>
        /// <param name="name">姓名</param>
        /// <param name="idcardno">身份证号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_InspectionReportList(string name, string idcardno, out ArrayList values, out string msg)
        {
            string _oracleConStr = WebConfigParameter.ConnectionHisString;
            string _sqlConStr    = WebConfigParameter.ConnectionLisString;

            values = new ArrayList();

            OracleConnection oracleConnection = new OracleConnection(_oracleConStr);
            SqlConnection    sqlConnection    = new SqlConnection(_sqlConStr);
            OracleDataReader dr       = null;
            SqlDataReader    myReader = null;

            try
            {
                bool   _flag     = false;
                string sqlstr    = "";
                string oraclestr = "";
                _builder.GetInspectionReportList(name, idcardno, out sqlstr, out oraclestr, out _flag, out msg);

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

                int ret = -1;
                msg = "";

                if (!string.IsNullOrEmpty(_sqlConStr))
                {
                    myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection);
                    if (null != myReader && myReader.HasRows)
                    {
                        while (myReader.Read())
                        {
                            AlipayReportList ri = new AlipayReportList();
                            ri.doctadviseno = !myReader.IsDBNull(0) ? myReader.GetString(0) : "";
                            ri.examinaim    = !myReader.IsDBNull(1) ? myReader.GetString(1) : "";
                            ri.requesttime  = !myReader.IsDBNull(2) ? myReader.GetDateTime(2).ToString(AppUtils.DateTime_Format_All) : "";
                            ri.requester    = !myReader.IsDBNull(3) ? myReader.GetString(3) : "";
                            values.Add(ri);
                        }
                    }
                }

                dr = DbHelperOra.ExecuteReader(oraclestr, oracleConnection);
                if (null != dr && dr.HasRows)
                {
                    while (dr.Read())
                    {
                        AlipayReportList ri = new AlipayReportList();
                        ri.doctadviseno = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        ri.examinaim    = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        ri.requesttime  = !dr.IsDBNull(2) ? dr.GetDateTime(2).ToString(AppUtils.DateTime_Format_All) : "";
                        ri.requester    = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        values.Add(ri);
                    }
                }
                if (values.Count > 0)
                {
                    ret = 0;
                }
                else
                {
                    values = null;
                    msg    = "未能找到报告单";
                    ret    = 17;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                values = null;
                msg    = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != myReader)
                {
                    myReader.Close();
                }
                oracleConnection.Close();
                sqlConnection.Close();
            }
        }