/// <summary>
        /// Creates a new PerformanceStandardType record
        /// </summary>
        public static int Create(PerformanceStandardTypeDO DO)
        {
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _Description
            };

            return DataCommon.ExecuteScalar("[dbo].[PerformanceStandardType_Insert]", _params, "dbo");
        }
        /// <summary>
        /// Deletes a PerformanceStandardType record
        /// </summary>
        public static int Delete(PerformanceStandardTypeDO DO)
        {
            SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int);

            _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID;

            SqlParameter[] _params = new SqlParameter[] {
                _PerformanceStandardTypeID
            };

            return DataCommon.ExecuteScalar("[dbo].[PerformanceStandardType_Delete]", _params, "dbo");
        }
        /// <summary>
        /// Gets all PerformanceStandardType records
        /// </summary>
        public static PerformanceStandardTypeDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PerformanceStandardType_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                PerformanceStandardTypeDO obj = new PerformanceStandardTypeDO();

                obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Selects PerformanceStandardType records by PK
        /// </summary>
        public static PerformanceStandardTypeDO[] GetByPK(Int32 PerformanceStandardTypeID)
        {
            SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int);

            _PerformanceStandardTypeID.Value = PerformanceStandardTypeID;

            SqlParameter[] _params = new SqlParameter[] {
                _PerformanceStandardTypeID
            };

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

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

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

                obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Updates a PerformanceStandardType record and returns the number of records affected
        /// </summary>
        public static int Update(PerformanceStandardTypeDO DO)
        {
            SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID;
            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _PerformanceStandardTypeID,
                _Description
            };

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