public void ValidateGuestsData() { var myList = ReserveHotelDto.LoadValuesFromJsonFile(); foreach (var firstName in myList) { FirstNameField.Click(); FirstNameField.SendKeys(firstName.ToString()); } //FirstNameField.Click(); //var firstNameValue = reserve.GetType().GetRuntimeProperty("FirstName").GetValue(reserve); //if (firstNameValue != null) //{ // FirstNameField.SendKeys(firstNameValue.ToString()); //} //LastNameField.Click(); //var lastNameValue = reserve.GetType().GetRuntimeProperty("LastName").GetValue(reserve); //if (lastNameValue != null) //{ // FirstNameField.SendKeys(lastNameValue.ToString()); //} //EmailField.Click(); //var emailValue = reserve.GetType().GetRuntimeProperty("Email").GetValue(reserve); //if (emailValue != null) //{ // FirstNameField.SendKeys(emailValue.ToString()); //} //ConfirmEmailField.Click(); //var confirmEmailValue = reserve.GetType().GetRuntimeProperty("ConfirmEmail").GetValue(reserve); //if (confirmEmailValue != null) //{ // FirstNameField.SendKeys(confirmEmailValue.ToString()); //} //Helper.ScrollToSeeTheRightButton(_driver, ContactNumberField); //ContactNumberField.Click(); //var contactNumberValue = reserve.GetType().GetRuntimeProperty("ContactNumber").GetValue(reserve); //if (contactNumberValue != null) //{ // FirstNameField.SendKeys(contactNumberValue.ToString()); //} //AddressField.Click(); //var AddressValue = reserve.GetType().GetRuntimeProperty("Address").GetValue(reserve); //if (AddressValue != null) //{ // FirstNameField.SendKeys(AddressValue.ToString()); //} SelectCountryDropdown.Click(); Chooseountry.Click(); Helper.ScrollToSeeTheRightButton(_driver, ConfirmBookingButton); ConfirmBookingButton.Click(); PayButton.Click(); }
// update GUI private void UpdateInserted(bool wasPayed = false) { InsertedAmount.Content = ((float)insertedMoney.Sum() / 100).ToString("C2"); if (transaction.GetCostInCent() <= insertedMoney.Sum() && !wasPayed) { PayButton.IsEnabled = true; PayButton.ClearValue(BackgroundProperty); } else { PayButton.IsEnabled = false; PayButton.Background = Brushes.LightGray; } }
// on click of coin button private void OnMoneyButton_Click(object sender, RoutedEventArgs eventArgs, int valueInCent) { insertedMoney.Add(valueInCent); Button button = new Button() { Content = ((float)valueInCent / 100).ToString("C2"), Background = Brushes.LightGreen, Foreground = Brushes.Black, Margin = new Thickness(3) }; button.Click += (s, e) => { InsertedPanel.Children.Remove((Button)s); insertedMoney.Remove(valueInCent); UpdateInserted(); }; InsertedPanel.Children.Add(button); if (transaction.GetCostInCent() <= insertedMoney.Sum()) { PayButton.IsEnabled = true; PayButton.ClearValue(BackgroundProperty); } UpdateInserted(); }
void ReleaseDesignerOutlets() { if (WebView != null) { WebView.Dispose(); WebView = null; } if (CardHolderTextField != null) { CardHolderTextField.Dispose(); CardHolderTextField = null; } if (CardNumberTextField != null) { CardNumberTextField.Dispose(); CardNumberTextField = null; } if (CvvTextField != null) { CvvTextField.Dispose(); CvvTextField = null; } if (ExpirationDateTextField != null) { ExpirationDateTextField.Dispose(); ExpirationDateTextField = null; } if (PayButton != null) { PayButton.Dispose(); PayButton = null; } }