Пример #1
0
        /// <summary>
        /// Deletes a LocationCounties record
        /// </summary>
        public static int Delete(LocationCountiesDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _CountyID = new SqlParameter("CountyID", SqlDbType.Int);

            _PermitKey.Value = DO.PermitKey;
            _CountyID.Value = DO.CountyID;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _CountyID
            };

            return DataCommon.ExecuteScalar("[dbo].[LocationCounties_Delete]", _params, "dbo");
        }
Пример #2
0
        /// <summary>
        /// Creates a new LocationCounties record
        /// </summary>
        public static void Create(LocationCountiesDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _CountyID = new SqlParameter("CountyID", SqlDbType.Int);

            _PermitKey.Value = DO.PermitKey;
            _CountyID.Value = DO.CountyID;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _CountyID
            };

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

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

            while(sr.Read()){

                LocationCountiesDO obj = new LocationCountiesDO();

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.CountyID = sr.GetInt32(sr.GetOrdinal("CountyID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Пример #4
0
        /// <summary>
        /// Selects LocationCounties records by PK
        /// </summary>
        public static LocationCountiesDO[] GetByPK(Int32 PermitKey,
 Int32 CountyID)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _CountyID = new SqlParameter("CountyID", SqlDbType.Int);

            _PermitKey.Value = PermitKey;
            _CountyID.Value = CountyID;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _CountyID
            };

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

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

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

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.CountyID = sr.GetInt32(sr.GetOrdinal("CountyID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }