feat: disable buttons for user
@ -7,40 +7,40 @@
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:servicewindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\servicewindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:servicewindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\addeditwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:addeditwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\servicewindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:servicewindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\models\\service.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:models\\service.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\utils\\context.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:utils\\context.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\colors.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:colors.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\addeditwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:addeditwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\addeditwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:addeditwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\app.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:app.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\addeditwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:addeditwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|c:\\users\\class_student\\desktop\\xofei\\demoservice\\utils\\context.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{4C331754-91EE-4598-950D-54DF0C075B84}|DemoService.csproj|solutionrelative:utils\\context.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
@ -54,7 +54,7 @@
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 8,
|
||||
"DocumentIndex": 7,
|
||||
"Title": "App.axaml",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\App.axaml",
|
||||
"RelativeDocumentMoniker": "App.axaml",
|
||||
@ -66,7 +66,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 9,
|
||||
"DocumentIndex": 5,
|
||||
"Title": "MainWindow.axaml",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\MainWindow.axaml",
|
||||
"RelativeDocumentMoniker": "MainWindow.axaml",
|
||||
@ -78,7 +78,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"DocumentIndex": 4,
|
||||
"Title": "MainWindow.axaml.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\MainWindow.axaml.cs",
|
||||
"RelativeDocumentMoniker": "MainWindow.axaml.cs",
|
||||
@ -91,7 +91,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"DocumentIndex": 2,
|
||||
"Title": "ServiceWindow.axaml",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\ServiceWindow.axaml",
|
||||
"RelativeDocumentMoniker": "ServiceWindow.axaml",
|
||||
@ -109,14 +109,14 @@
|
||||
"RelativeDocumentMoniker": "ServiceWindow.axaml.cs",
|
||||
"ToolTip": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\ServiceWindow.axaml.cs",
|
||||
"RelativeToolTip": "ServiceWindow.axaml.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAABIAAAAnAAAA",
|
||||
"ViewState": "AQIAAEwAAAAAAAAAAAAmwBgAAAApAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-09-05T10:22:27.057Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"DocumentIndex": 1,
|
||||
"Title": "AddEditWindow.axaml",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\AddEditWindow.axaml",
|
||||
"RelativeDocumentMoniker": "AddEditWindow.axaml",
|
||||
@ -128,7 +128,7 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"DocumentIndex": 8,
|
||||
"Title": "AddEditWindow.axaml.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\AddEditWindow.axaml.cs",
|
||||
"RelativeDocumentMoniker": "AddEditWindow.axaml.cs",
|
||||
@ -141,13 +141,13 @@
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"DocumentIndex": 9,
|
||||
"Title": "Context.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\Utils\\Context.cs",
|
||||
"RelativeDocumentMoniker": "Utils\\Context.cs",
|
||||
"ToolTip": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\Utils\\Context.cs",
|
||||
"RelativeToolTip": "Utils\\Context.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAAAAAA",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAAAvAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-09-05T10:39:51.541Z",
|
||||
"EditorCaption": ""
|
||||
@ -160,14 +160,14 @@
|
||||
"RelativeDocumentMoniker": "Models\\Service.cs",
|
||||
"ToolTip": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\Models\\Service.cs",
|
||||
"RelativeToolTip": "Models\\Service.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAABkAAAAAAAAA",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAACIAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-09-05T11:00:44.489Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"DocumentIndex": 6,
|
||||
"Title": "Colors.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Class_Student\\Desktop\\Xofei\\DemoService\\Colors.cs",
|
||||
"RelativeDocumentMoniker": "Colors.cs",
|
||||
|
@ -19,7 +19,9 @@
|
||||
<Button Name="UserButton"
|
||||
Click="UserLogIn"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 0 0 30">
|
||||
Margin="0 0 0 30"
|
||||
BorderBrush="Chocolate"
|
||||
BorderThickness="1">
|
||||
<TextBlock HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
Войти как пользователь
|
||||
@ -39,7 +41,9 @@
|
||||
<Button Name="AdminButton"
|
||||
Click="AdminLogIn"
|
||||
HorizontalAlignment="Center"
|
||||
Width="200">
|
||||
Width="200"
|
||||
BorderBrush="Chocolate"
|
||||
BorderThickness="1">
|
||||
<TextBlock HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
Войти как администратор
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Avalonia.Media.Imaging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DemoService.Models;
|
||||
@ -19,6 +20,14 @@ public partial class Service
|
||||
|
||||
public string? MainImagePath { get; set; }
|
||||
|
||||
public Bitmap? MainImagePathBitmap
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Bitmap(AppDomain.CurrentDomain.BaseDirectory + "/" + MainImagePath);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ICollection<Clientservice> ClientServices { get; set; } = new List<Clientservice>();
|
||||
|
||||
public virtual ICollection<Servicephoto> ServicePhotos { get; set; } = new List<Servicephoto>();
|
||||
|
@ -5,61 +5,140 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
|
||||
x:Class="DemoService.ServiceWindow"
|
||||
x:CompileBindings="False"
|
||||
Title="Сервис «Подай на 16»">
|
||||
<StackPanel Orientation="Vertical">
|
||||
Title="Сервис «Подай на 16»"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Width="800" Height="600">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Margin="10">
|
||||
<Grid RowDefinitions="Auto"
|
||||
ColumnDefinitions="* Auto Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
Watermark="Поиск"/>
|
||||
ColumnDefinitions="* Auto Auto"
|
||||
Margin="0 0 0 10">
|
||||
<TextBox Name="SearchTextBox"
|
||||
Grid.Column="0"
|
||||
KeyUp="SearchTextBox_KeyUp"
|
||||
Watermark="Поиск"
|
||||
Margin="0 0 10 0"/>
|
||||
<ComboBox Name="SortComboBox"
|
||||
Grid.Column="1"
|
||||
SelectionChanged="SortComboBox_SelectionChanged">
|
||||
SelectionChanged="SortComboBox_SelectionChanged"
|
||||
Margin="0 0 10 0">
|
||||
<ComboBoxItem>Не сортировать</ComboBoxItem>
|
||||
<ComboBoxItem>По возрастанию</ComboBoxItem>
|
||||
<ComboBoxItem>По убыванию</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Grid.Column="2"
|
||||
SelectedIndex="0">
|
||||
<ComboBoxItem>Фильтрация</ComboBoxItem>
|
||||
<ComboBox Name="FilterComboBox"
|
||||
Grid.Column="2"
|
||||
SelectionChanged="FilterComboBox_SelectionChanged">
|
||||
<ComboBoxItem>Все</ComboBoxItem>
|
||||
<ComboBoxItem>От 0% до 5%</ComboBoxItem>
|
||||
<ComboBoxItem>От 5% до 15%</ComboBoxItem>
|
||||
<ComboBoxItem>От 15% до 30%</ComboBoxItem>
|
||||
<ComboBoxItem>От 30% до 70%</ComboBoxItem>
|
||||
<ComboBoxItem>От 70% до 100%</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
<Button Name="AddButton" Click="AddButton_Click">
|
||||
Добавить
|
||||
<Button Name="AddButton"
|
||||
Click="AddButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 0 0 10"
|
||||
Background="#ff9c1a"
|
||||
BorderBrush="Chocolate"
|
||||
BorderThickness="1">
|
||||
Добавить услугу
|
||||
</Button>
|
||||
<ScrollViewer>
|
||||
<ListBox Name="ServicesListBox">
|
||||
<ListBox Name="ServicesListBox"
|
||||
MaxHeight="500"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image/>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Name="ServiceName"
|
||||
Text="{Binding Title}"/>
|
||||
<TextBlock>
|
||||
<Run Name="PreviousCost"/>
|
||||
<Run Name="ActualCost"
|
||||
Text="{Binding Cost}"/>
|
||||
<Run Text="рублей за"/>
|
||||
<Run Name="Time"
|
||||
Text="{Binding DurationInSeconds}"/>
|
||||
<Run Text="минут"/>
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
<Run Text="* скидка"/>
|
||||
<Run Name="Discount"
|
||||
Text="{Binding Discount}"/>
|
||||
</TextBlock>
|
||||
<StackPanel Name="AdminServicePanel"
|
||||
Orientation="Horizontal">
|
||||
<Button Name="EditButton">
|
||||
Изменить
|
||||
<Border BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
Margin="-6 -3 -6 -11">
|
||||
<DockPanel Margin="5">
|
||||
<Image DockPanel.Dock="Left"
|
||||
Source="{Binding MainImagePathBitmap}"
|
||||
Height="100" Width="100"
|
||||
Margin="10 0 15 0"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
DockPanel.Dock="Bottom">
|
||||
<Button Name="EditButton"
|
||||
Background="#ff9c1a"
|
||||
BorderBrush="Chocolate"
|
||||
BorderThickness="1"
|
||||
Margin="0 0 5 0">
|
||||
редактировать
|
||||
</Button>
|
||||
<Button Name="DeleteButton">
|
||||
Удалить
|
||||
<Button Name="DeleteButton"
|
||||
Background="#ff9c1a"
|
||||
BorderBrush="Chocolate"
|
||||
BorderThickness="1">
|
||||
удалить
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Name="ServiceName"
|
||||
Text="{Binding Title}"
|
||||
Margin="0 0 0 5"/>
|
||||
<TextBlock Margin="0 0 0 3">
|
||||
<Run Name="PreviousCost"/>
|
||||
<Run Name="ActualCost"
|
||||
Text="{Binding Cost}"/>
|
||||
<Run Text="рублей за"/>
|
||||
<Run Name="Time"
|
||||
Text="{Binding DurationInSeconds}"/>
|
||||
<Run Text="минут"/>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12">
|
||||
<Run Text="* скидка"/>
|
||||
<Run Name="Discount"
|
||||
Text="{Binding Discount}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
<ScrollViewer>
|
||||
<ListBox Name="UserServicesListBox"
|
||||
MaxHeight="540"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
Margin="-6 -3 -6 -11">
|
||||
<DockPanel Margin="5">
|
||||
<Image DockPanel.Dock="Left"
|
||||
Source="{Binding MainImagePathBitmap}"
|
||||
Height="100" Width="100"
|
||||
Margin="10 0 15 0"/>
|
||||
<StackPanel Orientation="Vertical"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Name="ServiceName"
|
||||
Text="{Binding Title}"
|
||||
Margin="0 0 0 5"/>
|
||||
<TextBlock Margin="0 0 0 3">
|
||||
<Run Name="PreviousCost"/>
|
||||
<Run Name="ActualCost"
|
||||
Text="{Binding Cost}"/>
|
||||
<Run Text="рублей за"/>
|
||||
<Run Name="Time"
|
||||
Text="{Binding DurationInSeconds}"/>
|
||||
<Run Text="минут"/>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12">
|
||||
<Run Text="* скидка"/>
|
||||
<Run Name="Discount"
|
||||
Text="{Binding Discount}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
@ -1,10 +1,12 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using DemoService.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Avalonia.Media.TextFormatting;
|
||||
|
||||
namespace DemoService;
|
||||
|
||||
@ -16,22 +18,32 @@ public partial class ServiceWindow : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
ServicesListBox.ItemsSource = displayList;
|
||||
UserServicesListBox.ItemsSource = displayList;
|
||||
ServicesListBox.Background = Colors.lightYellow;
|
||||
UserServicesListBox.Background = Colors.lightYellow;
|
||||
SortComboBox.SelectedIndex = 0;
|
||||
FilterComboBox.SelectedIndex = 0;
|
||||
}
|
||||
public ServiceWindow(bool admin)
|
||||
{
|
||||
InitializeComponent();
|
||||
AdminMode = admin;
|
||||
if (!admin)
|
||||
switch (AdminMode)
|
||||
{
|
||||
AddButton.IsVisible = false;
|
||||
case true:
|
||||
ServicesListBox.ItemsSource = displayList;
|
||||
UserServicesListBox.IsVisible = false;
|
||||
ServicesListBox.Background = Colors.lightYellow;
|
||||
break;
|
||||
case false:
|
||||
AddButton.IsVisible = false;
|
||||
UserServicesListBox.ItemsSource = displayList;
|
||||
ServicesListBox.IsVisible = false;
|
||||
UserServicesListBox.Background = Colors.lightYellow;
|
||||
break;
|
||||
}
|
||||
ServicesListBox.ItemsSource = displayList;
|
||||
/*foreach (var service in ServicesListBox.ItemsSource)
|
||||
{
|
||||
|
||||
}*/
|
||||
SortComboBox.SelectedIndex = 0;
|
||||
FilterComboBox.SelectedIndex = 0;
|
||||
}
|
||||
public void AddButtonClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
@ -48,25 +60,30 @@ public partial class ServiceWindow : Window
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
|
||||
private void AddButton_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
private void AddButton_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
AddEditWindow addEditWindow = new();
|
||||
addEditWindow.Show();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void SortComboBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
|
||||
private void SortComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
DisplayService();
|
||||
}
|
||||
private void SearchTextBox_KeyUp(object? sender, KeyEventArgs e)
|
||||
{
|
||||
DisplayService();
|
||||
}
|
||||
private void FilterComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
DisplayService();
|
||||
}
|
||||
|
||||
private void DisplayService()
|
||||
{
|
||||
displayList = Utils.Context.Services;
|
||||
switch (SortComboBox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
displayList = Utils.Context.Services;
|
||||
break;
|
||||
case 1:
|
||||
displayList = displayList.OrderBy(service => service.Cost).ToList();
|
||||
@ -75,6 +92,30 @@ public partial class ServiceWindow : Window
|
||||
displayList = displayList.OrderByDescending(service => service.Cost).ToList();
|
||||
break;
|
||||
}
|
||||
switch (FilterComboBox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
displayList = displayList.Where(x => x.Discount >= 0 && x.Discount < (decimal)0.05).ToList();
|
||||
break;
|
||||
case 2:
|
||||
displayList = displayList.Where(x => x.Discount >= (decimal)0.05 && x.Discount < (decimal)0.15).ToList();
|
||||
break;
|
||||
case 3:
|
||||
displayList = displayList.Where(x => x.Discount >= (decimal)0.15 && x.Discount < (decimal)0.30).ToList();
|
||||
break;
|
||||
case 4:
|
||||
displayList = displayList.Where(x => x.Discount >= (decimal)0.30 && x.Discount < (decimal)0.70).ToList();
|
||||
break;
|
||||
case 5:
|
||||
displayList = displayList.Where(x => x.Discount >= (decimal)0.70 && x.Discount < (decimal)1.00).ToList();
|
||||
break;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(SearchTextBox.Text))
|
||||
{
|
||||
displayList = displayList.Where(x => x.Title.ToLower().Contains(SearchTextBox.Text.ToLower())).ToList();
|
||||
}
|
||||
ServicesListBox.ItemsSource = displayList;
|
||||
}
|
||||
}
|
BIN
bin/Debug/net8.0/Услуги автосервиса/diz.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 58 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/transmission.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/АКПП.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Вариатор.jpg
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Выхлопная система.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/ГУР.png
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Двигатель.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Дополнительные услуги.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/КПП.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Кондиционер.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Подвеска.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Сцепление.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Техническое обслуживание.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Топливная система.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Шиномонтаж.jpg
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
bin/Debug/net8.0/Услуги автосервиса/Электрика.png
Normal file
After Width: | Height: | Size: 18 KiB |
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("DemoService")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+609078ea462253630054069be0330dc4b3f38a0e")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+637276e6f1ae2f151c8bcb1b5548e94a3aad69e5")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DemoService")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DemoService")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
9eeb21b35df534b1e2f2b94e81e5de38ee31b8487505819886f13062429cfbfb
|
||||
450845604949cc7c05026513da56f34051141ae7614eaaab1866abf2954968cf
|
||||
|