Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • SlothMonkey 17 posts 56 karma points
    Jan 16, 2015 @ 10:39
    SlothMonkey
    0

    Access one members properties from another member type

    What I'm wanting to do is create a dynamic member in umbraco that has access to the properties other another member group.

    Right now I'm creating a standard member and filling outs it data via a form like so:

    Member newMember;
    MemberType demoMemberType = MemberType.GetByAlias("Member");
    
    private void SomeMethod(ModelClass newEmployee)
    {
    
        if (!memberSevice.Exists(newEmployee.FirstName + newEmployee.LastName))
        {
         newMember = Member.MakeNew(newEmployee.FirstName  + newEmployee.LastName , demoMemberType, new umbraco.BusinessLogic.User(0));
        }
        else if (memberSevice.Exists(newEmployee.FirstName + newEmployee.LastName))
        {
    
          int count = 0;
          count = count + memberSevice.Count();
          newMember = Member.MakeNew(newEmployee.FirstName + newEmployee.LastName + count, demoMemberType, new umbraco.BusinessLogic.User(0));
         }
    
          newMember.getProperty("firstName").Value = newEmployee.FirstName;
          newMember.Save();
    }
    

    The Member is the stardard member that comes with Umbraco when you install it. However, I've added in a forum add on that has created a new member type called Dialogue MemberI've tried creating a new Dialogue member by simple changing the following line

    MemberType demoMemberType = MemberType.GetByAlias("Dialogue Member")
    

    I've done that with and without the space between the words but nothing worked.

    With my normal member I do have access to the Member Groups that Dialogue Member has created and I can add my normal Member to one of these groups. However, when I log in to the forum, I have no ability to create new posts, edit my user info and things like. My theory is that I don't have access to the properties that are unique to Dialogue Memberand I have no idea how I can get access to them.

    Does anyone know how I may access the properties of Dialogue Member from my Memberthrough code?

  • 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.

Please Sign in or register to post replies