예제 #1
0
        public async void OnDelete()
        {
            bool ok = await AlertHelper.DisplayAlert("Deshacer", "¿Esta seguro que desea deshacer el consumo?", "Ejecutar", "Cancelar");



            if (ok)
            {
                IsRunning = true;

                try
                {
                    bool result = await DataStore.DeleteMovimientoAsync(Item.CodMov);

                    //model delete
                    await Navigation.PopAsync();
                }
                catch (System.Exception ex)
                {
                    await AlertHelper.ShowError(ex.Message);
                }
                finally
                {
                    IsRunning = false;
                }
            }
        }
예제 #2
0
        public async Task <string> LoginWithEmailPassword(string email, string password)
        {
            try {
                var user = await FirebaseAuth.GetInstance(FirebaseApp.Instance).SignInWithEmailAndPasswordAsync(email, password);

                var token = await user.User.GetIdTokenAsync(false);

                return(token.Token);
            }
            catch (Exception e)
            {
                AlertHelper.DisplayAlert("Erro", e.Message);
                return("");
            }
        }
예제 #3
0
        /// <summary>
        /// Set focus manually.
        /// </summary>
        public void SetFocus()
        {
            if (_options.DisableAutofocus)
            {
                return;
            }

            try
            {
                if (_centerOfScreen.IsEmpty || _centerOfScreen.X <= 0 || _centerOfScreen.Y <= 0)
                {
                    AutoFocus();
                }
                else
                {
                    AutoFocus(Convert.ToInt32(_centerOfScreen.X), Convert.ToInt32(_centerOfScreen.Y));
                }
            }
            catch (Exception e)
            {
                AlertHelper.DisplayAlert("Exception setting AutoFocus", e.Message + "\n\n" + e.StackTrace);
            }
        }