Commit 9f1201b6 by gema

campos obligatorios para que no envien campos vacíos.

parent dc40bd25
......@@ -34,6 +34,13 @@ namespace inutralia.Views.NutriQuestion
var messageValue = consultaEditor.Text;
if (subjectValue==null || messageValue==null)
{
await DisplayAlert("Fallo", "El campo asunto y consulta no pueden ir vacíos. Son campos obligatorios.", "Entendido");
}
else
{
await ViewModel.SaveData(subjectValue, messageValue);
await DisplayAlert("Exito", "El mensaje se ha enviado correctamente.", "Entendido");
......@@ -41,6 +48,10 @@ namespace inutralia.Views.NutriQuestion
(App.Current.MainPage as RootPage).Navigate<HomeView>();
}
}
catch (Exception )
{
await DisplayAlert("Error", "Se ha producido un error. Por favor, intentelo más tarde", "Entendido");
......
......@@ -30,13 +30,20 @@ namespace inutralia.Views.NutriQuestion
try
{
var messageValue = messageEntry.Text;
if (messageValue == null)
{
await DisplayAlert("Fallo", "No se puede enviar un mensaje en blanco, campo obligatorio", "Entendido");
}
else
{
await ViewModel.saveData(messageValue);
await DisplayAlert("Exito", "El mensaje se ha enviado correctamente.", "Entendido");
(App.Current.MainPage as RootPage).Navigate<HomeView>();
}
}
catch (Exception)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment