Кусочек без пагинации, доделанный
parent
924827d2dc
commit
66a011e33c
|
|
@ -4,8 +4,20 @@
|
||||||
<option name="projectPerEditor">
|
<option name="projectPerEditor">
|
||||||
<map>
|
<map>
|
||||||
<entry key="App.axaml" value="BathHouseManagmet.csproj" />
|
<entry key="App.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="ViewModels/EmployeeViewModel.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/EmployeeView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
<entry key="Views/MainWindow.axaml" value="BathHouseManagmet.csproj" />
|
<entry key="Views/MainWindow.axaml" value="BathHouseManagmet.csproj" />
|
||||||
<entry key="Views/OrderView.axaml" value="BathHouseManagmet.csproj" />
|
<entry key="Views/OrderView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/ServiceView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/ClientView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/DiscountView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/EmployeeView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/OrderView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/PositionView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/ServiceView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/UserControls/ZoneView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/Windows/MainWindow.axaml" value="BathHouseManagmet.csproj" />
|
||||||
|
<entry key="Views/ZoneView.axaml" value="BathHouseManagmet.csproj" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -32,4 +32,27 @@
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Views\Windows\MainWindow.axaml.cs">
|
||||||
|
<DependentUpon>MainWindow.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\UserControls\EmployeeView.axaml.cs">
|
||||||
|
<DependentUpon>EmployeeView.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\UserControls\OrderView.axaml.cs">
|
||||||
|
<DependentUpon>OrderView.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\UserControls\ServiceView.axaml.cs">
|
||||||
|
<DependentUpon>ServiceView.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Views\UserControls\ZoneView.axaml.cs">
|
||||||
|
<DependentUpon>ZoneView.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace BathHouseManagmet.Models;
|
namespace BathHouseManagmet.Models;
|
||||||
|
|
||||||
public class Discount
|
public class Discount
|
||||||
|
|
@ -6,4 +8,6 @@ public class Discount
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public int DiscountPercent { get; set; }
|
public int DiscountPercent { get; set; }
|
||||||
|
public DateTime StartDate { get; set; }
|
||||||
|
public DateTime EndDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
@ -22,6 +22,8 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var command = new MySqlCommand(sql, connection);
|
using var command = new MySqlCommand(sql, connection);
|
||||||
|
command.Parameters.AddWithValue("@limit", pageNumber);
|
||||||
|
command.Parameters.AddWithValue("@offset", pageNumber * pageSize);
|
||||||
using var reader = command.ExecuteReader();
|
using var reader = command.ExecuteReader();
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
|
|
@ -30,7 +32,9 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
Id = reader.GetInt32("id"),
|
Id = reader.GetInt32("id"),
|
||||||
Name = reader.GetString("name"),
|
Name = reader.GetString("name"),
|
||||||
Description = reader.GetString("description"),
|
Description = reader.GetString("description"),
|
||||||
DiscountPercent = reader.GetInt32("discount_percent")
|
DiscountPercent = reader.GetInt32("discount_percent"),
|
||||||
|
StartDate = reader.GetDateTime("start_date"),
|
||||||
|
EndDate = reader.GetDateTime("end_date")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -44,7 +48,7 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
public override bool Add(Discount discount)
|
public override bool Add(Discount discount)
|
||||||
{
|
{
|
||||||
string sql =
|
string sql =
|
||||||
"insert into `discount` (`id`, `name`, `description`, `discount_percent`) values (0, @name, @description, @discount_percent)";
|
"insert into `discount` (`id`, `name`, `description`, `discount_percent`, `start_date`, `end_date`) values (0, @name, @description, @discount_percent, @start_date, @end_date)";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var command = new MySqlCommand(sql, connection))
|
using (var command = new MySqlCommand(sql, connection))
|
||||||
|
|
@ -53,6 +57,8 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
command.Parameters.AddWithValue("@name", discount.Name);
|
command.Parameters.AddWithValue("@name", discount.Name);
|
||||||
command.Parameters.AddWithValue("@description", discount.Description);
|
command.Parameters.AddWithValue("@description", discount.Description);
|
||||||
command.Parameters.AddWithValue("@discount_percent", discount.DiscountPercent);
|
command.Parameters.AddWithValue("@discount_percent", discount.DiscountPercent);
|
||||||
|
command.Parameters.AddWithValue("@start_date", discount.StartDate);
|
||||||
|
command.Parameters.AddWithValue("@end_date", discount.EndDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
@ -66,7 +72,7 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
public override bool Update(Discount discount)
|
public override bool Update(Discount discount)
|
||||||
{
|
{
|
||||||
string sql =
|
string sql =
|
||||||
"update `discount` set name = @name, description = @description, discount_percent = @discount_percent";
|
"update `discount` set name = @name, description = @description, discount_percent = @discount_percent, start_date = @start_date, end_date = @end_date";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var command = new MySqlCommand(sql, connection))
|
using (var command = new MySqlCommand(sql, connection))
|
||||||
|
|
@ -75,6 +81,8 @@ public class DiscountRepository : BaseRepository<Discount>, IDisposable
|
||||||
command.Parameters.AddWithValue("@name", discount.Name);
|
command.Parameters.AddWithValue("@name", discount.Name);
|
||||||
command.Parameters.AddWithValue("@description", discount.Description);
|
command.Parameters.AddWithValue("@description", discount.Description);
|
||||||
command.Parameters.AddWithValue("@discount_percent", discount.DiscountPercent);
|
command.Parameters.AddWithValue("@discount_percent", discount.DiscountPercent);
|
||||||
|
command.Parameters.AddWithValue("@start_date", discount.StartDate);
|
||||||
|
command.Parameters.AddWithValue("@end_date", discount.EndDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ public class EmployeeRepository : BaseRepository<Employee>, IDisposable
|
||||||
string sql = "select e.id as eid, e.position_id as pid, e.name as ename, e.surname as esurname, p.name as pname from employee e join position p on e.position_id = p.id limit @limit offset @offset";
|
string sql = "select e.id as eid, e.position_id as pid, e.name as ename, e.surname as esurname, p.name as pname from employee e join position p on e.position_id = p.id limit @limit offset @offset";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var command = new MySqlCommand(sql, connection))
|
using var command = new MySqlCommand(sql, connection);
|
||||||
using (var reader = command.ExecuteReader())
|
command.Parameters.AddWithValue("@limit", pageNumber);
|
||||||
{
|
command.Parameters.AddWithValue("@offset", pageNumber * pageSize);
|
||||||
|
using var reader = command.ExecuteReader();
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
result.Add(new Employee
|
result.Add(new Employee
|
||||||
|
|
@ -38,7 +39,6 @@ public class EmployeeRepository : BaseRepository<Employee>, IDisposable
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(e);
|
Console.WriteLine(e);
|
||||||
|
|
|
||||||
12
Program.cs
12
Program.cs
|
|
@ -24,6 +24,18 @@ sealed class Program
|
||||||
s.AddTransient<MainWindowViewModel>();
|
s.AddTransient<MainWindowViewModel>();
|
||||||
s.AddTransient<OrderViewModel>();
|
s.AddTransient<OrderViewModel>();
|
||||||
s.AddTransient<OrderView>();
|
s.AddTransient<OrderView>();
|
||||||
|
s.AddTransient<EmployeeViewModel>();
|
||||||
|
s.AddTransient<EmployeeView>();
|
||||||
|
s.AddTransient<ServiceViewModel>();
|
||||||
|
s.AddTransient<ServiceView>();
|
||||||
|
s.AddTransient<ZoneViewModel>();
|
||||||
|
s.AddTransient<ZoneView>();
|
||||||
|
s.AddTransient<DiscountViewModel>();
|
||||||
|
s.AddTransient<DiscountView>();
|
||||||
|
s.AddTransient<PositionViewModel>();
|
||||||
|
s.AddTransient<PositionView>();
|
||||||
|
s.AddTransient<ClientViewModel>();
|
||||||
|
s.AddTransient<ClientView>();
|
||||||
|
|
||||||
s.AddTransient<DiscountRepository>();
|
s.AddTransient<DiscountRepository>();
|
||||||
s.AddTransient<ClientRepository>();
|
s.AddTransient<ClientRepository>();
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using BathHouseManagmet.Database;
|
|
||||||
using BathHouseManagmet.Models;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
|
|
||||||
namespace BathHouseManagmet.ViewModels;
|
|
||||||
|
|
||||||
public partial class MainWindowViewModel : ViewModelBase
|
|
||||||
{
|
|
||||||
private readonly IServiceProvider _serviceProvider;
|
|
||||||
private readonly EmployeeRepository _employeeRepository;
|
|
||||||
private readonly OrderRepository _orderRepository;
|
|
||||||
|
|
||||||
[ObservableProperty] OrderViewModel _orderViewModel;
|
|
||||||
|
|
||||||
[ObservableProperty] List<Order> orders;
|
|
||||||
[ObservableProperty] List<Employee> employees;
|
|
||||||
|
|
||||||
public MainWindowViewModel(IServiceProvider serviceProvider, EmployeeRepository employeeRepository, OrderRepository orderRepository)
|
|
||||||
{
|
|
||||||
_serviceProvider = serviceProvider;
|
|
||||||
_employeeRepository = employeeRepository;
|
|
||||||
_orderRepository = orderRepository;
|
|
||||||
|
|
||||||
OrderViewModel = _serviceProvider.GetRequiredService<OrderViewModel>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class ClientViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly ClientRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] List<Client> _clients;
|
||||||
|
|
||||||
|
public ClientViewModel(IServiceProvider serviceProvider, ClientRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Clients = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class DiscountViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly DiscountRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] List<Discount> discounts;
|
||||||
|
|
||||||
|
public DiscountViewModel(IServiceProvider serviceProvider, DiscountRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Discounts = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class EmployeeViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly EmployeeRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] List<Employee> employees;
|
||||||
|
|
||||||
|
public EmployeeViewModel(IServiceProvider serviceProvider, EmployeeRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Employees = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -26,10 +26,12 @@ public partial class OrderViewModel : ViewModelBase
|
||||||
_serviceProvider = serviceProvider;
|
_serviceProvider = serviceProvider;
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
|
|
||||||
PageSizes = new List<int>([5,10,20]);
|
Orders = _repository.GetPage(1, 1);
|
||||||
CurrentPageSize = PageSizes.First();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
PageSizes = new List<int>([5,10,20]);
|
||||||
|
//CurrentPageSize = PageSizes.First();
|
||||||
|
}
|
||||||
|
/*
|
||||||
partial void OnCurrentPageSizeChanged(int value)
|
partial void OnCurrentPageSizeChanged(int value)
|
||||||
{
|
{
|
||||||
CalculatePages();
|
CalculatePages();
|
||||||
|
|
@ -78,4 +80,5 @@ public partial class OrderViewModel : ViewModelBase
|
||||||
if (currentPage > 0)
|
if (currentPage > 0)
|
||||||
ShowPage(currentPage - 1);
|
ShowPage(currentPage - 1);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class PositionViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly PositionRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] List<Position> positions;
|
||||||
|
|
||||||
|
public PositionViewModel(IServiceProvider serviceProvider, PositionRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Positions = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class ServiceViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly ServiceRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] List<Service> services;
|
||||||
|
|
||||||
|
public ServiceViewModel(IServiceProvider serviceProvider, ServiceRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Services = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class ZoneViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly ZoneRepository _repository;
|
||||||
|
|
||||||
|
[ObservableProperty] private List<Zone> zones;
|
||||||
|
|
||||||
|
public ZoneViewModel(IServiceProvider serviceProvider, ZoneRepository repository)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_repository = repository;
|
||||||
|
|
||||||
|
Zones = _repository.GetPage(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using BathHouseManagmet.Database;
|
||||||
|
using BathHouseManagmet.Models;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.ViewModels;
|
||||||
|
|
||||||
|
public partial class MainWindowViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
|
[ObservableProperty] OrderViewModel _orderViewModel;
|
||||||
|
[ObservableProperty] EmployeeViewModel _employeeViewModel;
|
||||||
|
[ObservableProperty] ServiceViewModel _serviceViewModel;
|
||||||
|
[ObservableProperty] ZoneViewModel _zoneViewModel;
|
||||||
|
[ObservableProperty] DiscountViewModel _discountViewModel;
|
||||||
|
[ObservableProperty] PositionViewModel _positionViewModel;
|
||||||
|
|
||||||
|
public MainWindowViewModel(IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
|
||||||
|
OrderViewModel = _serviceProvider.GetRequiredService<OrderViewModel>();
|
||||||
|
EmployeeViewModel = _serviceProvider.GetRequiredService<EmployeeViewModel>();
|
||||||
|
ServiceViewModel = _serviceProvider.GetRequiredService<ServiceViewModel>();
|
||||||
|
ZoneViewModel = _serviceProvider.GetRequiredService<ZoneViewModel>();
|
||||||
|
DiscountViewModel = _serviceProvider.GetRequiredService<DiscountViewModel>();
|
||||||
|
PositionViewModel = _serviceProvider.GetRequiredService<PositionViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.ClientView"
|
||||||
|
x:DataType="viewModels:ClientViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Clients}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Имя" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Фамилия" Binding="{Binding Surname}"/>
|
||||||
|
<DataGridTextColumn Header="Имя" Binding="{Binding Name}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class ClientView : UserControl
|
||||||
|
{
|
||||||
|
public ClientView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.DiscountView"
|
||||||
|
x:DataType="viewModels:DiscountViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Discounts}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Название" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Описание" Binding="{Binding Description}"/>
|
||||||
|
<DataGridTextColumn Header="Процент скидки" Binding="{Binding DiscountPercent}"/>
|
||||||
|
<DataGridTextColumn Header="Дата начала" Binding="{Binding StartDate}"/>
|
||||||
|
<DataGridTextColumn Header="Дата конца" Binding="{Binding EndDate}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class DiscountView : UserControl
|
||||||
|
{
|
||||||
|
public DiscountView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.EmployeeView"
|
||||||
|
x:DataType="viewModels:EmployeeViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Employees}" AutoGenerateColumns="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Имя сотрудника" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Фамилия сотрудника" Binding="{Binding Surname}"/>
|
||||||
|
<DataGridTextColumn Header="Должность сотрудника" Binding="{Binding Position.Name}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class EmployeeView : UserControl
|
||||||
|
{
|
||||||
|
public EmployeeView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.PositionView"
|
||||||
|
x:DataType="viewModels:PositionViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Positions}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Название" Binding="{Binding Name}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class PositionView : UserControl
|
||||||
|
{
|
||||||
|
public PositionView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.ServiceView"
|
||||||
|
x:DataType="viewModels:ServiceViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Services}" AutoGenerateColumns="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Название" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Описание" Binding="{Binding Description}"/>
|
||||||
|
<DataGridTextColumn Header="Цена" Binding="{Binding Price}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class ServiceView : UserControl
|
||||||
|
{
|
||||||
|
public ServiceView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:viewModels="clr-namespace:BathHouseManagmet.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="BathHouseManagmet.Views.ZoneView"
|
||||||
|
x:DataType="viewModels:ZoneViewModel">
|
||||||
|
<DataGrid ItemsSource="{Binding Zones}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Название" Binding="{Binding Name}"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</UserControl>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace BathHouseManagmet.Views;
|
||||||
|
|
||||||
|
public partial class ZoneView : UserControl
|
||||||
|
{
|
||||||
|
public ZoneView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,13 +16,19 @@
|
||||||
<ContentControl Content="{Binding OrderViewModel}"/>
|
<ContentControl Content="{Binding OrderViewModel}"/>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Сотрудники">
|
<TabItem Header="Сотрудники">
|
||||||
<DataGrid ItemsSource="{Binding Employees}" AutoGenerateColumns="False">
|
<ContentControl Content="{Binding EmployeeViewModel}"/>
|
||||||
<DataGrid.Columns>
|
</TabItem>
|
||||||
<DataGridTextColumn Header="Имя сотрудника" Binding="{Binding Name}"/>
|
<TabItem Header="Услуги">
|
||||||
<DataGridTextColumn Header="Фамилия сотрудника" Binding="{Binding Surname}"/>
|
<ContentControl Content="{Binding ServiceViewModel}"/>
|
||||||
<DataGridTextColumn Header="Должность сотрудника" Binding="{Binding Position.Name}"/>
|
</TabItem>
|
||||||
</DataGrid.Columns>
|
<TabItem Header="Зоны">
|
||||||
</DataGrid>
|
<ContentControl Content="{Binding ZoneViewModel}"/>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Скидки">
|
||||||
|
<ContentControl Content="{Binding DiscountViewModel}"/>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Должность">
|
||||||
|
<ContentControl Content="{Binding PositionViewModel}"/>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
@ -1 +1 @@
|
||||||
1192b891a192d7b26b551ab7706358bedb3321507bd7d8cf1bfa07c8d52271f9
|
942a839708d7cce8ab05c02fe65f26bee847b4d21d2979d45818fcd6d9a822c4
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("BathHouseManagmet")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("BathHouseManagmet")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+41512c28ef3f00e1a5bf2e8fff2eb768a98ef1bf")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+924827d2dc42773fa3d9118f0596f882373d2c67")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("BathHouseManagmet")]
|
[assembly: System.Reflection.AssemblyProductAttribute("BathHouseManagmet")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("BathHouseManagmet")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("BathHouseManagmet")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
eabbb29cd12761d77743c612010becd5857837b230f933faa13156f790e78108
|
203883aab9b08b3fd8124d36758bb7103eeaea559e7819678d19054bef848fc5
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,26 @@ build_property.EnableCodeStyleSeverity =
|
||||||
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/App.axaml]
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/App.axaml]
|
||||||
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/MainWindow.axaml]
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/ClientView.axaml]
|
||||||
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/OrderView.axaml]
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/DiscountView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/EmployeeView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/OrderView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/PositionView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/ServiceView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/UserControls/ZoneView.axaml]
|
||||||
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
||||||
|
[C:/Users/Mikhail/RiderProjects/BathHouseManagmet/Views/Windows/MainWindow.axaml]
|
||||||
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue