Beispiel #1
0
        public static void GetPersonById(int id, bool loadAttributes, HttpRequest.RequestResult <Rock.Client.Person> resultHandler)
        {
            string oDataFilter = "/" + id.ToString( );

            if (loadAttributes == true)
            {
                oDataFilter += "?LoadAttributes=simple";
            }

            RockApi.Get_People <Rock.Client.Person>(oDataFilter, resultHandler);
        }
Beispiel #2
0
        public static void GetPersonByGuid(Guid guid, HttpRequest.RequestResult <Rock.Client.Person> resultHandler)
        {
            string oDataFilter = string.Format("?$filter=Guid eq guid'{0}'", guid.ToString( ));

            RockApi.Get_People <List <Rock.Client.Person> >(oDataFilter,
                                                            delegate(HttpStatusCode statusCode, string statusDescription, List <Rock.Client.Person> personList)
            {
                Rock.Client.Person returnPerson = null;

                if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true && personList != null && personList.Count > 0)
                {
                    returnPerson = personList[0];
                }

                resultHandler(statusCode, statusDescription, returnPerson);
            });
        }