示例#1
0
        public static void GetPersonForEdit(Rock.Client.GroupMember groupMember, PersonEditResponseDelegate response)
        {
            // get their attributes before presenting.
            ApplicationApi.GetPersonById(groupMember.Person.Id, true,
                                         delegate(System.Net.HttpStatusCode statusCode, string statusDescription, Rock.Client.Person refreshedPerson)
            {
                if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) && refreshedPerson != null)
                {
                    // get the people allowed to check them in
                    string query = string.Format("?personId={0}&relationshipRoleId={1}", groupMember.Person.Id, Config.Instance.AllowedCheckInByRole.Id);

                    RockApi.Get_GroupMembers_KnownRelationships(query, delegate(HttpStatusCode knownRelationshipCode, string knownRelationshipDesc, List <Rock.Client.GroupMember> groupMembers)
                    {
                        if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode))
                        {
                            // and lastly, from that, get the families of these group members
                            if (groupMembers.Count > 0)
                            {
                                GroupMembersToFamilyGroups(refreshedPerson, groupMembers, response);
                            }
                            else
                            {
                                response(refreshedPerson, null);
                            }
                        }
                        else
                        {
                            response(null, null);
                        }
                    });
                }
                else
                {
                    response(null, null);
                }
            });
        }