public async void ClickSubmit()
        {
            Alogin.IsRunning = true;
            Alogin.IsVisible = true;

            try
            {
                //   var isMobileValid = App.Current.Properties.ContainsKey("IsMobileValid") ? (bool)App.Current.Properties["IsMobileValid"] : false;
                Boolean boolisValid = await IsValid();

                MobileNumber = mobilenumber.Text;

                if (boolisValid)
                {
                    string Inputs = "Mobile=" + MobileNumber;
                    string resp   = await RestService.ForgotPassword(Inputs);

                    var result = Newtonsoft.Json.JsonConvert.DeserializeObject <string>(resp);
                    Userid = result;

                    if (Userid == "0")
                    {
                        Alogin.IsRunning = false;
                        Alogin.IsVisible = false;
                        await DisplayAlert("Alert", "Mobile number doesn't exist", "Ok");

                        // await Navigation.PopToRootAsync();
                    }
                    else if (Userid == "-1")
                    {
                        Alogin.IsRunning = false;
                        Alogin.IsVisible = false;
                        await DisplayAlert("Alert", "Please verify your google account", "Ok");

                        await Navigation.PopToRootAsync();
                    }
                    else
                    {
                        string pageName   = "forgetpassword";
                        var    _Popupspec = new PopupOTPDialog(Userid, pageName);
                        await Navigation.PushPopupAsync(_Popupspec);
                    }
                }
                else
                {
                    Alogin.IsRunning = false;
                    Alogin.IsVisible = false;
                    // await DisplayAlert("Alert","Invalid Mobile Number","Ok");
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                Alogin.IsRunning = false;
                Alogin.IsVisible = false;
            }
            Alogin.IsRunning = false;
            Alogin.IsVisible = false;
        }
        private async void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            try
            {
                Boolean boolisValid = await IsValid();

                string verifycode = verify.Text;

                if (boolisValid)
                {
                    Alogin.IsRunning = true;
                    Alogin.IsVisible = true;

                    string Inputs = "UserUniqueID=" + useruniqueID.ToString() + "&GoogleVerificationCode=" + verifycode.ToString();
                    string resp   = await RestService.VerificationInsert(Inputs);

                    var result = Newtonsoft.Json.JsonConvert.DeserializeObject <string>(resp);

                    if (result == "1")
                    {
                        string pageName = "setpassword";
                        // await Navigation.PushAsync(new PopupOTPDialog(useruniqueID), false);
                        var _Popupspec = new PopupOTPDialog(useruniqueID, pageName);
                        await Navigation.PushPopupAsync(_Popupspec);
                    }
                    else
                    {
                        await DisplayAlert("Alert", "Network Issue", "Ok");
                    }
                }
                Alogin.IsRunning = false;
                Alogin.IsVisible = false;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                Alogin.IsRunning = false;
                Alogin.IsVisible = false;
            }
        }
