Example #1
0
        /// <summary>
        /// Creates a new Quadrangle record
        /// </summary>
        public static void Create(QuadrangleDO DO)
        {
            SqlParameter _FIPSStateID = new SqlParameter("FIPSStateID", SqlDbType.VarChar);
            SqlParameter _FIPSCountyID = new SqlParameter("FIPSCountyID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);
            SqlParameter _QuadrangleID = new SqlParameter("QuadrangleID", SqlDbType.VarChar);
            SqlParameter _Latitude = new SqlParameter("Latitude", SqlDbType.VarChar);
            SqlParameter _Longitude = new SqlParameter("Longitude", SqlDbType.VarChar);

            _FIPSStateID.Value = DO.FIPSStateID;
            _FIPSCountyID.Value = DO.FIPSCountyID;
            _Description.Value = DO.Description;
            _QuadrangleID.Value = DO.QuadrangleID;
            _Latitude.Value = DO.Latitude;
            _Longitude.Value = DO.Longitude;

            SqlParameter[] _params = new SqlParameter[] {
                _FIPSStateID,
                _FIPSCountyID,
                _Description,
                _QuadrangleID,
                _Latitude,
                _Longitude
            };

            DataCommon.ExecuteNonQuery("[dbo].[Quadrangle_Insert]", _params, "dbo");
        }
Example #2
0
        /// <summary>
        /// Deletes a Quadrangle record
        /// </summary>
        public static int Delete(QuadrangleDO DO)
        {
            SqlParameter _QuadrangleID = new SqlParameter("QuadrangleID", SqlDbType.VarChar);

            _QuadrangleID.Value = DO.QuadrangleID;

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

            return DataCommon.ExecuteScalar("[dbo].[Quadrangle_Delete]", _params, "dbo");
        }
Example #3
0
        /// <summary>
        /// Gets all Quadrangle records
        /// </summary>
        public static QuadrangleDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[Quadrangle_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                QuadrangleDO obj = new QuadrangleDO();

                obj.FIPSStateID = sr.GetString(sr.GetOrdinal("FIPSStateID"));
                obj.FIPSCountyID = sr.GetString(sr.GetOrdinal("FIPSCountyID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                obj.QuadrangleID = sr.GetString(sr.GetOrdinal("QuadrangleID"));
                obj.Latitude = sr.GetString(sr.GetOrdinal("Latitude"));
                obj.Longitude = sr.GetString(sr.GetOrdinal("Longitude"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Example #4
0
        /// <summary>
        /// Selects Quadrangle records by PK
        /// </summary>
        public static QuadrangleDO[] GetByPK(String QuadrangleID)
        {
            SqlParameter _QuadrangleID = new SqlParameter("QuadrangleID", SqlDbType.VarChar);

            _QuadrangleID.Value = QuadrangleID;

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

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

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

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

                obj.FIPSStateID = sr.GetString(sr.GetOrdinal("FIPSStateID"));
                obj.FIPSCountyID = sr.GetString(sr.GetOrdinal("FIPSCountyID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                obj.QuadrangleID = sr.GetString(sr.GetOrdinal("QuadrangleID"));
                obj.Latitude = sr.GetString(sr.GetOrdinal("Latitude"));
                obj.Longitude = sr.GetString(sr.GetOrdinal("Longitude"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }