Exemplo n.º 1
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");
            //}
        }
Exemplo n.º 2
0
        private void TomarTurno(object sender, ItemTappedEventArgs e)
        {
            waitActivityIndicator.IsRunning = true;
            LV_Turnos.IsEnabled             = false;
            Turnos item = (Turnos)e.Item;

            TomandoT(item);

            foreach (var turn in LV_Turnos.ItemsSource as List <Turnos> )
            {
                if (item.Id == turn.Id)
                {
                    gTurnos.Remove(turn);
                    LV_Turnos.ItemsSource = null;
                    LV_Turnos.ItemsSource = gTurnos;
                    return;
                }
            }
        }
Exemplo n.º 3
0
 private void TomandoT(Turnos item)
 {
     TomarT(item);
 }