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

FillFromReader() static private method

static private FillFromReader ( Template template, System.Data.SqlClient.SqlDataReader reader ) : void
template AJH.CMS.Core.Entities.Template
reader System.Data.SqlClient.SqlDataReader
return void
        internal static void FillFromReader(Template template, SqlDataReader reader)
        {
            int colIndex = 0;

            int days = 0, seconds = 0;
            colIndex = reader.GetOrdinal(CN_TEMPLATE_CREATION_DAY);
            if (!reader.IsDBNull(colIndex))
                days = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_CREATION_SEC);
            if (!reader.IsDBNull(colIndex))
                seconds = reader.GetInt32(colIndex);

            template.CreationDate = CMSCoreHelper.GetDateTime(days, seconds);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_DESCRIPTION);
            if (!reader.IsDBNull(colIndex))
                template.Description = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_DETAILS);
            if (!reader.IsDBNull(colIndex))
                template.Details = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_ID);
            if (!reader.IsDBNull(colIndex))
                template.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_IMAGE);
            if (!reader.IsDBNull(colIndex))
                template.Image = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                template.IsDeleted = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_LANGUAGE_ID);
            if (!reader.IsDBNull(colIndex))
                template.LanguageID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_NAME);
            if (!reader.IsDBNull(colIndex))
                template.Name = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_PORTAL_ID);
            if (!reader.IsDBNull(colIndex))
                template.PortalID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_TEMPLATE_CREATED_BY);
            if (!reader.IsDBNull(colIndex))
                template.CreatedBy = reader.GetInt32(colIndex);
        }