public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonWorkIdentifier bo) { /*! Check for missing values */ if (bo.PersonWorkIDIsNull) { bo.PersonWorkIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.WorkExternalTypeIDIsNull) { bo.WorkExternalTypeIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.IdentifierIsNull) { bo.IdentifierErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.IdentifierIsNull) { if (bo.Identifier.Length > 250) { bo.IdentifierErrors += "This field has more characters than the maximum that can be stored, i.e. 250 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.ErrorLog bo) { /*! Check for missing values */ if (bo.ExceptionIsNull) { bo.ExceptionErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.OccurredOnIsNull) { bo.OccurredOnErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.ProcessedIsNull) { bo.ProcessedErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.InternalUsernameIsNull) { if (bo.InternalUsername.Length > 11) { bo.InternalUsernameErrors += "This field has more characters than the maximum that can be stored, i.e. 11 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.RDF.Triple bo) { /*! Check for missing values */ if (bo.SubjectIsNull) { bo.SubjectErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PredicateIsNull) { bo.PredicateErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.ObjectIsNull) { bo.ObjectErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.TripleHashIsNull) { bo.TripleHashErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.WeightIsNull) { bo.WeightErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ }
public override void DBRulesCG(ProfilesRNSDLL.BO.RDF.Node bo) { /*! Check for missing values */ if (bo.ValueHashIsNull) { bo.ValueHashErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.ValueIsNull) { bo.ValueErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.LanguageIsNull) { if (bo.Language.Length > 255) { bo.LanguageErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.DataTypeIsNull) { if (bo.DataType.Length > 255) { bo.DataTypeErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.FieldLevelAuditTrail bo) { /*! Check for missing values */ if (bo.RecordLevelAuditTrailIDIsNull) { bo.RecordLevelAuditTrailIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.MetaFieldIDIsNull) { bo.MetaFieldIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.ValueBeforeIsNull) { if (bo.ValueBefore.Length > 50) { bo.ValueBeforeErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.ValueAfterIsNull) { if (bo.ValueAfter.Length > 50) { bo.ValueAfterErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } }
public static void AddIdentifier(ProfilesRNSDLL.BO.ORCID.PersonWork personWork, ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes workExternalType, string identifier) { ProfilesRNSDLL.BO.ORCID.PersonWorkIdentifier workIdentifier = new ProfilesRNSDLL.BLL.ORCID.PersonWorkIdentifier().GetByPersonWorkIDAndWorkExternalTypeIDAndIdentifier(personWork.PersonWorkID, (int)workExternalType, identifier); workIdentifier.WorkExternalTypeID = (int)workExternalType; workIdentifier.Identifier = identifier; personWork.Identifiers.Add(workIdentifier); }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.REFDecision bo) { /*! Check for missing values */ if (bo.DecisionDescriptionIsNull) { bo.DecisionDescriptionErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.DecisionDescriptionLongIsNull) { bo.DecisionDescriptionLongErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.DecisionDescriptionIsNull) { if (bo.DecisionDescription.Length > 150) { bo.DecisionDescriptionErrors += "This field has more characters than the maximum that can be stored, i.e. 150 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.DecisionDescriptionLongIsNull) { if (bo.DecisionDescriptionLong.Length > 500) { bo.DecisionDescriptionLongErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } }
public List<ProfilesRNSDLL.BO.ORCID.PersonAffiliation> GetForORCIDUpdate(ProfilesRNSDLL.BO.ORCID.Person orcidPerson, long subject, int profileDataPersonID) { List<ProfilesRNSDLL.BO.ORCID.PersonAffiliation> affiliations = GetAffiliations(profileDataPersonID); // Get the list of processed affiliations List<ProfilesRNSDLL.BO.ORCID.PersonAffiliation> processedAffiliations = GetSuccessfullyProcessedAffiliations(orcidPerson.PersonID); // Get the affiliations that have not been processed return (from p in affiliations where !processedAffiliations.Any(pa => pa.AffiliationTypeID == p.AffiliationTypeID && pa.ProfilesID == p.ProfilesID) select p).ToList(); }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.REFPermission bo) { /*! Check for missing values */ if (bo.PermissionScopeIsNull) { bo.PermissionScopeErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PermissionDescriptionIsNull) { bo.PermissionDescriptionErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.PermissionScopeIsNull) { if (bo.PermissionScope.Length > 100) { bo.PermissionScopeErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PermissionDescriptionIsNull) { if (bo.PermissionDescription.Length > 500) { bo.PermissionDescriptionErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.MethodAndRequestIsNull) { if (bo.MethodAndRequest.Length > 100) { bo.MethodAndRequestErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.SuccessMessageIsNull) { if (bo.SuccessMessage.Length > 1000) { bo.SuccessMessageErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.FailedMessageIsNull) { if (bo.FailedMessage.Length > 1000) { bo.FailedMessageErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Data.OrganizationInstitution bo) { /*! Check for missing values */ /*! Check for out of Range values */ if (!bo.InstitutionNameIsNull) { if (bo.InstitutionName.Length > 500) { bo.InstitutionNameErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.InstitutionAbbreviationIsNull) { if (bo.InstitutionAbbreviation.Length > 50) { bo.InstitutionAbbreviationErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } /* if (!bo.CityIsNull) { if (bo.City.Length > 500) { bo.CityErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.StateIsNull) { if (bo.State.Length > 2) { bo.StateErrors += "This field has more characters than the maximum that can be stored, i.e. 2 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.CountryIsNull) { if (bo.Country.Length > 2) { bo.CountryErrors += "This field has more characters than the maximum that can be stored, i.e. 2 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RingGoldIDIsNull) { if (bo.RingGoldID.Length > 100) { bo.RingGoldIDErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } */ }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Data.OrganizationDepartment bo) { /*! Check for missing values */ /*! Check for out of Range values */ if (!bo.DepartmentNameIsNull) { if (bo.DepartmentName.Length > 500) { bo.DepartmentNameErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Data.PersonFacultyRank bo) { /*! Check for missing values */ /*! Check for out of Range values */ if (!bo.FacultyRankIsNull) { if (bo.FacultyRank.Length > 100) { bo.FacultyRankErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonMessage bo) { /*! Check for missing values */ if (bo.PersonIDIsNull) { bo.PersonIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.ErrorMessageIsNull) { if (bo.ErrorMessage.Length > 1000) { bo.ErrorMessageErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.HttpResponseCodeIsNull) { if (bo.HttpResponseCode.Length > 50) { bo.HttpResponseCodeErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RequestURLIsNull) { if (bo.RequestURL.Length > 1000) { bo.RequestURLErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.HeaderPostIsNull) { if (bo.HeaderPost.Length > 1000) { bo.HeaderPostErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.UserMessageIsNull) { if (bo.UserMessage.Length > 2000) { bo.UserMessageErrors += "This field has more characters than the maximum that can be stored, i.e. 2000 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonOthername bo) { /*! Check for missing values */ if (bo.PersonIDIsNull) { bo.PersonIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.OtherNameIsNull) { if (bo.OtherName.Length > 500) { bo.OtherNameErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonToken bo) { /*! Check for missing values */ if (bo.PersonIDIsNull) { bo.PersonIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PermissionIDIsNull) { bo.PermissionIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.AccessTokenIsNull) { bo.AccessTokenErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.TokenExpirationIsNull) { bo.TokenExpirationErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.AccessTokenIsNull) { if (bo.AccessToken.Length > 50) { bo.AccessTokenErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RefreshTokenIsNull) { if (bo.RefreshToken.Length > 50) { bo.RefreshTokenErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.RecordLevelAuditTrail bo) { /*! Check for missing values */ if (bo.MetaTableIDIsNull) { bo.MetaTableIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.RowIdentifierIsNull) { bo.RowIdentifierErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.RecordLevelAuditTypeIDIsNull) { bo.RecordLevelAuditTypeIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.CreatedDateIsNull) { bo.CreatedDateErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.CreatedByIsNull) { bo.CreatedByErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.CreatedByIsNull) { if (bo.CreatedBy.Length > 10) { bo.CreatedByErrors += "This field has more characters than the maximum that can be stored, i.e. 10 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORNG.AppRegistry bo) { /*! Check for missing values */ if (bo.nodeidIsNull) { bo.nodeidErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.appIdIsNull) { bo.appIdErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.visibilityIsNull) { if (bo.visibility.Length > 50) { bo.visibilityErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.RDF.Security.Group bo) { /*! Check for missing values */ if (bo.SecurityGroupIDIsNull) { bo.SecurityGroupIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.LabelIsNull) { bo.LabelErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.LabelIsNull) { if (bo.Label.Length > 255) { bo.LabelErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORNG.AppData bo) { /*! Check for missing values */ if (bo.nodeIdIsNull) { bo.nodeIdErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.appIdIsNull) { bo.appIdErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.keynameIsNull) { bo.keynameErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.keynameIsNull) { if (bo.keyname.Length > 255) { bo.keynameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.valueIsNull) { if (bo.value.Length > 4000) { bo.valueErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Import.FreetextKeywords bo) { /*! Check for missing values */ if (bo.InternalUsernameIsNull) { bo.InternalUsernameErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.KeywordIsNull) { bo.KeywordErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.DisplaySecurityGroupIDIsNull) { bo.DisplaySecurityGroupIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.InternalUsernameIsNull) { if (bo.InternalUsername.Length > 50) { bo.InternalUsernameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.KeywordIsNull) { if (bo.Keyword.Length > 250) { bo.KeywordErrors += "This field has more characters than the maximum that can be stored, i.e. 250 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Data.Person bo) { /*! Check for missing values */ /*! Check for out of Range values */ if (!bo.FirstNameIsNull) { if (bo.FirstName.Length > 50) { bo.FirstNameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.LastNameIsNull) { if (bo.LastName.Length > 50) { bo.LastNameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.MiddleNameIsNull) { if (bo.MiddleName.Length > 50) { bo.MiddleNameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.DisplayNameIsNull) { if (bo.DisplayName.Length > 255) { bo.DisplayNameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.SuffixIsNull) { if (bo.Suffix.Length > 50) { bo.SuffixErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.EmailAddrIsNull) { if (bo.EmailAddr.Length > 255) { bo.EmailAddrErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PhoneIsNull) { if (bo.Phone.Length > 35) { bo.PhoneErrors += "This field has more characters than the maximum that can be stored, i.e. 35 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.FaxIsNull) { if (bo.Fax.Length > 25) { bo.FaxErrors += "This field has more characters than the maximum that can be stored, i.e. 25 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.AddressLine1IsNull) { if (bo.AddressLine1.Length > 255) { bo.AddressLine1Errors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.AddressLine2IsNull) { if (bo.AddressLine2.Length > 255) { bo.AddressLine2Errors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.AddressLine3IsNull) { if (bo.AddressLine3.Length > 255) { bo.AddressLine3Errors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.AddressLine4IsNull) { if (bo.AddressLine4.Length > 255) { bo.AddressLine4Errors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.CityIsNull) { if (bo.City.Length > 55) { bo.CityErrors += "This field has more characters than the maximum that can be stored, i.e. 55 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.StateIsNull) { if (bo.State.Length > 50) { bo.StateErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.ZipIsNull) { if (bo.Zip.Length > 50) { bo.ZipErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.BuildingIsNull) { if (bo.Building.Length > 255) { bo.BuildingErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RoomIsNull) { if (bo.Room.Length > 255) { bo.RoomErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.AddressStringIsNull) { if (bo.AddressString.Length > 1000) { bo.AddressStringErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.InternalUsernameIsNull) { if (bo.InternalUsername.Length > 50) { bo.InternalUsernameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.Profile.Import.NIHAwards bo) { /*! Check for missing values */ if (bo.Application_IdIsNull) { bo.Application_IdErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.InternalUsernameIsNull) { bo.InternalUsernameErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.ImportIDIsNull) { bo.ImportIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.InternalUsernameIsNull) { if (bo.InternalUsername.Length > 50) { bo.InternalUsernameErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.ActivityIsNull) { if (bo.Activity.Length > 3) { bo.ActivityErrors += "This field has more characters than the maximum that can be stored, i.e. 3 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Administering_ICIsNull) { if (bo.Administering_IC.Length > 2) { bo.Administering_ICErrors += "This field has more characters than the maximum that can be stored, i.e. 2 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.ARRAIsNull) { if (bo.ARRA.Length > 1) { bo.ARRAErrors += "This field has more characters than the maximum that can be stored, i.e. 1 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.FOA_NumberIsNull) { if (bo.FOA_Number.Length > 17) { bo.FOA_NumberErrors += "This field has more characters than the maximum that can be stored, i.e. 17 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Full_Project_Num_DCIsNull) { if (bo.Full_Project_Num_DC.Length > 100) { bo.Full_Project_Num_DCErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Funding_ICsIsNull) { if (bo.Funding_ICs.Length > 300) { bo.Funding_ICsErrors += "This field has more characters than the maximum that can be stored, i.e. 300 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.IC_NameIsNull) { if (bo.IC_Name.Length > 255) { bo.IC_NameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.NIH_Reporting_CategoriesIsNull) { if (bo.NIH_Reporting_Categories.Length > 900) { bo.NIH_Reporting_CategoriesErrors += "This field has more characters than the maximum that can be stored, i.e. 900 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_CityIsNull) { if (bo.Org_City.Length > 255) { bo.Org_CityErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_CountryIsNull) { if (bo.Org_Country.Length > 50) { bo.Org_CountryErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_DeptIsNull) { if (bo.Org_Dept.Length > 255) { bo.Org_DeptErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_DUNSIsNull) { if (bo.Org_DUNS.Length > 255) { bo.Org_DUNSErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_FIPSIsNull) { if (bo.Org_FIPS.Length > 255) { bo.Org_FIPSErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_StateIsNull) { if (bo.Org_State.Length > 50) { bo.Org_StateErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Org_ZipCodeIsNull) { if (bo.Org_ZipCode.Length > 50) { bo.Org_ZipCodeErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.OrganizationIsNull) { if (bo.Organization.Length > 255) { bo.OrganizationErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PI_NamesIsNull) { if (bo.PI_Names.Length > 500) { bo.PI_NamesErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PI_PersonIdsIsNull) { if (bo.PI_PersonIds.Length > 500) { bo.PI_PersonIdsErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Project_NumIsNull) { if (bo.Project_Num.Length > 30) { bo.Project_NumErrors += "This field has more characters than the maximum that can be stored, i.e. 30 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Project_TermsIsNull) { if (bo.Project_Terms.Length > 4000) { bo.Project_TermsErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Project_TitleIsNull) { if (bo.Project_Title.Length > 255) { bo.Project_TitleErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RelevanceIsNull) { if (bo.Relevance.Length > 4000) { bo.RelevanceErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Study_SectionIsNull) { if (bo.Study_Section.Length > 4) { bo.Study_SectionErrors += "This field has more characters than the maximum that can be stored, i.e. 4 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Study_Section_NameIsNull) { if (bo.Study_Section_Name.Length > 255) { bo.Study_Section_NameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.SuffixIsNull) { if (bo.Suffix.Length > 6) { bo.SuffixErrors += "This field has more characters than the maximum that can be stored, i.e. 6 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Major_Component_NameIsNull) { if (bo.Major_Component_Name.Length > 255) { bo.Major_Component_NameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Core_Project_NumIsNull) { if (bo.Core_Project_Num.Length > 50) { bo.Core_Project_NumErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.CFDA_CodeIsNull) { if (bo.CFDA_Code.Length > 50) { bo.CFDA_CodeErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Ed_Inst_TypeIsNull) { if (bo.Ed_Inst_Type.Length > 100) { bo.Ed_Inst_TypeErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.Program_Officer_NameIsNull) { if (bo.Program_Officer_Name.Length > 255) { bo.Program_Officer_NameErrors += "This field has more characters than the maximum that can be stored, i.e. 255 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonAffiliation bo) { /*! Check for missing values */ if (bo.ProfilesIDIsNull) { bo.ProfilesIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.AffiliationTypeIDIsNull) { bo.AffiliationTypeIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PersonIDIsNull) { bo.PersonIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.DecisionIDIsNull) { bo.DecisionIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.OrganizationNameIsNull) { bo.OrganizationNameErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.DepartmentNameIsNull) { if (bo.DepartmentName.Length > 4000) { bo.DepartmentNameErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.RoleTitleIsNull) { if (bo.RoleTitle.Length > 200) { bo.RoleTitleErrors += "This field has more characters than the maximum that can be stored, i.e. 200 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.OrganizationNameIsNull) { if (bo.OrganizationName.Length > 4000) { bo.OrganizationNameErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.OrganizationCityIsNull) { if (bo.OrganizationCity.Length > 4000) { bo.OrganizationCityErrors += "This field has more characters than the maximum that can be stored, i.e. 4000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.OrganizationRegionIsNull) { if (bo.OrganizationRegion.Length > 2) { bo.OrganizationRegionErrors += "This field has more characters than the maximum that can be stored, i.e. 2 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.OrganizationCountryIsNull) { if (bo.OrganizationCountry.Length > 2) { bo.OrganizationCountryErrors += "This field has more characters than the maximum that can be stored, i.e. 2 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.DisambiguationIDIsNull) { if (bo.DisambiguationID.Length > 500) { bo.DisambiguationIDErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.DisambiguationSourceIsNull) { if (bo.DisambiguationSource.Length > 500) { bo.DisambiguationSourceErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } }
public List<BO.ORCID.PersonWork> GetForORCIDUpdate(ProfilesRNSDLL.BO.ORCID.Person orcidPerson, long subject, string sessionID) { const string WORK_TYPE = "journal-article"; List<BO.ORCID.PersonWork> pubs = new List<BO.ORCID.PersonWork>(); ProfilesRNSDLL.BO.ORCID.REFDecision visibilityForPublications = GetPublicationVisibility(subject); foreach (System.Data.DataRow dr in base.GetPublications(subject, sessionID).Table.Rows) { BO.ORCID.PersonWork pub = new BO.ORCID.PersonWork(); if (!dr.IsNull("prns_informationResourceReference")) { pub.WorkCitation = dr["prns_informationResourceReference"].ToString(); } if (!dr.IsNull("prns_publicationDate")) { pub.PubDate = DateTime.Parse(dr["prns_publicationDate"].ToString()); } if (!dr.IsNull("EntityID")) { pub.PubID = dr["EntityID"].ToString(); } if (!dr.IsNull("bibo_pmid") && !dr["bibo_pmid"].ToString().Trim().Equals(string.Empty)) { pub.PMID = int.Parse(dr["bibo_pmid"].ToString()); pub.DOI = ProfilesRNSDLL.BLL.ORCID.DOI.Get(pub.PMID.ToString()); AddIdentifier(pub, ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.pmid, pub.PMID.ToString()); } else { pub.DOI = GetDOI(pub, "http://dx.doi.org/"); } if (pub.DOI != ProfilesRNSDLL.BLL.ORCID.DOI.DOI_NOT_FOUND_MESSAGE) { AddIdentifier(pub, ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.doi, pub.DOI); } if (!dr.IsNull("URL")) { pub.URL = dr["URL"].ToString(); } if (!dr.IsNull("rdfs_label")) { pub.WorkTitle = dr["rdfs_label"].ToString(); } if (visibilityForPublications.Exists) { pub.DecisionID = visibilityForPublications.DecisionID; } pub.WorkType = WORK_TYPE; pubs.Add(pub); } // Get the list of processed pubs List<ProfilesRNSDLL.BO.ORCID.PersonWork> processedWorks = GetSuccessfullyProcessedWorks(orcidPerson.PersonID); // Get the pubmed pubs that haven't been processed. return (from p in pubs where !processedWorks.Any(pa => pa.PubID == p.PubID) select p).ToList(); }
private string GetDOI(ProfilesRNSDLL.BO.ORCID.PersonWork pub, string partialUrl) { if (pub.URL != null && pub.URL.Contains(partialUrl)) { string[] urlSplit = System.Text.RegularExpressions.Regex.Split(pub.URL, partialUrl); if (urlSplit.Count() > 1) { return urlSplit[1]; } //return pub.URL.Substring(pub.URL.IndexOf(partialUrl), pub.URL.Length - pub.URL.IndexOf(partialUrl)); } return ProfilesRNSDLL.BLL.ORCID.DOI.DOI_NOT_FOUND_MESSAGE; }
public bool CreateNewORCID(BO.ORCID.Person person, string loggedInInternalUsername, ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes failedStatus) { // Make sure an institution email has been provided. // Ensure that the new ORCID information can be saved in the database as it doesn't violate any business rules, e.g. missing internal username. if (!BizRulesForCreation(person)) { try { person.HasError = false; person.PersonStatusTypeID = (int)failedStatus; Edit(person, false); } catch { } return false; } try { ProfilesRNSDLL.BLL.ORCID.PersonMessage personMessageBLL = new PersonMessage(); ProfilesRNSDLL.BLL.ORCID.PersonOthername personOthernameBLL = new PersonOthername(); ProfilesRNSDLL.BLL.ORCID.PersonAlternateEmail personAlternateEmailBLL = new PersonAlternateEmail(); ProfilesRNSDLL.BLL.ORCID.PersonURL personURLBLL = new PersonURL(); ProfilesRNSDLL.BLL.ORCID.PersonWork personWorkBLL = new PersonWork(); ProfilesRNSDLL.BLL.ORCID.PersonAffiliation personAffiliationBLL = new PersonAffiliation(); if (PostNewORCIDRequestToORCIDAPI(person, loggedInInternalUsername)) { // Save the person record (includes the narrative, aka biography, if one was provided). person.PersonStatusTypeID = (int)ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Created; person.ORCIDRecorded = DateTime.Now; if (!Save(person)) { person.Error += "The ORCID was created but a problem (person save failed) occurred while saving the data in the BU database. "; return false; } // Create a message to save what was sent to ORCID. // Also mark the person with the person message ID if (!personMessageBLL.CreatePersonMessage(person)) { person.Error += "The ORCID was created but a problem (person message save failed) occurred while saving the data in the BU database. "; return false; } BLL.ORCID.PersonMessage.SetPersonMessageID(person); // Save the other names if (!personOthernameBLL.AddIfAny(person)) { person.Error += "The ORCID was created but a problem (saving of other names failed) occurred while saving the data in the BU database. "; return false; } // Save the alternate email addresses if (!personAlternateEmailBLL.AddIfAny(person)) { person.Error += "The ORCID was created but a problem (saving of alternate emails failed) occurred while saving the data in the BU database. "; return false; } // Save the urls if (!personURLBLL.AddIfAny(person)) { person.Error += "The ORCID was created but a problem (saving of urls failed) occurred while saving the data in the BU database. "; return false; } // Save the works if (!personWorkBLL.AddIfAny(person)) { person.Error += "The ORCID was created but a problem (saving of works failed) occurred while saving the data in the BU database. "; return false; } // Save the works if (!personAffiliationBLL.AddIfAny(person)) { person.Error += "The ORCID was created but a problem (saving of affiliations failed) occurred while saving the data in the BU database. "; return false; } return true; } else { person.HasError = false; person.PersonStatusTypeID = (int)failedStatus; try { Save(person, false); } catch (Exception ex) { throw BLL.ORCID.ErrorLog.LogError(ex, loggedInInternalUsername, "An error occurred while saving the fact that the batch push failed."); } return false; } } catch (Exception ex) { throw ErrorLog.LogError(ex, loggedInInternalUsername, "An error occurred while generating the messages to send to ORCID."); } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.PersonWork bo) { /*! Check for missing values */ if (bo.PersonIDIsNull) { bo.PersonIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.DecisionIDIsNull) { bo.DecisionIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.WorkTitleIsNull) { bo.WorkTitleErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PubIDIsNull) { bo.PubIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.WorkTypeIsNull) { if (bo.WorkType.Length > 500) { bo.WorkTypeErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.URLIsNull) { if (bo.URL.Length > 1000) { bo.URLErrors += "This field has more characters than the maximum that can be stored, i.e. 1000 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.WorkCitationTypeIsNull) { if (bo.WorkCitationType.Length > 500) { bo.WorkCitationTypeErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PublicationMediaTypeIsNull) { if (bo.PublicationMediaType.Length > 500) { bo.PublicationMediaTypeErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PubIDIsNull) { if (bo.PubID.Length > 50) { bo.PubIDErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } }
public override void DBRulesCG(ProfilesRNSDLL.BO.ORCID.Person bo) { /*! Check for missing values */ if (bo.InternalUsernameIsNull) { bo.InternalUsernameErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.PersonStatusTypeIDIsNull) { bo.PersonStatusTypeIDErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } if (bo.CreateUnlessOptOutIsNull) { bo.CreateUnlessOptOutErrors += "Required." + Environment.NewLine; bo.HasError = true; } else { } /*! Check for out of Range values */ if (!bo.InternalUsernameIsNull) { if (bo.InternalUsername.Length > 100) { bo.InternalUsernameErrors += "This field has more characters than the maximum that can be stored, i.e. 100 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.ORCIDIsNull) { if (bo.ORCID.Length > 50) { bo.ORCIDErrors += "This field has more characters than the maximum that can be stored, i.e. 50 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.FirstNameIsNull) { if (bo.FirstName.Length > 150) { bo.FirstNameErrors += "This field has more characters than the maximum that can be stored, i.e. 150 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.LastNameIsNull) { if (bo.LastName.Length > 150) { bo.LastNameErrors += "This field has more characters than the maximum that can be stored, i.e. 150 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.PublishedNameIsNull) { if (bo.PublishedName.Length > 500) { bo.PublishedNameErrors += "This field has more characters than the maximum that can be stored, i.e. 500 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.EmailAddressIsNull) { if (bo.EmailAddress.Length > 300) { bo.EmailAddressErrors += "This field has more characters than the maximum that can be stored, i.e. 300 characters." + Environment.NewLine; bo.HasError = true; } } if (!bo.BiographyIsNull) { if (bo.Biography.Length > 5000) { bo.BiographyErrors += "This field has more characters than the maximum that can be stored, i.e. 5000 characters." + Environment.NewLine; bo.HasError = true; } } }