Esempio n. 1
0
        /// <summary>
        /// Deletes a PermitStatus record
        /// </summary>
        public static int Delete(PermitStatusDO DO)
        {
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);

            _PermitStatusID.Value = DO.PermitStatusID;

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

            return DataCommon.ExecuteScalar("[dbo].[PermitStatus_Delete]", _params, "dbo");
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new PermitStatus record
        /// </summary>
        public static void Create(PermitStatusDO DO)
        {
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);

            _PermitStatusID.Value = DO.PermitStatusID;

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

            DataCommon.ExecuteNonQuery("[dbo].[PermitStatus_Insert]", _params, "dbo");
        }
Esempio n. 3
0
        /// <summary>
        /// Gets all PermitStatus records
        /// </summary>
        public static PermitStatusDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PermitStatus_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                PermitStatusDO obj = new PermitStatusDO();

                obj.PermitStatusID = sr.GetString(sr.GetOrdinal("PermitStatusID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Esempio n. 4
0
        /// <summary>
        /// Selects PermitStatus records by PK
        /// </summary>
        public static PermitStatusDO[] GetByPK(String PermitStatusID)
        {
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);

            _PermitStatusID.Value = PermitStatusID;

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

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

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

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

                obj.PermitStatusID = sr.GetString(sr.GetOrdinal("PermitStatusID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }