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

FillFromReader() static private method

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

            colIndex = reader.GetOrdinal(CN_MODULE_CREATED_BY);
            if (!reader.IsDBNull(colIndex))
                module.CreatedBy = reader.GetInt32(colIndex);

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

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

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

            colIndex = reader.GetOrdinal(CN_MODULE_DESCRIPTION);
            if (!reader.IsDBNull(colIndex))
                module.Description = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_MODULE_ID);
            if (!reader.IsDBNull(colIndex))
                module.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_MODULE_IMAGE);
            if (!reader.IsDBNull(colIndex))
                module.Image = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_MODULE_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                module.IsDeleted = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_MODULE_NAME);
            if (!reader.IsDBNull(colIndex))
                module.Name = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_MODULE_PARENT_ID);
            if (!reader.IsDBNull(colIndex))
                module.ParentID = reader.GetInt32(colIndex);
        }