Example #1
0
        /// <summary>
        /// 一个检验报告单抬头信息
        /// </summary>
        /// <param name="doctadviseno">条码号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_InspectionReportNameInformation(string doctadviseno, out AlipayReportInfo alipayReportInfo, out string msg)
        {
            msg = "";
            alipayReportInfo = new AlipayReportInfo();

            OracleConnection oracleConnection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            SqlConnection    sqlConnection    = new SqlConnection(WebConfigParameter.ConnectionLisString);
            OracleDataReader dr       = null;
            SqlDataReader    myReader = null;

            int ret = -1;

            try
            {
                bool   _flag     = false;
                string sqlstr    = "";
                string oraclestr = "";
                _builder.GetInspectionReportNameInformation(doctadviseno, out sqlstr, out oraclestr, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlstr);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, oraclestr);

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

                msg = "";
                dr  = DbHelperOra.ExecuteReader(oraclestr, oracleConnection);
                if (null != dr && dr.HasRows)
                {
                    if (dr.Read())
                    {
                        alipayReportInfo.doctadviseno     = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        alipayReportInfo.requesttime      = !dr.IsDBNull(1) ? dr.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.requester        = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        alipayReportInfo.executetime      = !dr.IsDBNull(3) ? dr.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.executer         = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        alipayReportInfo.receivetime      = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.receiver         = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                        alipayReportInfo.stayhospitalmode = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                        alipayReportInfo.patientid        = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        alipayReportInfo.section          = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        alipayReportInfo.bedno            = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        alipayReportInfo.patientname      = !dr.IsDBNull(11) ? dr.GetString(11) : "";
                        alipayReportInfo.sex         = !dr.IsDBNull(12) ? dr.GetString(12) : "";
                        alipayReportInfo.age         = !dr.IsDBNull(13) ? dr.GetString(13) : "";
                        alipayReportInfo.diagnostic  = !dr.IsDBNull(14) ? dr.GetString(14) : "";
                        alipayReportInfo.sampletype  = !dr.IsDBNull(15) ? dr.GetString(15) : "";
                        alipayReportInfo.examinaim   = !dr.IsDBNull(16) ? dr.GetString(16) : "";
                        alipayReportInfo.requestmode = !dr.IsDBNull(17) ? dr.GetString(17) : "";
                        alipayReportInfo.checker     = !dr.IsDBNull(18) ? dr.GetString(18) : "";
                        alipayReportInfo.checktime   = !dr.IsDBNull(19) ? dr.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.csyq        = !dr.IsDBNull(20) ? dr.GetString(20) : "";
                        alipayReportInfo.profiletest = !dr.IsDBNull(21) ? dr.GetString(21) : "";
                        ret = 0;
                    }
                    return(ret);
                }

                if (!string.IsNullOrEmpty(WebConfigParameter.ConnectionLisString))
                {
                    myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection);
                    if (null != myReader && myReader.HasRows)
                    {
                        if (myReader.Read())
                        {
                            alipayReportInfo.doctadviseno     = !myReader.IsDBNull(0) ? myReader.GetString(0) : "";
                            alipayReportInfo.requesttime      = !myReader.IsDBNull(1) ? myReader.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.requester        = !myReader.IsDBNull(2) ? myReader.GetString(2) : "";
                            alipayReportInfo.executetime      = !myReader.IsDBNull(3) ? myReader.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.executer         = !myReader.IsDBNull(4) ? myReader.GetString(4) : "";
                            alipayReportInfo.receivetime      = !myReader.IsDBNull(5) ? myReader.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.receiver         = !myReader.IsDBNull(6) ? myReader.GetString(6) : "";
                            alipayReportInfo.stayhospitalmode = !myReader.IsDBNull(7) ? myReader.GetString(7) : "";
                            alipayReportInfo.patientid        = !myReader.IsDBNull(8) ? myReader.GetString(8) : "";
                            alipayReportInfo.section          = !myReader.IsDBNull(9) ? myReader.GetString(9) : "";
                            alipayReportInfo.bedno            = !myReader.IsDBNull(10) ? myReader.GetString(10) : "";
                            alipayReportInfo.patientname      = !myReader.IsDBNull(11) ? myReader.GetString(11) : "";
                            alipayReportInfo.sex = !myReader.IsDBNull(12) ? Convert.ToString(myReader.GetInt32(12)) : "";
                            if (alipayReportInfo.sex == "1")
                            {
                                alipayReportInfo.sex = "男";
                            }
                            else if (alipayReportInfo.sex == "2")
                            {
                                alipayReportInfo.sex = "女";
                            }
                            alipayReportInfo.age         = !myReader.IsDBNull(13) ? Convert.ToString(myReader.GetDouble(13)) : "";
                            alipayReportInfo.diagnostic  = !myReader.IsDBNull(14) ? myReader.GetString(14) : "";
                            alipayReportInfo.sampletype  = !myReader.IsDBNull(15) ? myReader.GetString(15) : "";
                            alipayReportInfo.examinaim   = !myReader.IsDBNull(16) ? myReader.GetString(16) : "";
                            alipayReportInfo.requestmode = !myReader.IsDBNull(17) ? myReader.GetString(17) : "";
                            alipayReportInfo.checker     = !myReader.IsDBNull(18) ? myReader.GetString(18) : "";
                            alipayReportInfo.checktime   = !myReader.IsDBNull(19) ? myReader.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.csyq        = !myReader.IsDBNull(20) ? myReader.GetString(20) : "";
                            alipayReportInfo.profiletest = !myReader.IsDBNull(21) ? myReader.GetString(21) : "";
                            ret = 0;
                        }
                    }
                }
                else
                {
                    msg = "未能找到报告单";
                    ret = 17;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != myReader)
                {
                    myReader.Close();
                }
                oracleConnection.Close();
                sqlConnection.Close();
            }
        }
