Esempio n. 1
0
        private async void RegalarTurno_Clicked(object sender, EventArgs e)
        {
            TraceabilityWorkShift turnoRegalado = (TraceabilityWorkShift)sender;

            HttpResponseMessage response = await Service.Delete("api/TraceabilityWorkShift/" + turnoRegalado.Id);

            if (response.StatusCode != System.Net.HttpStatusCode.NotFound && response.StatusCode != System.Net.HttpStatusCode.InternalServerError)
            {
                await DisplayAlert("Éxito", "Tu turno ha sido regalado", "Ok");
            }
        }
Esempio n. 2
0
        private async Task TomarT(Turnos item)
        {
            TraceabilityWorkShift turnotomado = new TraceabilityWorkShift()
            {
                Id                = 0,
                ActualState       = "0",
                EffectiveQuantity = 1,
                Id_Wor            = item.Id,
                UserID            = empaq.Id
            };

            if (CrossConnectivity.Current.IsConnected)
            {
            }
            else

            {
                return;
            }

            HttpResponseMessage response = await Service.Post("api/TraceabilityWorkShift", turnotomado);

            if (response.StatusCode != System.Net.HttpStatusCode.NotFound && response.StatusCode != System.Net.HttpStatusCode.NoContent && response.StatusCode != System.Net.HttpStatusCode.InternalServerError)
            {
                waitActivityIndicator.IsRunning = false;
                await DisplayAlert("¡Éxito!", "Turno asignado exitosamente", "Aceptar", "Cancelar");

                LV_Turnos.IsEnabled = true;
            }

            else
            {
                LV_Turnos.IsEnabled = true;

                await DisplayAlert("Fallo", "Error al asignar turno", "OK");
            }
            //}
            //catch (Exception ex)
            //{
            //    LV_Turnos.IsEnabled = true;

            //    await DisplayAlert("Fallo", "Error al asignar turno " + ex, "OK");
            //}
        }