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

FillFromReader() static private method

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

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

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

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

            colIndex = reader.GetOrdinal(CN_STYLE_DETAILS);
            if (!reader.IsDBNull(colIndex))
                style.Details = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_FILE_NAME);
            if (!reader.IsDBNull(colIndex))
                style.FileName = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_ID);
            if (!reader.IsDBNull(colIndex))
                style.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                style.IsDeleted = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_LANGUAGE_ID);
            if (!reader.IsDBNull(colIndex))
                style.LanguageID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_NAME);
            if (!reader.IsDBNull(colIndex))
                style.Name = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_PORTAL_ID);
            if (!reader.IsDBNull(colIndex))
                style.PortalID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_STYLE_CREATED_BY);
            if (!reader.IsDBNull(colIndex))
                style.CreatedBy = reader.GetInt32(colIndex);
        }