private void Save_Clicked(object sender, EventArgs e)
        {
            string message = CheckInfor();

            if (message != "")
            {
                DisplayAlert("Error", message, "OK");
                return;
            }
            AddressItem newAddress = new AddressItem
            {
                Country     = CountryText.Text,
                City        = CityText.Text,
                HouseNumber = HouseNumberText.Text,
                District    = DistrictText.Text
            };

            //(App.Current.MainPage.Navigation.NavigationStack.ElementAt(0).BindingContext as StoreSetttingViewModel).ChangeAddress(newAddress);
            if (parentName == "StoreSetting")
            {
                (TabbarStoreManager.GetInstance().Children.ElementAt(4).BindingContext as StoreSetttingViewModel).ChangeAddress(newAddress);
            }
            else
            {
                (UserSettingView.GetInstance().BindingContext as UserSettingViewModel).ChangeAddress(newAddress);
            }
            App.Current.MainPage.Navigation.PopAsync();
        }
Exemplo n.º 2
0
        protected async override void OnAppearing()
        {
            AppDrawer.Destroy();
            TabBarCustomer.Destroy();
            TabbarStoreManager.Destroy();
            UserSettingView.Destroy();
            User user = dataProvider.GetUserByIDUser(Infor.IDUser);

            user.IsLogined = 0;


            Preferences.Set("IDLogin", "");
            //OneSignal.Current.SendTag("IsLogined", "0");

            //TEST INTERNET CONNECTTION
            var httpClient = new HttpClient();

            try
            {
                var testInternet = await httpClient.GetStringAsync(ServerDatabase.localhost + "store/getstorebyid/test");

                OneSignal.Current.SetExternalUserId("");
                await httpClient.PostAsJsonAsync(ServerDatabase.localhost + "user/update", user);
            }
            catch (Exception ex)
            {
            }

            App.Current.MainPage = new NavigationPage(LoginView.GetInstance());
        }
Exemplo n.º 3
0
 public static UserSettingView GetInstance()
 {
     if (_instance == null)
     {
         _instance = new UserSettingView();
     }
     return(_instance);
 }
Exemplo n.º 4
0
 public static void Destroy()
 {
     _instance = null;
 }