public frmCheckMap(PedidoModel _pedido)
        {
            InitializeComponent();

            if (Settings.isService)
            {
                btnSalvar.IsVisible = true;
            }
            else
            {
                btnSalvar.IsVisible = false;
            }

            ToastProgress.Show();
            compGPS       = new GPS();
            Registro      = _pedido;
            checkRegistro = CheckHelper.ShowCheckInByPedido(_pedido.ID);

            if (checkRegistro == null)
            {
                lblError.IsVisible = true;
            }
            else
            {
                lblError.IsVisible = false;
            }

            InitializeMap();

            AddInicialLocationCommand = new Command(async() => await AddInicialLocation());
        }
        public static async Task AddCheckIn(CheckModal check)
        {
            check.ID           = Guid.NewGuid();
            check.DAT_INCLUSAO = DateTime.Now;

            await firebase
            .Child(TabelasFirebase.CHECK)
            .PostAsync(check);
        }
        private async void btnSalvar_Clicked(object sender, EventArgs e)
        {
            try
            {
                bool result = await DisplayAlert("SALVAR", "Deseja realizar o CHECK-IN?", "SIM", "NÃO");

                if (result)
                {
                    ToastProgress.Show();

                    CheckModal checkin = new CheckModal();
                    Plugin.Geolocator.Abstractions.Position pos = await compGPS.GetCurrentLocation();

                    if (pos == null || pos.Latitude == 0 || pos.Longitude == 0)
                    {
                        UserDialogs.Instance.Toast("Não foi possível encontrar sua localização!", TimeSpan.FromSeconds(3));
                        return;
                    }

                    checkin.COD_PEDIDO = Registro.ID;
                    checkin.LATITUDE   = pos.Latitude;
                    checkin.LONGITUDE  = pos.Longitude;

                    await CheckHelper.AddCheckIn(checkin);

                    UserDialogs.Instance.Toast("Check-in realizado com Sucesso!", TimeSpan.FromSeconds(3));
                    await Navigation.PopPopupAsync();

                    ItemAtualizado?.Invoke(this, true);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            finally
            {
                ToastProgress.Hide();
            }
        }
Esempio n. 4
0
        public static bool Check(LineObject lineObject, bool printFlag, CheckSt st, CheckSt catSt, LexRecord lexObj,
                                 int nextState, bool debugFlag)

        {
            bool   flag     = false;
            string category = lexObj.GetCategory();

            if (category.Equals("verb") == true)

            {
                flag = CheckVerb.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("aux") == true)

            {
                flag = CheckAux.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("modal") == true)

            {
                flag = CheckModal.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("noun") == true)

            {
                flag = CheckNoun.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("pron") == true)

            {
                flag = CheckPron.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("adj") == true)

            {
                flag = CheckAdj.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("adv") == true)

            {
                flag = CheckAdv.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }
            else if (category.Equals("prep") == true)

            {
                flag = CheckNone(lineObject, catSt, nextState);
            }
            else if (category.Equals("conj") == true)

            {
                flag = CheckNone(lineObject, catSt, nextState);
            }
            else if (category.Equals("compl") == true)

            {
                flag = CheckNone(lineObject, catSt, nextState);
            }
            else if (category.Equals("det") == true)

            {
                flag = CheckDet.Check(lineObject, printFlag, catSt, lexObj, debugFlag);
            }

            if (catSt.GetCurState() == nextState)

            {
                st.SetCurState(nextState);
                catSt.SetCurState(40);
            }

            return(flag);
        }