//1st method // async Task ExecuteLoadCoffeesCommandAsync() public async void ExecuteLoadCoffeesCommandAsync() { azureService = new AzureService(); string enteredEmail = email.Text; string enteredPassword = pass.Text; bool login = false; string Name; try { login = await azureService.GetCoffee(enteredEmail, enteredPassword); Name = await azureService.GetUserName(enteredEmail, enteredPassword); UserName.Add(Name); if (login == true) { UserEmail.Add(enteredEmail); await Navigation.PushAsync(new MenuPage(Name)); pass.Text = ""; } if (login == false) { await DisplayAlert("Alert", "Email and/or Password is incorrect", "ok"); } } catch (Exception ex) { Debug.WriteLine("OH NO! " + ex); } }
protected void SaveEmailMobiles() { CaseUserProfile u = new CaseUserProfile(ContactCaseID); UserEmail ueop = new UserEmail(); foreach (UserEmail ue in u.Emails) { if (Request.Form["tbEmail_" + ue.ID.ToString()] != null) { string Email = Request.Form["tbEmail_" + ue.ID.ToString()].ToString(); if (ue.Email != Email) { ueop.Update(ue.ID, Email); } } else { ueop.Delete(ue.ID); } } UserMobile umop = new UserMobile(); foreach (UserMobile um in u.Mobiles) { if (Request.Form["tbMobileNo_" + um.ID.ToString()] != null) { string MobileNo = Request.Form["tbMobileNo_" + um.ID.ToString()].ToString(); if (um.Mobile != MobileNo) { umop.Update(um.ID, MobileNo); } } else { umop.Delete(um.ID); } } //新增 string tbMobileNo = Request.Form["tbMobileNo"] ?? ""; string tbEmail = Request.Form["tbEmail"] ?? ""; tbMobileNo = tbMobileNo.TrimEnd(','); tbEmail = tbEmail.TrimEnd(','); //Response.Write(ContactCaseID.ToString() + tbMobileNo); //Response.End(); if (tbEmail != "") { ueop.Add(ContactCaseID, tbEmail); } if (tbMobileNo != "") { umop.Add(ContactCaseID, tbMobileNo); } u.UpdateMainMobileCol(ContactCaseID); }