예제 #3
0
        private async void CreateAccount(object sender, EventArgs e)
        {
            var isMobileValid = App.Current.Properties.ContainsKey("IsMobileValid") ? (bool)App.Current.Properties["IsMobileValid"] : false;

            try
            {
                Boolean boolisValid = await IsValid();

                if (boolisValid && isMobileValid)
                {
                    IsBusy = true;
                    uploadImage();
                    string MobileNumber = mobilenumber.Text;
                    string Storename    = storename.Text;
                    string StoreAddress = storeaddress.Text;

                    if (StoreAddress.Contains("&"))
                    {
                        StoreAddress = StoreAddress.Replace("&", "");
                    }

                    string storeAddress2 = storeaddress2.Text;
                    string StoreCity     = storestate.Items[storestate.SelectedIndex].ToString() + ":" + othercity.Text;
                    if (StoreCity.Contains("&"))
                    {
                        StoreCity = StoreCity.Replace("&", "");
                    }
                    string StoreState = storecity.Items[storecity.SelectedIndex].ToString();
                    if (StoreState.Contains("&"))
                    {
                        StoreState = StoreState.Replace("&", "");
                    }
                    string StoreZip         = storezip.Text;
                    string StorePhone       = storephone.Text;
                    string StoreEmail       = storeemail.Text;
                    string StoreWebsite     = storewebsite.Text;
                    string StoreArea        = storearea.Text;
                    string Businesscategory = businesscategory.Text;
                    string SubCategory      = subcategory.Text;
                    string openingHour      = openingTime.Time.ToString();
                    string ClosingTime      = closingTime.Time.ToString();

                    string StoreImageAll = "Store" + ":" + StoreImageName + "`" + StoreImageName2 + "`" + StoreImageName3;
                    //  string StoreImageAll = "Store:" + StoreImageName;
                    string StoreLogoAll = "Logo:" + LogoImageName;
                    string StoreProfile = "Profile:" + ProfileImageName;
                    //  string Verificationcode = verificationcode.Text;

                    // Navigation.PushAsync(new SetPassword());
                    PlayerIds deviceId = await OneSignal.Current.IdsAvailableAsync();

                    string deviceid = deviceId.PlayerId;
                    MobileNumber = mobilenumber.Text;

                    //if (SendData.Contains("&"))
                    //{
                    //    SendData = SendData.Replace("&", "_");
                    //}

                    //  string Inputs = "Mobile=" + MobileNumber + "&UserType=" + "Retailer" + "&DeviceID=" + deviceid;
                    string Inputs = "StoreName=" + Storename + "&StoreAddress=" + StoreAddress + "&City=" + StoreCity + "&State=" + StoreState + "&MainArea=" + StoreArea +
                                    "&ZipCode=" + StoreZip + "&Phone=" + StorePhone + "&Mobile=" + MobileNumber + "&Email=" + StoreEmail + "&Website=" + StoreWebsite + "&Latitude=" + lat + "&Longitude=" + lng +
                                    "&StoreImage=" + StoreImageAll.ToString() + "&StoreAddress2=" + storeAddress2 + "&BusinessCategory=" + SendData +
                                    "&StoreLogo=" + StoreLogoAll + "&UserProfilePhoto=" + StoreProfile.ToString() + "&IsGoogleBusinessAccount=" + GoogleAccount + "&IsWebsite=" + Website + "&DeviceId=" + deviceid.ToString()
                                    + "&BusinessSubCategory=" + "SubCategory" + "&StoreOpeningTime=" + openingHour + "&StoreClosingTime=" + ClosingTime.ToString();

                    string resp = await RestService.PostRegistration(Inputs);

                    var result = Newtonsoft.Json.JsonConvert.DeserializeObject <string>(resp);

                    if (result != "0")
                    {
                        UserID = result;
                    }

                    if (UserID != "0" && UserID != "")
                    {
                        await DisplayAlert("Alert", "Submit successfully...!", "Ok");

                        // var _Popupspec = new PopupOTPDialog(pagename, UserID, MobileNumber);
                        if (GoogleAccount == "Yes")
                        {
                            string pageName   = "setpassword";
                            var    _Popupspec = new PopupOTPDialog(UserID, pageName);
                            await Navigation.PushPopupAsync(_Popupspec);
                        }
                        else if (GoogleAccount == "No")
                        {
                            await Navigation.PopToRootAsync();
                        }
                    }
                    else if (UserID == "0" || UserID == "")
                    {
                        await DisplayAlert("Alert", "Mobile number already exist", "Ok");
                    }

                    else
                    {
                        await DisplayAlert("Alert", "Network Issue", "Ok");
                    }


                    IsBusy = false;
                }
                else
                {
                    //   await DisplayAlert("Alert", "Invalid Mobile Number", "Ok");
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                Alogin.IsRunning = false;
                Alogin.IsVisible = false;
                IsBusy           = false;
            }
        }