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

FillFromReader() static private method

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

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

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

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

            colIndex = reader.GetOrdinal(CN_CATEGORY_DESCRIPTION);
            if (!reader.IsDBNull(colIndex))
                category.Description = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_ID);
            if (!reader.IsDBNull(colIndex))
                category.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                category.IsDeleted = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_LANGUAGE_ID);
            if (!reader.IsDBNull(colIndex))
                category.LanguageID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_MODULE_ID);
            if (!reader.IsDBNull(colIndex))
                category.ModuleID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_NAME);
            if (!reader.IsDBNull(colIndex))
                category.Name = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_PORTAL_ID);
            if (!reader.IsDBNull(colIndex))
                category.PortalID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_PARENT_ID);
            if (!reader.IsDBNull(colIndex))
                category.ParentID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_ORDER);
            if (!reader.IsDBNull(colIndex))
                category.Order = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_CREATED_BY);
            if (!reader.IsDBNull(colIndex))
                category.CreatedBy = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_CATEGORY_IMAGE);
            if (!reader.IsDBNull(colIndex))
                category.Image = reader.GetString(colIndex);
        }