Example #2
0
        /// <summary>
        /// 一个化验报告单抬头信息
        /// </summary>
        /// <param name="doctadviseno">条码号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_LaboratoryTestsReportNameInformation(string doctadviseno, out AlipayReportInfo alipayReportInfo, out string msg)
        {
            msg = "";
            alipayReportInfo = new AlipayReportInfo();

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

            int ret = -1;

            try
            {
                bool   _flag    = false;
                double number   = Convert.ToDouble(doctadviseno);
                string findText = _builder.GetLaboratoryTestsReportNameInformation(number, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findText);

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

                msg = "";
                dr  = DbHelperOra.ExecuteReader(findText, connection);
                if (null != dr && dr.HasRows)
                {
                    if (dr.Read())
                    {
                        alipayReportInfo.doctadviseno     = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                        alipayReportInfo.requesttime      = !dr.IsDBNull(1) ? dr.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.requester        = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        alipayReportInfo.executetime      = !dr.IsDBNull(3) ? dr.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.executer         = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        alipayReportInfo.receivetime      = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.receiver         = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                        alipayReportInfo.stayhospitalmode = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                        alipayReportInfo.patientid        = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        alipayReportInfo.section          = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        alipayReportInfo.bedno            = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        alipayReportInfo.patientname      = !dr.IsDBNull(11) ? dr.GetString(11) : "";
                        alipayReportInfo.sex         = !dr.IsDBNull(12) ? dr.GetString(12) : "";
                        alipayReportInfo.age         = !dr.IsDBNull(13) ? dr.GetString(13) : "";
                        alipayReportInfo.diagnostic  = !dr.IsDBNull(14) ? dr.GetString(14) : "";
                        alipayReportInfo.sampletype  = !dr.IsDBNull(15) ? dr.GetString(15) : "";
                        alipayReportInfo.examinaim   = !dr.IsDBNull(16) ? dr.GetString(16) : "";
                        alipayReportInfo.requestmode = !dr.IsDBNull(17) ? dr.GetString(17) : "";
                        alipayReportInfo.checker     = !dr.IsDBNull(18) ? dr.GetString(18) : "";
                        alipayReportInfo.checktime   = !dr.IsDBNull(19) ? dr.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.csyq        = !dr.IsDBNull(20) ? dr.GetString(20) : "";
                        alipayReportInfo.profiletest = !dr.IsDBNull(21) ? dr.GetString(21) : "";
                        ret = 0;
                    }
                }
                else
                {
                    msg = "未能找到报告单";
                    ret = 17;
                }

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