/// <summary>
        /// Deletes a ActivityLog record
        /// </summary>
        public static int Delete(ActivityLogDO DO)
        {
            SqlParameter _ActivityLogID = new SqlParameter("ActivityLogID", SqlDbType.Int);

            _ActivityLogID.Value = DO.ActivityLogID;

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

            return DataCommon.ExecuteScalar("[dbo].[ActivityLog_Delete]", _params, "dbo");
        }
        /// <summary>
        /// Creates a new ActivityLog record
        /// </summary>
        public static int Create(ActivityLogDO DO)
        {
            SqlParameter _ActivityLogDate = new SqlParameter("ActivityLogDate", SqlDbType.DateTime);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _ActivityLogDate.Value = DO.ActivityLogDate;
            _Description.Value = DO.Description;

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

            return DataCommon.ExecuteScalar("[dbo].[ActivityLog_Insert]", _params, "dbo");
        }
        /// <summary>
        /// Gets all ActivityLog records
        /// </summary>
        public static ActivityLogDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ActivityLog_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                ActivityLogDO obj = new ActivityLogDO();

                obj.ActivityLogID = sr.GetInt32(sr.GetOrdinal("ActivityLogID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                if (sr.IsDBNull(sr.GetOrdinal("ActivityLogDate"))) { obj.ActivityLogDate = null; } else { obj.ActivityLogDate = sr.GetDateTime(sr.GetOrdinal("ActivityLogDate")); }

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Selects ActivityLog records by PK
        /// </summary>
        public static ActivityLogDO[] GetByPK(Int32 ActivityLogID)
        {
            SqlParameter _ActivityLogID = new SqlParameter("ActivityLogID", SqlDbType.Int);

            _ActivityLogID.Value = ActivityLogID;

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

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

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

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

                obj.ActivityLogID = sr.GetInt32(sr.GetOrdinal("ActivityLogID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                if (sr.IsDBNull(sr.GetOrdinal("ActivityLogDate"))) { obj.ActivityLogDate = null; } else { obj.ActivityLogDate = sr.GetDateTime(sr.GetOrdinal("ActivityLogDate")); }

                objs.Add(obj);
            }

            return objs.ToArray();
        }