public async void SignInUsingParse(string username, string password) { var coll = await this.users.Get(); if (coll.Contains(new User { Username = username, Password = password })) { await ParseUser.LogInAsync(username, password); var successMessage = new MessageDialog("You successfully signed in!"); await successMessage.ShowAsync(); } else { await this.users.Insert(new User { Username = username, Password = password }); var user = ParseUser.Create <UserParse>(); user = new UserParse { Username = username, Password = password }; await user.SignUpAsync(); } }
public async void AddExpenseParse(string name, string imageUrl, string description, double price, Category category) { var newExpense = ParseObject.Create <ExpenseParse>(); newExpense = new ExpenseParse { Name = name, ImageUrl = imageUrl, Description = description, Price = price }; var selected = await ParseObject.GetQuery("CategoryParse") .WhereContains("Name", category.ToString()).FirstOrDefaultAsync() as CategoryParse; if (selected == null) { selected = ParseObject.Create <CategoryParse>(); selected.Expenses = new List <ExpenseParse>(); } UserParse user = (UserParse)ParseUser.CurrentUser; if (user.Expenses == null) { user.Expenses = new List <ExpenseParse>(); } ParseUser.CurrentUser.AddToList("Expenses", newExpense); selected.AddToList("Expenses", newExpense); await ParseUser.CurrentUser.SaveAsync(); await selected.SaveAsync(); }
public async void SignUpParse(string username, string password) { var user = ParseUser.Create<UserParse>(); user = new UserParse { Username = username, Password = password }; if (user.IsDirty) { await user.SignUpAsync(); await user.SaveAsync(); } else { await ParseUser.LogInAsync(username, password); //var successMessage = new MessageDialog("You already have a profile. Please, use the sign in form!"); //await successMessage.ShowAsync(); } }
public async void SignInUsingParse(string username, string password) { var coll = await this.users.Get(); if (coll.Contains(new User {Username = username, Password = password})) { await ParseUser.LogInAsync(username, password); var successMessage = new MessageDialog("You successfully signed in!"); await successMessage.ShowAsync(); } else { await this.users.Insert(new User {Username = username, Password = password}); var user = ParseUser.Create<UserParse>(); user = new UserParse { Username = username, Password = password }; await user.SignUpAsync(); } }
public async void SignUpParse(string username, string password) { var user = ParseUser.Create <UserParse>(); user = new UserParse { Username = username, Password = password }; if (user.IsDirty) { await user.SignUpAsync(); await user.SaveAsync(); } else { await ParseUser.LogInAsync(username, password); //var successMessage = new MessageDialog("You already have a profile. Please, use the sign in form!"); //await successMessage.ShowAsync(); } }