Esempio n. 1
0
        /// <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");
        }
Esempio n. 2
0
        /// <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");
        }
Esempio n. 3
0
        /// <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();
        }
Esempio n. 4
0
        /// <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();
        }