private async void Eliminar_Clicked(object sender, EventArgs e) { var Datos = new litho { Id = id.Text }; await Master.Tabla.DeleteAsync(Datos); }
private async void Enviar_Clicked(object sender, EventArgs e) { if (titulo_tarea.Text != null) { if (Descripcion.Text != null) { var Datos = new litho { Id = id.Text, Titulo = titulo_tarea.Text, Descripcion = Descripcion.Text, //Nombre_Persona = Convert.ToString(PA.SelectedItem), Prioridad = Convert.ToInt16(Prip.SelectedIndex), Fecha_Entrega = Fecha_Entrega.Date, Status = E.SelectedIndex, Deleted = eliminados.IsToggled, Dependencia = Convert.ToString(Dependencia.SelectedItem) }; try { if (del == true) { await Master.Tabla.UndeleteAsync(Datos); } else { await Master.Tabla.UpdateAsync(Datos); } }catch (Exception ex) { await DisplayAlert("", "No se actualizó por: " + ex + "", "OK"); } } else { await DisplayAlert("", "Ingresa una descripcion", "OK"); } } else { await DisplayAlert("", "Ingresa un titulo", "OK"); } }
private async void Guardar_Clicked(object sender, EventArgs e) { if (titulo_tarea.Text != null) { if (Descripcion != null) { if (Prip.SelectedItem != null) { var datos = new litho { Titulo = titulo_tarea.Text, Descripcion = Descripcion.Text, //Nombre_Persona=Convert.ToInt16(PA.SelectedIndex), Fecha_Entrega = Convert.ToDateTime(Fecha_Entrega.Date), Prioridad = Convert.ToInt32(Prip.SelectedIndex), Status = Convert.ToInt32(E.SelectedIndex), Dependencia = Convert.ToString(Dependencia.SelectedItem) }; try { await Master.Tabla.InsertAsync(datos); } catch (Exception ex) { await DisplayAlert("", "No se pudo ingresar por: " + ex + "", "OK"); } } else { await DisplayAlert("", "Selecciona una prioridad", "OK"); } } else { await DisplayAlert("", "Ingresa una descripcion", "OK"); } } else { await DisplayAlert("", "Ingresa un titulo", "OK"); } }