Пример #1
0
        /// <summary>
        /// Deletes a OtherPermitType record
        /// </summary>
        public static int Delete(OtherPermitTypeDO DO)
        {
            SqlParameter _OtherPermitTypeID = new SqlParameter("OtherPermitTypeID", SqlDbType.VarChar);

            _OtherPermitTypeID.Value = DO.OtherPermitTypeID;

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

            return DataCommon.ExecuteScalar("[dbo].[OtherPermitType_Delete]", _params, "dbo");
        }
Пример #2
0
        /// <summary>
        /// Creates a new OtherPermitType record
        /// </summary>
        public static void Create(OtherPermitTypeDO DO)
        {
            SqlParameter _OtherPermitTypeID = new SqlParameter("OtherPermitTypeID", SqlDbType.VarChar);

            _OtherPermitTypeID.Value = DO.OtherPermitTypeID;

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

            DataCommon.ExecuteNonQuery("[dbo].[OtherPermitType_Insert]", _params, "dbo");
        }
Пример #3
0
        /// <summary>
        /// Gets all OtherPermitType records
        /// </summary>
        public static OtherPermitTypeDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[OtherPermitType_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                OtherPermitTypeDO obj = new OtherPermitTypeDO();

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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Пример #4
0
        /// <summary>
        /// Selects OtherPermitType records by PK
        /// </summary>
        public static OtherPermitTypeDO[] GetByPK(String OtherPermitTypeID)
        {
            SqlParameter _OtherPermitTypeID = new SqlParameter("OtherPermitTypeID", SqlDbType.VarChar);

            _OtherPermitTypeID.Value = OtherPermitTypeID;

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

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

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

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

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

                objs.Add(obj);
            }

            return objs.ToArray();
        }