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

FillFromReader() static private method

static private FillFromReader ( Gallery gallery, System.Data.SqlClient.SqlDataReader reader ) : void
gallery AJH.CMS.Core.Entities.Gallery
reader System.Data.SqlClient.SqlDataReader
return void
        internal static void FillFromReader(Gallery gallery, SqlDataReader reader)
        {
            int colIndex = 0;
            colIndex = reader.GetOrdinal(CN_GALLERY_CATEGORY_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.CategoryID = reader.GetInt32(colIndex);

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

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

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

            colIndex = reader.GetOrdinal(CN_GALLERY_DESCRIPTION);
            if (!reader.IsDBNull(colIndex))
                gallery.Description = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_DETAILS);
            if (!reader.IsDBNull(colIndex))
                gallery.Details = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_FILE);
            if (!reader.IsDBNull(colIndex))
                gallery.File = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                gallery.IsDeleted = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_KEYWORDS);
            if (!reader.IsDBNull(colIndex))
                gallery.KeyWords = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_LANGUAGE_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.LanguageID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_NAME);
            if (!reader.IsDBNull(colIndex))
                gallery.Name = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_SUMMARY);
            if (!reader.IsDBNull(colIndex))
                gallery.Summary = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_PORTAL_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.PortalID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_SEO_NAME);
            if (!reader.IsDBNull(colIndex))
                gallery.SEOName = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_URL);
            if (!reader.IsDBNull(colIndex))
                gallery.URL = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_TYPE);
            if (!reader.IsDBNull(colIndex))
                gallery.GalleryType = (CMSEnums.GalleryType)reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_ITEM_TYPE);
            if (!reader.IsDBNull(colIndex))
                gallery.GalleryItemType = (CMSEnums.GalleryItemType)reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_ORDER);
            if (!reader.IsDBNull(colIndex))
                gallery.Order = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_CREATED_BY);
            if (!reader.IsDBNull(colIndex))
                gallery.CreatedBy = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_GALLERY_PARENT_OBJ_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.ParentObjectID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(PublishDataMapper.CN_PUBLISH_TYPE_ID);
            if (!reader.IsDBNull(colIndex))
                gallery.IsPublished = reader.GetInt32(colIndex) == (int)AJH.CMS.Core.Enums.CMSEnums.PublishType.PublishNow;
        }