public ListDoctorPageViewModel() { try { db = new DbMyApp(); logOut = new Command(DoLogOut); Itemselected = new Command(ItemSelectedClick); getAllDoctor(); } catch (Exception e) { Console.WriteLine(e); throw; } }
private async void DoLogOut() { try { DbMyApp db = new DbMyApp(); var result = await db.DeleteLogin(); App.Current.MainPage = new LoginPage(); } catch (Exception e) { Console.WriteLine(e); throw; } }
private async void DoLoginoperation() { try { if (login.Email != null) { if (validateEmail.EntryValidateEmail(login.Email)) { if (login.Password != null) { DbMyApp db = new DbMyApp(); var result = db.insertLogin(); if (result.Result > 0) { App.Current.MainPage = App.getNavigation(new ListDoctorPage()); } else { //error al insertar } } else { await App.Current.MainPage.DisplayAlert("Error", "Password vacio", "Ok"); } } else { await App.Current.MainPage.DisplayAlert("Error", "Debes escribir un email válido", "Ok"); } } else { await App.Current.MainPage.DisplayAlert("Error", "Email vacio", "Ok"); } } catch (Exception e) { Console.WriteLine(e); throw; } }