Ejemplo n.º 1
0
        public static TopLevelObject GetEntityAsTopLevelObject(Guid uid)
        {
            TopLevelObject tlo = new TopLevelObject();

            var entity = EntityManager.GetEntity(uid, false);

            if (entity == null || entity.Id == 0)
            {
                return(null);
            }
            //
            if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_CREDENTIAL)
            {
                //actually should return some type info
                tlo = CredentialManager.GetBasic(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_ORGANIZATION)
            {
                tlo = OrganizationManager.GetBasics(entity.EntityUid);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_ASSESSMENT_PROFILE)
            {
                tlo = AssessmentManager.GetBasic(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_LEARNING_OPP_PROFILE)
            {
                tlo = LearningOpportunityManager.GetBasic(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_PATHWAY)
            {
                tlo = PathwayManager.GetBasic(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_PATHWAY_COMPONENT)
            {
                tlo = PathwayComponentManager.Get(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_PATHWAY_SET)
            {
                tlo = PathwaySetManager.Get(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            else if (entity.EntityTypeId == CodesManager.ENTITY_TYPE_TRANSFER_VALUE_PROFILE)
            {
                tlo = TransferValueProfileManager.Get(entity.EntityBaseId);
                tlo.EntityTypeId = entity.EntityTypeId;
            }
            return(tlo);
        }
        public static PathwaySet PathwaySetGetDetail(int id)
        {
            var entity = PathwaySetManager.Get(id, true);

            return(entity);
        }
        //public static PathwaySet PathwaySetGetDetailByCtid( string ctid, bool skippingCache = false )
        //{
        //	var entity = new PathwaySet();
        //	if ( string.IsNullOrWhiteSpace( ctid ) )
        //		return entity;
        //	var record = PathwaySetManager.GetByCtid( ctid );

        //	return PathwaySetGetDetail( record.Id, skippingCache );
        //}
        public static PathwaySet PathwaySetGetBasic(int id)
        {
            var entity = PathwaySetManager.Get(id);

            return(entity);
        }