Exemplo n.º 1
0
        private async void BtnCrearAlerta_Clicked(object sender, EventArgs e)
        {
            var userLog = App.Current.Properties["user"].ToString();

            if (userLog != null)
            {
                DateTime dtmFinal = new DateTime(dtmFechaRec.Year,
                                                 dtmFechaRec.Month,
                                                 dtmFechaRec.Day,
                                                 tmpHora.Time.Hours,
                                                 tmpHora.Time.Minutes,
                                                 00);

                HuertaModel objHuertaSelec = new HuertaModel();
                objHuertaSelec = (HuertaModel)cmbHuertas.SelectedItem;
                String strIdHuertaSelec = objHuertaSelec.Id;

                TipoAlertaModel objTipoAlertaSelec = new TipoAlertaModel();
                objTipoAlertaSelec = (TipoAlertaModel)cmbTipoAlerta.SelectedItem;
                String strIdTipoAlertaSelec = objTipoAlertaSelec.Id;

                var ok = AlertaServicio.CrearAlerta(userLog, strIdHuertaSelec, txtDescripcion.Text, dtmFinal, chkAvisa.IsToggled, strIdTipoAlertaSelec);
                if (ok)
                {
                    await DisplayAlert("Registro correcto", "La alerta se ha grabado correctamente", "Ok");

                    await Navigation.PushAsync(new Calendario());
                }
                else
                {
                    await DisplayAlert("Registro incorrecto", "Revise los datos ingresados", "Cancelar");
                }
            }
        }
Exemplo n.º 2
0
        internal static List <HuertaModel> TodasLasHuertas(string userId)
        {
            var objHuerta  = new HuertaModel();
            var objUsuario = new UsuarioModel();

            var idUser = objUsuario.ConsultarPorLog(userId);

            return(objHuerta.ConsultarTodos(idUser));
        }
Exemplo n.º 3
0
        private void BtnVerGrafico_Clicked(object sender, EventArgs e)
        {
            HuertaModel objHuertaSelec = new HuertaModel();

            objHuertaSelec = (HuertaModel)cmbHuertas.SelectedItem;

            String strIdHuertaSelec = objHuertaSelec.Id;

            try
            {
                if (strIdHuertaSelec != null)
                {
                    ((NavigationPage)this.Parent).PushAsync(new VerGrafico(strIdHuertaSelec));
                }
            }
            catch (Exception x)
            {
                throw new Exception(x.Message);
            }
        }
Exemplo n.º 4
0
        internal static bool ModificarHuerta(string text1, string text2, string huertaId)
        {
            var modHuerta = new HuertaModel();

            return(modHuerta.ActualizarHuerta(text1, text2, huertaId));
        }