コード例 #1
0
        /// <summary>
        /// Deletes a Exemption record
        /// </summary>
        public static int Delete(ExemptionDO DO)
        {
            SqlParameter _ExemptionID = new SqlParameter("ExemptionID", SqlDbType.Int);

            _ExemptionID.Value = DO.ExemptionID;

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

            return DataCommon.ExecuteScalar("[dbo].[Exemption_Delete]", _params, "dbo");
        }
コード例 #2
0
        /// <summary>
        /// Creates a new Exemption record
        /// </summary>
        public static int Create(ExemptionDO DO)
        {
            SqlParameter _ExemptionTypeID = new SqlParameter("ExemptionTypeID", SqlDbType.Int);
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _RightsBeingClaimed = new SqlParameter("RightsBeingClaimed", SqlDbType.Bit);

            _ExemptionTypeID.Value = DO.ExemptionTypeID;
            _PermitKey.Value = DO.PermitKey;
            _RightsBeingClaimed.Value = DO.RightsBeingClaimed;

            SqlParameter[] _params = new SqlParameter[] {
                _ExemptionTypeID,
                _PermitKey,
                _RightsBeingClaimed
            };

            return DataCommon.ExecuteScalar("[dbo].[Exemption_Insert]", _params, "dbo");
        }
コード例 #3
0
        /// <summary>
        /// Gets all Exemption records
        /// </summary>
        public static ExemptionDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[Exemption_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                ExemptionDO obj = new ExemptionDO();

                obj.ExemptionID = sr.GetInt32(sr.GetOrdinal("ExemptionID"));
                obj.ExemptionTypeID = sr.GetInt32(sr.GetOrdinal("ExemptionTypeID"));
                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.RightsBeingClaimed = sr.GetBoolean(sr.GetOrdinal("RightsBeingClaimed"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #4
0
        /// <summary>
        /// Selects Exemption records by PK
        /// </summary>
        public static ExemptionDO[] GetByPK(Int32 ExemptionID)
        {
            SqlParameter _ExemptionID = new SqlParameter("ExemptionID", SqlDbType.Int);

            _ExemptionID.Value = ExemptionID;

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

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

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

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

                obj.ExemptionID = sr.GetInt32(sr.GetOrdinal("ExemptionID"));
                obj.ExemptionTypeID = sr.GetInt32(sr.GetOrdinal("ExemptionTypeID"));
                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.RightsBeingClaimed = sr.GetBoolean(sr.GetOrdinal("RightsBeingClaimed"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }