public ArendetPremisesPage(string login) { InitializeComponent(); _login = login; _rentalPremisesId = ArendetPremisesPageGenerationViewModel.GetFirstId(_login); _tenantRentalPremisesId = _rentalPremisesId; InfoTextBlock.Text = ArendetPremisesPageGenerationViewModel.GetRentalPremises(_rentalPremisesId); (string rentalPremisesImage, string buildingImage)images = ArendetPremisesPageGenerationViewModel.GetImages(_rentalPremisesId); BuildingImage.Source = new BitmapImage(new Uri($"/Resources/{images.buildingImage}.jpg", UriKind.Relative)); RentalPremisesImage.Source = new BitmapImage(new Uri($"/Resources/{images.rentalPremisesImage}.jpg", UriKind.Relative)); if (ArendetPremisesPageGenerationViewModel.CheckRentalStatus(_login, _rentalPremisesId)) { RentaStatusLabel.Text = "Leased by you"; RentaStatusLabel.Foreground = new SolidColorBrush(Colors.Green); } else { RentaStatusLabel.Text = "Awaiting approval"; RentaStatusLabel.Foreground = new SolidColorBrush(Colors.Red); } if (ArendetPremisesPageGenerationViewModel.CheckNextPlaceId(_login, _tenantRentalPremisesId)) { NextButton.Visibility = Visibility.Visible; } else { BackButton.Visibility = Visibility.Hidden; NextButton.Visibility = Visibility.Hidden; } }
private void NextButton_Click(object sender, RoutedEventArgs e) { _rentalPremisesId = ArendetPremisesPageGenerationViewModel.GetNextIdformDataBase(_login, _tenantRentalPremisesId); _tenantRentalPremisesId = _rentalPremisesId; InfoTextBlock.Text = ArendetPremisesPageGenerationViewModel.GetRentalPremises(_rentalPremisesId); (string rentalPremisesImage, string buildingImage)images = ArendetPremisesPageGenerationViewModel.GetImages(_rentalPremisesId); BuildingImage.Source = new BitmapImage(new Uri($"/Resources/{images.buildingImage}.jpg", UriKind.Relative)); RentalPremisesImage.Source = new BitmapImage(new Uri($"/Resources/{images.rentalPremisesImage}.jpg", UriKind.Relative)); if (ArendetPremisesPageGenerationViewModel.CheckRentalStatus(_login, _rentalPremisesId)) { RentaStatusLabel.Text = "Leased by you"; RentaStatusLabel.Foreground = new SolidColorBrush(Colors.Green); } else { RentaStatusLabel.Text = "Awaiting approval"; RentaStatusLabel.Foreground = new SolidColorBrush(Colors.Red); } if (ArendetPremisesPageGenerationViewModel.CheckNextPlaceId(_login, _tenantRentalPremisesId)) { NextButton.Visibility = Visibility.Visible; BackButton.Visibility = Visibility.Visible; } else { NextButton.Visibility = Visibility.Hidden; } }
private void ArendetPremisesButton_Click(object sender, RoutedEventArgs e) { if (ArendetPremisesPageGenerationViewModel.CheckPlaceOnNull(_login)) { TenantMenuFrame.Navigate(new ArendetPremisesPage(_login)); } else { MessageBox.Show("No rental premises"); } }