private async void Save() { if (ValidateRecipe()) { try { UserDialogs.Instance.ShowLoading("Saving"); ThisRecipe = new Recipes(); ThisRecipe.Title = RecipeTitle; ThisRecipe.Text = Instructions; ThisRecipe.Tags = Tags; ThisRecipe.Ingredients = Ingredients; ThisRecipe.CreatedDate = DateTime.Now; ThisRecipe.UpdatedDate = DateTime.Now; var recp = DataRepository.Instance.Save <Recipes>(ThisRecipe); if (IngredientsBlob != null && IngredientsBlob.Length > 0) { Pictures pic = new Pictures() { Blob = IngredientsBlob, RecipeeId = recp.PKId, Type = 1 }; DataRepository.Instance.Save <Pictures>(pic); } if (InstructionsBlob != null && InstructionsBlob.Length > 0) { Pictures pic = new Pictures() { Blob = InstructionsBlob, RecipeeId = recp.PKId, Type = 2, }; DataRepository.Instance.Save <Pictures>(pic); } UserDialogs.Instance.HideLoading(); UserDialogs.Instance.Toast("Recipe Added"); App.RecipesViewModel.OnNavigatedTo(); await Navi.PopModal(); } catch (Exception ex) { UserDialogs.Instance.HideLoading(); UserDialogs.Instance.Alert(ex.Message); } } else { await UserDialogs.Instance.AlertAsync(ErrorMessage); } }
public async void Scan() { var scanPage = new ZXingScannerPage(); scanPage.OnScanResult += (result) => { // Stop scanning scanPage.IsScanning = false; // Pop the page and show the result Device.BeginInvokeOnMainThread(() => { Navi.PopModal(); App.UserDialogService.AlertAsync(result.Text, "Scanned Barcode", "OK"); }); }; // Navigate to our scanner page await Navi.PushPage(scanPage); }
async void SignUp() { if (IsInternetConnection()) { App.UserDialogService.ShowLoading("Signing up..."); if (await CreateUser()) { if (Settings.IsFirstRun) { Settings.IsFirstRun = false; await Navi.PopModal(); await Navi.PushModal(PageFac.GetPage(Pages.Guide)); } else { await Navi.PopModal(); } } App.UserDialogService.HideLoading(); } }
public async void AddEvent() { App.UserDialogService.ShowLoading("Adding Event..."); Event evt = new Event(); evt.Name = EventName; evt.StartDate = StartDateTime; evt.Location = Location; evt.Places = int.Parse(Places); evt.ProfileId = App.ThisUser.Profile.ProfileId; evt.IsActive = true; await Evnt.AddEvent(evt); ResetForm(); await Navi.PopModal(); App.UserDialogService.HideLoading(); App.UserDialogService.Toast("Event Added"); }
async void Login() { App.UserDialogService.ShowLoading("Signing in..."); await Task.Delay(3000); User u = new User(); u.Email = UserName; u.Password = Password; bool success = await Acc.LoginAsync(UserName, Password); if (success) { App.UserDialogService.HideLoading(); if (Settings.IsFirstRun) { Settings.IsFirstRun = false; UserName = string.Empty; Password = string.Empty; OnPropertyChanged("UserName"); OnPropertyChanged("Password"); await Navi.PopModal(); await Navi.PushModal(PageFac.GetPage(Pages.Guide)); } else { await Navi.PopModal(); } } else { App.UserDialogService.HideLoading(); await App.UserDialogService.AlertAsync("We could not log you in at this time, please try again"); } }
private async void Back() { await Navi.PopModal(); }
public async void Back() { ResetForm(); await Navi.PopModal(); }
private void Close() { Navi.PopModal(); }