Esempio n. 1
0
        /// <summary>
        /// 通知病人就诊信息
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public int DB_InformPatient(out ArrayList values, out string msg)
        {
            int ret = -1;
            //1代表以预约
            int Preengagestate = 1;

            values = null;
            msg    = "";
            values = new ArrayList();

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

            try
            {
                bool _flag = false;

                string interText = _builder.GetInformPatientSql(Preengagestate, out _flag, out msg);

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

                dr = DbHelperOra.ExecuteReader(interText, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        while (dr.Read())
                        {
                            InformPatientInfo ri = new InformPatientInfo();
                            ri.userid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                            ri.brxm   = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                            ri.ysxm   = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                            ri.jzdz   = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                            ri.jzsj   = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                            ri.jzrq   = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : " ";
                            values.Add(ri);
                        }
                        msg = "获取成功";
                    }
                    ret = 0;
                    dr.Close();
                    return(ret);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }

            return(ret);
        }