public static ValidationFormat GetRegularExpressionByStateId(int StateId) { int validationRuleId = StateHelper.GetStateById(StateId).ValidationRuleId.Value; ValidationRule validationRule = LicenseValidationHelper.GetValidationRuleById(validationRuleId); ValidationFormat validationFormat = new ValidationFormat(); validationFormat.RegularExpression = validationRule.RegularExpression; validationFormat.IsSSN = validationRule.IsSSN; validationFormat.IsUserLoggedIn = false; validationFormat.SSN = string.Empty; validationFormat.ErrorMessage = validationRule.Description; if (SessionWrapper.LoggedUser != null) { validationFormat.IsUserLoggedIn = true; User user = UserHelper.GetUserById(SessionWrapper.LoggedUser.UserId); if (validationFormat.IsSSN) { if (!string.IsNullOrEmpty(user.IdentificationValue)) { validationFormat.SSN = EncryptionHelper.Decryptdata(user.IdentificationValue); } } if (validationRule.IsLastCharcter) { validationFormat.RegularExpression = validationFormat.RegularExpression.Replace("[a-zA-Z]", user.LastName[0].ToString()); } } return(validationFormat); }
public PersonalData GetXMLNode() { PersonalData personalData = new PersonalData(); string region = StateHelper.GetStateById(_user.StateId).AlphaCode; personalData.PersonName = new PersonName(); personalData.PersonName.GivenName = _user.FirstName; personalData.PersonName.MiddleName = _user.MiddleName; personalData.PersonName.FamilyName = _user.LastName; personalData.DemographicDetail = new DemographicDetail(); personalData.DemographicDetail.DateOfBirth = DateTime.Parse(_user.Birthday.ToString()).ToShortDateString(); personalData.DemographicDetail.GovernmentId = new GovernmentId(); personalData.DemographicDetail.GovernmentId.Value = string.IsNullOrEmpty(_user.IdentificationValue)?null: Decryptdata(_user.IdentificationValue); personalData.PostalAddress = new PostalAddress(); personalData.PostalAddress.PostalCode = _user.Zip; personalData.PostalAddress.Region = region; personalData.PostalAddress.Municipality = region; personalData.PostalAddress.DeliveryAddress = new DeliveryAddress(); personalData.PostalAddress.DeliveryAddress.AddressLine = _user.Address1; personalData.PostalAddress.DeliveryAddress.StreetName = _user.Address2; personalData.EmailAddress = _user.Email; personalData.Telephone = _user.CellPhone; return(personalData); }
public EducationScreening GetXMLNode() { EducationScreening educationalScreening = new EducationScreening(); string region = StateHelper.GetStateById(_educationalDetails.StateId).AlphaCode; educationalScreening.Region = region; educationalScreening.EducationHistory = new EducationHistory(); educationalScreening.EducationHistory.SchoolOrInstitution = new SchoolOrInstitution(); educationalScreening.EducationHistory.SchoolOrInstitution.SchoolName = _educationalDetails.University; educationalScreening.EducationHistory.SchoolOrInstitution.LocationSummary = new LocationSummary(); educationalScreening.EducationHistory.SchoolOrInstitution.LocationSummary.Municipality = _educationalDetails.Municipality; educationalScreening.EducationHistory.SchoolOrInstitution.LocationSummary.Region = region; educationalScreening.EducationHistory.SchoolOrInstitution.Degree = new Degree(); educationalScreening.EducationHistory.SchoolOrInstitution.Degree.degreeType = _educationalDetails.Basic; educationalScreening.EducationHistory.SchoolOrInstitution.Degree.DegreeName = _educationalDetails.Specialization; educationalScreening.EducationHistory.SchoolOrInstitution.DatesOfAttendance = new DatesOfAttendance(); educationalScreening.EducationHistory.SchoolOrInstitution.DatesOfAttendance.StartDate = new StartDate(); //educationalScreening.EducationHistory.SchoolOrInstitution.DatesOfAttendance.StartDate.StringDate = _educationalDetails.StartDate.ToShortDateString(); string date = _educationalDetails.StartYear + "-" + _educationalDetails.StartMonth + "TO" + _educationalDetails.EndYear + "-" + _educationalDetails.EndMonth; educationalScreening.EducationHistory.SchoolOrInstitution.DatesOfAttendance.StartDate.StringDate = date; return(educationalScreening); }
public EmploymentScreening GetXMLNode() { EmploymentScreening employmentScreening = new EmploymentScreening(); string region = StateHelper.GetStateById(_employmentDetail.StateId).AlphaCode; employmentScreening.OrganizationName = _employmentDetail.OrgName; employmentScreening.ContactInfo = new ContactInfo(); employmentScreening.ContactInfo.Telephone = _employmentDetail.Telephone; employmentScreening.ContactInfo.PersonName = new ReferencePersonName(); employmentScreening.ContactInfo.PostalAddress = new PostalAddress(); employmentScreening.ContactInfo.PostalAddress.Region = region; employmentScreening.Title = _employmentDetail.PositionTitle; //employmentScreening.StartDate = _employmentDetail.StartDate.ToShortDateString(); employmentScreening.StartDate = _employmentDetail.StartYear + "-" + _employmentDetail.StartMonth + "01"; if (_employmentDetail.EndMonth != 0) { employmentScreening.EndDate = _employmentDetail.EndYear + "-" + _employmentDetail.EndMonth + "01"; // employmentScreening.EndDate = _employmentDetail.EndDate.HasValue ? _employmentDetail.EndDate.Value.ToString("MM/dd/yyyy") : ""; } return(employmentScreening); }
public StateCriminalScreening GetStateCriminalNode() { StateCriminalScreening stateScreening = new StateCriminalScreening(); string region = StateHelper.GetStateById(_user.StateId).AlphaCode; stateScreening.Region = region; return(stateScreening); }
public InstaCriminalSingleStateScreening GetSingleStateCriminalNode() { InstaCriminalSingleStateScreening singleState = new InstaCriminalSingleStateScreening(); string region = StateHelper.GetStateById(_user.StateId).AlphaCode; singleState.Region = region; return(singleState); }
public FederalCriminalScreening GetFederalCriminalNode() { FederalCriminalScreening federalCriminal = new FederalCriminalScreening(); string region = StateHelper.GetStateById(_user.StateId).AlphaCode; //federalCriminal.Region = region; //federalCriminal.District = _user.District; //dummy values need to change //federalCriminal.Region = "PA"; //federalCriminal.District = "Middle"; return(federalCriminal); }
public LicenseScreening GetLicenseXMLNode() { string region = StateHelper.GetStateById(_licenseInfo.StateId).AlphaCode; LicenseScreening licenseScreening = new LicenseScreening(); licenseScreening.SearchLicense = new SearchLicense(); licenseScreening.SearchLicense.License = new SearchLicenseLicense(); licenseScreening.Region = region; licenseScreening.SearchLicense.License.LicenseName = _licenseInfo.LicenseName; licenseScreening.SearchLicense.License.LicenseNumber = _licenseInfo.LicenseNumber; //licenseScreening.SearchLicense.License.LicensingAgency = _licenseInfo.LicensingAgency; licenseScreening.SearchLicense.License.LicensingAgency = region; return licenseScreening; }
private void SetUserLicenseInfo() { UserLicenseInfo userLicenseInfo = UserLicenseInfoHelper.GetUserLicenseInfoByUserId(SessionWrapper.LoggedUser.UserId); if (userLicenseInfo != null) { txtNumber.Text = userLicenseInfo.LicenseNumber; txtName.Text = userLicenseInfo.LicenseName; // txtAgency.Text = userLicenseInfo.LicensingAgency; ddlStateLicense.Index = userLicenseInfo.StateId; ValidationRule validationRule = LicenseValidationHelper.GetValidationRuleById(StateHelper.GetStateById(userLicenseInfo.StateId).ValidationRuleId.Value); string regExp = validationRule.RegularExpression; regExp = regExp.Replace(@"\", @"\\"); User user = UserHelper.GetUserById(SessionWrapper.LoggedUser.UserId); if (validationRule.IsLastCharcter) { string lastCharacter = user.LastName[0].ToString(); regExp = regExp.Replace("[a-zA-Z]", lastCharacter); } string SSN = string.Empty; if (validationRule.IsSSN) { SSN = user.IdentificationValue.Replace("-", string.Empty); } hdnIsLoggedIn.Value = "True"; hdnIsSSN.Value = validationRule.IsSSN.ToString(); hdnRegularExp.Value = validationRule.RegularExpression; hdnSSN.Value = SSN; hdnErrorMessage.Value = validationRule.Description; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "LicenseWrapper('" + regExp + "' ,'" + validationRule.IsSSN + "','" + true + "','" + SSN + "');", true); } }