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

FillFromReader() static private method

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

            colIndex = reader.GetOrdinal(CN_FORM_ROLE_ID);
            if (!reader.IsDBNull(colIndex))
                formRole.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_FORM_ROLE_ACCESS_TYPE);
            if (!reader.IsDBNull(colIndex))
                formRole.AccessType = (CMSEnums.AccessType)reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_FORM_ROLE_FORM_ID);
            if (!reader.IsDBNull(colIndex))
                formRole.FormID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_FORM_ROLE_ROLE_ID);
            if (!reader.IsDBNull(colIndex))
                formRole.RoleID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(RoleDataMapper.CN_ROLE_NAME);
            if (!reader.IsDBNull(colIndex))
                formRole.RoleName = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(FormDataMapper.CN_FORM_CODE);
            if (!reader.IsDBNull(colIndex))
                formRole.FormCode = reader.GetString(colIndex);
        }