コード例 #1
0
 /// <summary>
 /// Persists the object.
 /// </summary>
 public virtual void Persist(RefinanceImprovementsType persistObject)
 {
     // Make a call to the overloaded method with a null transaction
     Persist(persistObject, null);
 }
コード例 #2
0
        /// <summary>
        /// Fills a single instance with data based on its primary key values.
        /// </summary>
        public virtual void Fill(RefinanceImprovementsType rit, System.Int16 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(RefinanceImprovementsType.GetConnectionString());

            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(RefinanceImprovementsType.GetConnectionString(), "gsp_SelectRefinanceImprovementsType");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@id"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectRefinanceImprovementsType", sqlparams);


                    if (datareader.Read())
                    {
                        rit.SetMembers(ref datareader);
                    }


                    cnn.Close();                     // close the connection
                }


                // nullify the connection var
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }