AJH.CMS.Core.Data.TemplateDataMapper.GetTemplate C# (CSharp) Method

GetTemplate() static private method

static private GetTemplate ( int TemplateID ) : Template
TemplateID int
return AJH.CMS.Core.Entities.Template
        internal static Template GetTemplate(int TemplateID)
        {
            Template template = null;

            using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
            {
                SqlCommand sqlCommand = new SqlCommand(SN_TEMPLATE_GET_BY_ID, sqlConnection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter sqlParameter = new SqlParameter(PN_TEMPLATE_ID, System.Data.SqlDbType.Int);
                sqlParameter.Direction = System.Data.ParameterDirection.Input;
                sqlParameter.Value = TemplateID;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlCommand.Connection.Open();
                using (SqlDataReader reader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    while (reader.Read())
                    {
                        if (template == null)
                            template = new Template();
                        FillFromReader(template, reader);
                    }
                    reader.Close();
                    sqlCommand.Connection.Close();
                }
            }
            return template;
        }

Same methods

TemplateDataMapper::GetTemplate ( List