Exemplo n.º 1
0
        private async void CargarObraSupervisorItems()
        {
            try
            {
                object[,] variables = new object[, ] {
                    { "idUsuario", IdUsuario }
                };
                dynamic obras = await Servicio.MetodoGet("ServicioUsuario.asmx", "MostrarObrasSupervision", variables);

                foreach (var item in obras)
                {
                    if (item.idPlantilla == null)
                    {
                        Color = "#FF7777";
                    }
                    else
                    {
                        Color = "#77FF77";
                    }
                    ObraResponsableItems.Add(new ObraResponsableItem
                    {
                        // idPlantillaObra = item.idPlantilla == null ? 0 : item.idPlantilla,
                        idObra = item.idObra,
                        codigo = item.codigo,
                        nombre = item.nombre,
                        //idPropietarioObra = item.idPropietario_obra,
                        colorObra = Color
                    });
                }
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "Aceptar");
            }
        }
Exemplo n.º 2
0
        private async void CargarObraResponsableItems()
        {
            try
            {
                ObraResponsableItems.Clear();
                // Desde Aqui Logica de Programacion

                WebService servicio = new WebService();
                object[,] variables = new object[, ] {
                    { "idResponsable", IdUsuario }
                };
                dynamic result = await servicio.MetodoPost("ServicioObra.asmx", "MostrarObrasResponsable", variables);

                if (result != null)
                {
                    if (result.Count == 0) //si está vacío
                    {
                        await mensaje.MostrarMensaje("Mostrar Obra Responsable", "No Hay Obras a su cargo");
                    }
                    else
                    {
                        // listando las obras
                        foreach (var item in result)
                        {
                            ObraResponsableItems.Add(new ObraResponsableItem
                            {
                                nombre        = item.nombre,
                                idResponsable = item.idObra,
                            });
                        }
                        // fin del listado
                    }
                }
                else
                {
                    await mensaje.MostrarMensaje("Mostrar Obra Responsable", "A ocurrido un error al listar las obras para este usuario");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 3
0
 private async void CargarObraSupervisorItems()
 {
     try
     {
         ObraResponsableItems.Clear();
         for (int i = 0; i < 15; i++)
         {
             ObraResponsableItems.Add(new ObraResponsableItem
             {
                 nombre        = "Toda las Obras",
                 idResponsable = i,
             });
         }
     }
     catch (Exception ex)
     {
         await mensaje.MostrarMensaje("", ex.Message);
     }
 }
Exemplo n.º 4
0
 private async void CargarObraAdminItems()
 {
     try
     {
         ObraResponsableItems.Clear();
         // Desde Aqui Logica de Programacion
         for (int i = 0; i < 15; i++)
         {
             ObraResponsableItems.Add(new ObraResponsableItem
             {
                 nombre        = "Toda las Obras",
                 idResponsable = i,
             });
         }
     }
     catch (Exception ex)
     {
         await mensaje.MostrarMensaje("", ex.Message);
     }
 }
Exemplo n.º 5
0
        public async void CargarObraAdminItems()
        {
            try
            {
                // ObraResponsableItems.Clear();
                //servicioObra, mostrarObras--modificado

                dynamic obras = await Servicio.MetodoGet("ServicioPlantillaPropietarioObra.asmx", "MostrarPlantillasyObras");

                foreach (var item in obras)
                {
                    if (item.idPlantilla == null)
                    {
                        Color = "#FF7777";
                    }
                    else
                    {
                        Color = "#77FF77";
                    }
                    //IdObra = Convert.ToInt16( item.idObra);
                    ObraResponsableItems.Add(new ObraResponsableItem
                    {
                        idPlantillaObra   = item.idPlantilla == null ? 0 : item.idPlantilla,
                        idObra            = item.idObra,
                        codigo            = item.codigo,
                        nombre            = item.nombre,
                        idPropietarioObra = item.idPropietario_obra,
                        colorObra         = Color
                    });
                }
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "Aceptar");
            }
        }