helper0913 1.0.0

dotnet add package helper0913 --version 1.0.0
NuGet\Install-Package helper0913 -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="helper0913" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add helper0913 --version 1.0.0
#r "nuget: helper0913, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install helper0913 as a Cake Addin
#addin nuget:?package=helper0913&version=1.0.0

// Install helper0913 as a Cake Tool
#tool nuget:?package=helper0913&version=1.0.0

using EO.WebBrowser.DOM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using WpfApp8.model; using Window = System.Windows.Window;

namespace WpfApp8 { /// <summary> /// Логика взаимодействия для CatalogWindow.xaml /// </summary> public partial class CatalogWindow : Window { private List<Apartments> apartments; private readonly HotelManagementEntities db;

    public CatalogWindow()
    {
        InitializeComponent();
        db = new HotelManagementEntities();
        LoadApartments();
    }

    private void LoadApartments()
    {
        apartments = db.Apartments.ToList();
        lvApartments.ItemsSource = apartments;
    }

    private void btnSort_Click(object sender, RoutedEventArgs e)
    {
        string sortBy = (cmbSortBy.SelectedItem as ComboBoxItem)?.Content.ToString();

        switch (sortBy)
        {
            case "Room Number":
                apartments = apartments.OrderBy(a => a.RoomNumber).ToList();
                break;
            case "Category":
                apartments = apartments.OrderBy(a => a.Category).ToList();
                break;
            case "Price":
                apartments = apartments.OrderBy(a => a.PricePerNight).ToList();
                break;
            default:
                break;
        }
        
        lvApartments.ItemsSource = apartments;
        
    }
    private void btnSearch_Click(object sender, RoutedEventArgs e)
    {
        string searchText = txtSearch.Text.ToLower();

        if (!string.IsNullOrWhiteSpace(searchText))
        {
            apartments = apartments.Where(a => a.RoomNumber.ToLower().Contains(searchText)).ToList();
        }

        lvApartments.ItemsSource = apartments;
    }

    private void CalculateDiscountedPrice(Apartments apartment)
    {
        
        double discountedPrice = (double)(apartment.PricePerNight * (1 - (apartment.Discount / 100)));
       

    }

    private void txtSearch_TextChanged(object sender, TextChangedEventArgs e)
    {

    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        apartments = db.Apartments.ToList();
        lvApartments.ItemsSource = apartments;
    }
}

} <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions>

    <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10">
        <Image Width="34" Source="resurse/лого.gif">
            <Image.OpacityMask>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Image.OpacityMask>
        </Image>
        <TextBlock Text="Sort by:" FontWeight="Bold" VerticalAlignment="Center"/>
        <ComboBox x:Name="cmbSortBy" SelectedIndex="0" Margin="5">
            <ComboBoxItem Content="Room Number"/>
            <ComboBoxItem Content="Category"/>
            <ComboBoxItem Content="Price"/>
        </ComboBox>
        <Button Content="Sort" Click="btnSort_Click" Margin="5"/>
        <TextBox x:Name="txtSearch" Width="200" Margin="5" TextChanged="txtSearch_TextChanged" />
        <Button Content="Search" Click="btnSearch_Click" Margin="5" />
        <Button Content="Button" Width="45" Margin="0,0,0,5" Click="Button_Click"/>
    </StackPanel>
    <ScrollViewer Grid.Row="1">
        <ListView Grid.Row="1" x:Name="lvApartments" Margin="0,10"  Background="AliceBlue" Height="337">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding ImageUrl}" Width="100" Height="100" Margin="5"/>
                        <StackPanel>
                            <TextBlock Text="{Binding RoomNumber}" FontWeight="Bold"/>
                            <TextBlock Text="{Binding Category}"/>
                            <TextBlock Text="{Binding PricePerNight}"/>
                            <TextBlock Text="{Binding Discount}"/>
                            <TextBlock Text="{Binding Description}"/>

                        </StackPanel>
                        
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </ScrollViewer>

</Grid>

</Window>

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 87 5/24/2024