/// <summary>
        /// Deletes a ProposedSoilSalvageDepths record
        /// </summary>
        public static int Delete(ProposedSoilSalvageDepthsDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _SoilType = new SqlParameter("SoilType", SqlDbType.VarChar);

            _PermitKey.Value = DO.PermitKey;
            _SoilType.Value = DO.SoilType;

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

            return DataCommon.ExecuteScalar("[dbo].[ProposedSoilSalvageDepths_Delete]", _params, "dbo");
        }
        /// <summary>
        /// Gets all ProposedSoilSalvageDepths records
        /// </summary>
        public static ProposedSoilSalvageDepthsDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ProposedSoilSalvageDepths_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                ProposedSoilSalvageDepthsDO obj = new ProposedSoilSalvageDepthsDO();

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.SoilType = sr.GetString(sr.GetOrdinal("SoilType"));
                obj.SalvageDepth = sr.GetString(sr.GetOrdinal("SalvageDepth"));
                obj.Acres = sr.GetInt32(sr.GetOrdinal("Acres"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Creates a new ProposedSoilSalvageDepths record
        /// </summary>
        public static void Create(ProposedSoilSalvageDepthsDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _SoilType = new SqlParameter("SoilType", SqlDbType.VarChar);
            SqlParameter _SalvageDepth = new SqlParameter("SalvageDepth", SqlDbType.VarChar);
            SqlParameter _Acres = new SqlParameter("Acres", SqlDbType.Int);

            _PermitKey.Value = DO.PermitKey;
            _SoilType.Value = DO.SoilType;
            _SalvageDepth.Value = DO.SalvageDepth;
            _Acres.Value = DO.Acres;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _SoilType,
                _SalvageDepth,
                _Acres
            };

            DataCommon.ExecuteNonQuery("[dbo].[ProposedSoilSalvageDepths_Insert]", _params, "dbo");
        }
        /// <summary>
        /// Selects ProposedSoilSalvageDepths records by PK
        /// </summary>
        public static ProposedSoilSalvageDepthsDO[] GetByPK(Int32 PermitKey,
 String SoilType)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _SoilType = new SqlParameter("SoilType", SqlDbType.VarChar);

            _PermitKey.Value = PermitKey;
            _SoilType.Value = SoilType;

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

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

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

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

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.SoilType = sr.GetString(sr.GetOrdinal("SoilType"));
                obj.SalvageDepth = sr.GetString(sr.GetOrdinal("SalvageDepth"));
                obj.Acres = sr.GetInt32(sr.GetOrdinal("Acres"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Updates a ProposedSoilSalvageDepths record and returns the number of records affected
        /// </summary>
        public static int Update(ProposedSoilSalvageDepthsDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _SoilType = new SqlParameter("SoilType", SqlDbType.VarChar);
            SqlParameter _SalvageDepth = new SqlParameter("SalvageDepth", SqlDbType.VarChar);
            SqlParameter _Acres = new SqlParameter("Acres", SqlDbType.Int);

            _PermitKey.Value = DO.PermitKey;
            _SoilType.Value = DO.SoilType;
            _SalvageDepth.Value = DO.SalvageDepth;
            _Acres.Value = DO.Acres;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _SoilType,
                _SalvageDepth,
                _Acres
            };

            return DataCommon.ExecuteScalar("[dbo].[ProposedSoilSalvageDepths_Update]", _params, "dbo");
        }