| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="practiceApplicaiton.BookingsPage"
- Title="Бронирования">
- <Grid RowDefinitions="Auto,*,Auto" Padding="16" RowSpacing="10">
- <!-- Поиск -->
- <Grid Grid.Row="0" ColumnDefinitions="*,Auto" ColumnSpacing="8">
- <Entry x:Name="SearchEntry" Placeholder="Поиск по фамилии или номеру комнаты"
- TextChanged="OnSearchChanged"/>
- <Button Grid.Column="1" Text="+ Добавить"
- BackgroundColor="#4472C4" TextColor="White"
- CornerRadius="8" Clicked="OnAddClicked"
- IsVisible="{Binding CanEdit}"/>
- </Grid>
- <!-- Список -->
- <CollectionView Grid.Row="1" x:Name="BookingsList"
- SelectionMode="Single"
- SelectionChanged="OnSelectionChanged">
- <CollectionView.ItemTemplate>
- <DataTemplate>
- <Frame Margin="0,4" Padding="12" CornerRadius="8"
- BackgroundColor="White" BorderColor="#E0E0E0">
- <Grid ColumnDefinitions="*,Auto">
- <VerticalStackLayout Spacing="4">
- <Label Text="{Binding ClientFullName}" TextColor="#4472C4"
- FontAttributes="Bold" FontSize="15"/>
- <Label TextColor="#555">
- <Label.FormattedText>
- <FormattedString>
- <Span Text="Комната: "/>
- <Span Text="{Binding RoomNumber}" FontAttributes="Bold"/>
- <Span Text=" ("/>
- <Span Text="{Binding RoomType}"/>
- <Span Text=")"/>
- </FormattedString>
- </Label.FormattedText>
- </Label>
- <Label TextColor="#555">
- <Label.FormattedText>
- <FormattedString>
- <Span Text="{Binding CheckInDate, StringFormat='{0:dd.MM.yyyy}'}"/>
- <Span Text=" — "/>
- <Span Text="{Binding CheckOutDate, StringFormat='{0:dd.MM.yyyy}'}"/>
- <Span Text=" "/>
- <Span Text="{Binding Nights}"/>
- <Span Text=" ночей"/>
- </FormattedString>
- </Label.FormattedText>
- </Label>
- </VerticalStackLayout>
- <Label Grid.Column="1"
- Text="{Binding TotalCost, StringFormat='{0:N0} ₽'}"
- FontAttributes="Bold" FontSize="16"
- TextColor="#2E4057" VerticalOptions="Center"/>
- </Grid>
- </Frame>
- </DataTemplate>
- </CollectionView.ItemTemplate>
- </CollectionView>
- <!-- Кнопки действий -->
- <Grid Grid.Row="2" ColumnDefinitions="*,*" ColumnSpacing="8"
- IsVisible="{Binding CanEdit}">
- <Button Text="Редактировать" BackgroundColor="#4472C4"
- TextColor="White" CornerRadius="8"
- x:Name="EditButton" IsEnabled="False"
- Clicked="OnEditClicked"/>
- <Button Grid.Column="1" Text="Удалить"
- BackgroundColor="#C0392B" TextColor="White"
- CornerRadius="8" x:Name="DeleteButton" IsEnabled="False"
- Clicked="OnDeleteClicked"/>
- </Grid>
- </Grid>
- </ContentPage>
|