예제 #1
0
        //------------------------------------------
        #endregion

        #region --------------GetObject--------------
        public static SiteOtherValuesEntity GetObject(SiteOtherValuesItems seetingID)
        {
            SiteOtherValuesEntity siteOtherValues = SiteOtherValuesSqlDataPrvider.Instance.GetObject(seetingID);

            //return the object
            return(siteOtherValues);
        }
        public SiteOtherValuesEntity GetObject(SiteOtherValuesItems seetingID)
        {
            SiteOtherValuesEntity siteOtherValues = null;

            using (SqlConnection myConnection = GetSqlConnection())
            {
                SqlCommand myCommand = new SqlCommand("SiteOtherValues_GetOneByID", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                // Set the parameters
                myCommand.Parameters.Add("@SeetingID", SqlDbType.Int, 4).Value = (int)seetingID;
                // Execute the command
                myConnection.Open();
                using (SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    if (dr.Read())
                    {
                        siteOtherValues = PopulateEntity(dr);
                    }
                    dr.Close();
                }
                myConnection.Close();
                return(siteOtherValues);
            }
        }