Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
For the certain Members I have created properties like
var mts = Services.MemberTypeService; var mt = mts.Get("Member"); var groups = mt.PropertyGroups; if (!groups.Any(x => x.Name == "Details")) { mt.AddPropertyGroup("Details"); } CreatePropertyTypeIfNotExists(mt, "IDNumber"); CreatePropertyTypeIfNotExists(mt, "FirstName"); CreatePropertyTypeIfNotExists(mt, "LastName"); CreatePropertyTypeIfNotExists(mt, "ContactNumber"); CreatePropertyTypeIfNotExists(mt, "AlternateContactNumber"); CreatePropertyTypeIfNotExists(mt, "Address"); CreatePropertyTypeIfNotExists(mt, "AddressCity"); CreatePropertyTypeIfNotExists(mt, "Province"); CreatePropertyTypeIfNotExists(mt, "PostalCode"); mts.Save(mt);
Then I'm inserting the values:
var memberService = Services.MemberService; var m2 = memberService.GetByUsername(model.CreateUsername); m2.Properties["IDNumber"].Value = model.IDNumber; m2.Properties["FirstName"].Value = model.FirstName; m2.Properties["LastName"].Value = model.LastName; m2.Properties["ContactNumber"].Value = model.ContactNumber; m2.Properties["AlternateContactNumber"].Value = model.AlternateContactNumber; m2.Properties["Address"].Value = model.Address; m2.Properties["Province"].Value = model.Province; m2.Properties["PostalCode"].Value = model.PostalCode; m2.Properties["AddressCity"].Value = model.AddressCity; m2.Properties["Province"].Value = model.Province; m2.Properties["PostalCode"].Value = model.PostalCode; memberService.Save(m2);
now in Razor I would like to take those properties. I have like
var mid = Members.GetCurrentMember();
How do I get rest of the address?
Hi Sonja
Use "GetPropertyValue" method.
var mid = Members.GetCurrentMember(); var IDNumber = mid.GetPropertyValue("IDNumber");
Thanks,
Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Getting values for created property types in members
Hi,
For the certain Members I have created properties like
Then I'm inserting the values:
now in Razor I would like to take those properties. I have like
How do I get rest of the address?
Hi Sonja
Use "GetPropertyValue" method.
Thanks,
Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.