private async void btnItemOrder_Click(object sender, RoutedEventArgs e) { Regex regex = new Regex("[0-9]"); string inputtedQuantity = txtOrderQuantity.Text; if ((regex.IsMatch(inputtedQuantity)) && txtFirstName.Text != "" && txtSurname.Text != "" && txtEmailAddress.Text != "") { _Location = new clsLocation(); _Location = await ServiceClient.GetLocationAsync(_Item.LocationName); _UpdatedItem = new clsAllItem(); _UpdatedItem = _Location.ItemsList.SingleOrDefault(x => x.ItemID == _Item.ItemID); pushData(_UpdatedItem); } else { txbMessage.Text = "Please enter a number in the quantity field and/or fill in all fields"; } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { try { base.OnNavigatedTo(e); if (e.Parameter != null) { string lcName = e.Parameter.ToString(); _Location = await ServiceClient.GetLocationAsync(lcName); UpdateDisplay(); } else { _Location = new clsLocation(); } } catch (Exception ex) { txbMessage.Text = ex.GetBaseException().Message; } }