コード例 #1
0
        public void onClickOfLogin(object sender, EventArgs e)
        {
            Debug.WriteLine("Email Id - " + entryEmail.Text);
            Debug.WriteLine("Password- " + entryPassword.Text);

            if (validateFields())
            {
                //Hit the API
                LoginRequestModel loginRequest = new LoginRequestModel();
                loginRequest.email    = entryEmail.Text;
                loginRequest.password = entryPassword.Text;
                if (NetworkReachabilityManager.isInternetAvailable())
                {
                    UserDialogs.Instance.ShowLoading("Loading ...", MaskType.Gradient);
                    LoginAPIManager.SharedManager.doLogin(loginRequest, (LoginResponse loginResponse, GPError error) =>
                    {
                        UserDialogs.Instance.HideLoading();
                        if (error != null)
                        {
                            DisplayAlert("Alert", error.Message, "OK");
                        }
                        else
                        {
                            //DisplayAlert("Message", "Login Successfull", "OK");
                            moveToRestaurantsScreen();
                        }
                    });
                }
                else
                {
                    DisplayAlert("Alert", "No internet connetion available", "OK");
                }
            }
        }
コード例 #2
0
        public void onClickOfLogin(object sender, EventArgs e)
        {
            Debug.WriteLine("Email Id - " + entryEmail.Text);
            Debug.WriteLine("Password- " + entryPassword.Text);

            if (validateFields())
            {
                //Hit the API
                LoginRequestModel loginRequest = new LoginRequestModel();
                loginRequest.email    = entryEmail.Text;
                loginRequest.password = entryPassword.Text;
                if (NetworkReachabilityManager.isInternetAvailable())
                {
                    LoginAPIManager.SharedManager.doLogin(loginRequest, (LoginResponse loginResponse, GPError error) =>
                    {
                    });
                }
                else
                {
                    DisplayAlert("Alert", "No internet connetion available", "OK");
                }
            }
        }