コード例 #1
0
        public List <SYS_Exception> SelectAllSYS_Exception()
        {
            List <SYS_Exception> sys_exception = new List <SYS_Exception>();
            DbDataReader         reader        = null;
            DbConnection         connection    = Common.CreateConnection(Common.ConnectionString);

            connection.Open();
            try
            {
                reader = _DbHelper.ExecuteReader(connection, Common.DatabaseSchema + "[SYS_Exception_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    SYS_ExceptionDataAccess.SetListSYS_ExceptionInfo(ref reader, ref sys_exception);
                }
                return(sys_exception);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_ExceptionDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                connection.Close();
            }
        }
コード例 #2
0
        public SYS_Exception SelectSYS_Exception(int ID)
        {
            SYS_Exception sys_exception = new SYS_Exception();
            DbDataReader  reader        = null;
            DbConnection  connection    = Common.CreateConnection(Common.ConnectionString);

            connection.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_ID, ID, false));

                reader = _DbHelper.ExecuteReader(connection, Common.DatabaseSchema + "[SYS_Exception_SelectById]", para.ToArray());
                if (reader.HasRows && reader.Read())
                {
                    SYS_ExceptionDataAccess.SetSYS_ExceptionInfo(reader, ref sys_exception);
                }
                return(sys_exception);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("SYS_ExceptionDataAccess.SelectById: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                connection.Close();
            }
        }
コード例 #3
0
        private static void SetListSYS_ExceptionInfo(ref DbDataReader reader, ref List <SYS_Exception> sys_exceptions)
        {
            SYS_Exception sys_exception = null;

            while (reader.Read())
            {
                sys_exception = new SYS_Exception();
                SYS_ExceptionDataAccess.SetSYS_ExceptionInfo(reader, ref sys_exception);
                sys_exceptions.Add(sys_exception);
            }
        }