/// <summary> /// Retrieve Credential for compare purposes /// - name, description, cred type, education level, /// - industries, occupations /// - owner role /// - duration /// - estimated costs /// </summary> /// <param name="id"></param> /// <returns></returns> public static ThisEntity GetCredentialForCompare(int id) { //not clear if checks necessary, as interface only allows selection of those to which the user has access. AppUser user = AccountServices.GetCurrentUser(); LoggingHelper.DoTrace(2, string.Format("GetCredentialForCompare - using new compare get for cred: {0}", id)); //================================================ string statusMessage = ""; string key = "credentialCompare_" + id.ToString(); ThisEntity entity = new ThisEntity(); if (CacheManager.IsCredentialAvailableFromCache(id, key, ref entity)) { //check if user can update the object string status = ""; //if ( !CanUserUpdateCredential( id, user, ref status ) ) // entity.CanEditRecord = false; return(entity); } CredentialRequest cr = new CredentialRequest(); cr.IsCompareRequest(); DateTime start = DateTime.Now; entity = CredentialManager.GetForCompare(id, cr); //if ( CanUserUpdateCredential( entity, user, ref statusMessage ) ) // entity.CanUserEditEntity = true; DateTime end = DateTime.Now; int elasped = (end - start).Seconds; if (elasped > 1) { CacheManager.AddCredentialToCache(entity, key); } return(entity); } //