public static bool validateMemberProfileModel(VLCMemberProfileModel MemberProfileModel) { var validationResults = new List <ValidationResult>(); //validate MemberProfileModel var validationContext = new ValidationContext(MemberProfileModel, serviceProvider: null, items: null); bool isValid = System.ComponentModel.DataAnnotations.Validator.TryValidateObject(MemberProfileModel, validationContext, validationResults, true); return(isValid); }
public bool UpdateVlcMemberProfile(VLCMemberProfileModel profile) { if (VLCMemberProfileValidation.validateMemberProfileModel(profile)) { int currentUserMemberId = _asaMemberAdapter.GetMemberIdFromContext(); profile.MemberID = currentUserMemberId; return(_asaMemberAdapter.UpdateVlcProfile(profile)); } return(false); }
public static VLCUserProfileContract ToDataContract(this VLCMemberProfileModel profile) { return(new VLCUserProfileContract() { MemberID = profile.MemberID, EnrollmentStatus = profile.EnrollmentStatus, GraduationDate = profile.GraduationDate, AdjustedGrossIncome = profile.AdjustedGrossIncome, FamilySize = Convert.ToByte(profile.FamilySize), RepaymentStatus = profile.RepaymentStatus, StateOfResidence = profile.StateOfResidence, TaxFilingStatus = profile.TaxFilingStatus }); }
/// <summary> /// Updates or creates the member VLC profile. /// </summary> /// <param name="profile">The vlc profile to update.</param> /// <returns></returns> public bool UpdateVlcProfile(VLCMemberProfileModel profile) { return(SaltServiceAgent.UpdateVlcProfile(profile.ToDataContract())); }
//TODO change this to accept VLCMemberProfile model public bool UpdateVlcProfile(VLCMemberProfileModel profile) { throw new NotImplementedException(); }