Пример #1
0
        public static void Login(string username, string password, HttpRequest.RequestResult resultHandler)
        {
            var loginObj = new
            {
                Username = username,
                Password = password
            };

            RockApi.Post_CustomEndPoint(RockApi.BaseUrl + EndPoint_Login, loginObj, resultHandler);
        }
Пример #2
0
        public static void RegisterNewUser(string username, string password, string firstName, string lastName, string email, string phoneNumberText, HttpRequest.RequestResult resultHandler)
        {
            //JHM 2-28-17 WOAH TWO YEARS LATER!?! This was in the old crappy RegisterNewUser, replaced by this slick one. But I gotta keep the comment below, cause I gotta be me!
            //JHM 3-11-15 ALMOST FRIDAY THE 13th SIX YEARS LATER YAAAHH!!!!!
            //Until we release, or at least are nearly done testing, do not allow actual user registrations.
            //resultHandler( HttpStatusCode.OK, "" );
            //return;
            //

            RegAccountData regAccountModel = new RegAccountData()
            {
                Username = username,
                Password = password,

                FirstName = firstName,
                LastName  = lastName,
                Email     = email,

                CellPhoneNumber = phoneNumberText
            };

            RockApi.Post_CustomEndPoint(RockApi.BaseUrl + EndPoint_Register, regAccountModel,
                                        delegate(HttpStatusCode statusCode, string statusDescription)
            {
                // Everything worked
                if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                {
                    resultHandler(statusCode, statusDescription);
                }
                // Login already exists
                else if (HttpStatusCode.Unauthorized == statusCode)
                {
                    resultHandler(statusCode, RegisterStrings.RegisterResult_LoginUsed);
                }
                // Person already exists in Rock (with no login)
                else if (HttpStatusCode.Conflict == statusCode)
                {
                    resultHandler(statusCode, RegisterStrings.RegisterResult_PersonAlreadyExistsNoLogin);
                }
                // Person already exists in Rock (WITH a login)
                else if (HttpStatusCode.NotAcceptable == statusCode)
                {
                    resultHandler(statusCode, RegisterStrings.RegisterResult_PersonAlreadyExistsWithLogin);
                }
                // Random failure
                else
                {
                    resultHandler(statusCode, GeneralStrings.Network_Result_FailedText);
                }
            }
                                        );
        }
Пример #3
0
        public static void JoinGroup(int groupId, string firstName, string lastName, string spouseName, string email, string phone, HttpRequest.RequestResult resultHandler)
        {
            // build the object we'll send
            GroupRegModel groupRegModel = new GroupRegModel( )
            {
                RequestedGroupId = groupId,
                FirstName        = firstName,
                LastName         = lastName,
                SpouseName       = spouseName,
                Email            = email,
                Phone            = phone
            };

            RockApi.Post_CustomEndPoint(RockApi.BaseUrl + EndPoint_GroupRegistration, groupRegModel, resultHandler);
        }