Exemplo n.º 1
0
        public async void NewSchedule(object hourTapped)
        {
            if (hourTapped != null && !IsBusy)
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    IsBusy = true;

                    BarberHour _hourTapped = hourTapped as BarberHour;

                    DateTime scheduleDate = DateTime.ParseExact((dayTapped.Date + " " + _hourTapped.Hour), "dd-MM-yyyy HH:mm",
                                                                System.Globalization.CultureInfo.InvariantCulture);

                    bool r = await _pageDialogService.DisplayAlertAsync("Agendamento", "Tem certeza que deseja realizar este agendamento?\n" +
                                                                        "\nServiço: " + serviceTapped.ServiceName +
                                                                        "\nData: " + dayTapped.Date + " " + _hourTapped.Hour, "Sim", "Não");

                    if (r)
                    {
                        await scheduleService.AddSchedule(serviceTapped.ServiceName, name, "celular não informado", email, birthdate, scheduleDate);

                        await _pageDialogService.DisplayAlertAsync("Agendado", "Agendamento realizado com sucesso!", "OK");

                        await _navigationService.GoBackAsync(null, false);
                    }

                    IsBusy = false;
                }
                else
                {
                    await _pageDialogService.DisplayAlertAsync("Sem rede", "Não é possível fazer agendamentos sem conexão com a internet", "OK");
                }
            }
        }
        private async Task ExecuteAgendarButtonCommand()
        {
            if (SelectedHour != null)
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    DateTime scheduleDate = DateTime.ParseExact((dayTapped.Date + " " + SelectedHour.Hour), "dd-MM-yyyy HH:mm",
                                                                System.Globalization.CultureInfo.InvariantCulture);

                    bool r = await _pageDialogService.DisplayAlertAsync("Agendamento", "Tem certeza que deseja realizar este agendamento?\n" +
                                                                        "\nServiço: " + serviceTapped.ServiceName +
                                                                        "\nData: " + dayTapped.Date + " " + SelectedHour.Hour, "Sim", "Não");

                    if (r)
                    {
                        await scheduleService.AddSchedule(serviceTapped.ServiceName, NomeEntry, TelefoneEntry, "email não informado", "aniversário não informado", scheduleDate);

                        await _pageDialogService.DisplayAlertAsync("Agendado", "Agendamento realizado com sucesso!", "OK");

                        await _navigationService.GoBackAsync(null, false);
                    }
                }
                else
                {
                    await _pageDialogService.DisplayAlertAsync("Sem rede", "Não é possível fazer agendamentos sem conexão com a internet", "OK");
                }
            }
        }
Exemplo n.º 3
0
        public async Task ExecuteAgendarButtonCommand()
        {
            await azureDataService.AddSchedule(SelectedService.ServiceName, NomeEntry, TelefoneEntry, "email não informado", "aniversário não informado", Schedule.DateTime);

            await _navigationService.GoBackAsync();
        }