コード例 #1
0
        /// <summary>
        /// Deletes a ThreatenedAndEndangeredSpeciesList record
        /// </summary>
        public static int Delete(ThreatenedAndEndangeredSpeciesListDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar);

            _PermitKey.Value = DO.PermitKey;
            _ThreatenedAndEndangeredSpecies.Value = DO.ThreatenedAndEndangeredSpecies;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _ThreatenedAndEndangeredSpecies
            };

            return DataCommon.ExecuteScalar("[dbo].[ThreatenedAndEndangeredSpeciesList_Delete]", _params, "dbo");
        }
コード例 #2
0
        /// <summary>
        /// Creates a new ThreatenedAndEndangeredSpeciesList record
        /// </summary>
        public static void Create(ThreatenedAndEndangeredSpeciesListDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar);

            _PermitKey.Value = DO.PermitKey;
            _ThreatenedAndEndangeredSpecies.Value = DO.ThreatenedAndEndangeredSpecies;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _ThreatenedAndEndangeredSpecies
            };

            DataCommon.ExecuteNonQuery("[dbo].[ThreatenedAndEndangeredSpeciesList_Insert]", _params, "dbo");
        }
コード例 #3
0
        /// <summary>
        /// Gets all ThreatenedAndEndangeredSpeciesList records
        /// </summary>
        public static ThreatenedAndEndangeredSpeciesListDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ThreatenedAndEndangeredSpeciesList_GetAll]", new SqlParameter[] { }, "dbo");

            List<ThreatenedAndEndangeredSpeciesListDO> objs = new List<ThreatenedAndEndangeredSpeciesListDO>();

            while(sr.Read()){

                ThreatenedAndEndangeredSpeciesListDO obj = new ThreatenedAndEndangeredSpeciesListDO();

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.ThreatenedAndEndangeredSpecies = sr.GetString(sr.GetOrdinal("ThreatenedAndEndangeredSpecies"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #4
0
        /// <summary>
        /// Selects ThreatenedAndEndangeredSpeciesList records by PK
        /// </summary>
        public static ThreatenedAndEndangeredSpeciesListDO[] GetByPK(Int32 PermitKey,
 String ThreatenedAndEndangeredSpecies)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar);

            _PermitKey.Value = PermitKey;
            _ThreatenedAndEndangeredSpecies.Value = ThreatenedAndEndangeredSpecies;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _ThreatenedAndEndangeredSpecies
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ThreatenedAndEndangeredSpeciesList_GetByPK]", _params, "dbo");

            List<ThreatenedAndEndangeredSpeciesListDO> objs = new List<ThreatenedAndEndangeredSpeciesListDO>();

            while(sr.Read())
            {
                ThreatenedAndEndangeredSpeciesListDO obj = new ThreatenedAndEndangeredSpeciesListDO();

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.ThreatenedAndEndangeredSpecies = sr.GetString(sr.GetOrdinal("ThreatenedAndEndangeredSpecies"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }