Good
This commit is contained in:
@@ -103,6 +103,9 @@
|
||||
<Compile Include="Models\Invoice.cs">
|
||||
<DependentUpon>Model1.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\ByhalterModel.cs" />
|
||||
<Compile Include="ViewModels\Laborant.cs" />
|
||||
<Compile Include="ViewModels\LaborantExplorer.cs" />
|
||||
<Compile Include="ViewModels\LoginViewModel.cs" />
|
||||
<Compile Include="Models\Model1.Context.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -150,9 +153,22 @@
|
||||
<Compile Include="Models\User.cs">
|
||||
<DependentUpon>Model1.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\SessionWindow.xaml.cs">
|
||||
<DependentUpon>SessionWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="Views\AdminWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ByhalterWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\LaborantExplorer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\LaborantWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -161,15 +177,23 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\SessionModel.cs" />
|
||||
<Compile Include="ViewModels\AdminModel.cs" />
|
||||
<Compile Include="Views\AdminWindow.xaml.cs">
|
||||
<DependentUpon>AdminWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ByhalterWindow.xaml.cs">
|
||||
<DependentUpon>ByhalterWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\LaborantExplorer.xaml.cs">
|
||||
<DependentUpon>LaborantExplorer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\LaborantWindow.xaml.cs">
|
||||
<DependentUpon>LaborantWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Views\SessionWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
|
||||
@@ -10,11 +10,11 @@ using Wpf.Ui.Input;
|
||||
|
||||
namespace Labaratory.ViewModels
|
||||
{
|
||||
public class SessionModel : BaseViewModel
|
||||
public class AdminModel : BaseViewModel
|
||||
{
|
||||
public Models.User CurrentUser { get; set; }
|
||||
|
||||
public SessionModel(Models.User user)
|
||||
public AdminModel(Models.User user)
|
||||
{
|
||||
CurrentUser = user;
|
||||
}
|
||||
18
Labaratory/Labaratory/ViewModels/ByhalterModel.cs
Normal file
18
Labaratory/Labaratory/ViewModels/ByhalterModel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Labaratory.ViewModels
|
||||
{
|
||||
public class ByhalterModel : BaseViewModel
|
||||
{
|
||||
public Models.User CurrentUser { get; set; }
|
||||
|
||||
public ByhalterModel(Models.User user)
|
||||
{
|
||||
CurrentUser = user;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Labaratory/Labaratory/ViewModels/Laborant.cs
Normal file
18
Labaratory/Labaratory/ViewModels/Laborant.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Labaratory.ViewModels
|
||||
{
|
||||
public class Laborant : BaseViewModel
|
||||
{
|
||||
public Models.User CurrentUser { get; set; }
|
||||
|
||||
public Laborant(Models.User user)
|
||||
{
|
||||
CurrentUser = user;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Labaratory/Labaratory/ViewModels/LaborantExplorer.cs
Normal file
18
Labaratory/Labaratory/ViewModels/LaborantExplorer.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Labaratory.ViewModels
|
||||
{
|
||||
public class LaborantExplorer : BaseViewModel
|
||||
{
|
||||
public Models.User CurrentUser { get; set; }
|
||||
|
||||
public LaborantExplorer(Models.User user)
|
||||
{
|
||||
CurrentUser = user;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,13 +77,38 @@ namespace Labaratory
|
||||
MessageBox.Show($"Успешный вход! Добро пожаловать, {user.Login}");
|
||||
if (parameter is Window window)
|
||||
{
|
||||
var nextWindow = new SessionWindow();
|
||||
if (user.Role.Value == 1)
|
||||
{
|
||||
var nextWindow = new AdminWindow();
|
||||
|
||||
var mainVM = new SessionModel(user);
|
||||
// Привязываем VM к окну
|
||||
nextWindow.DataContext = mainVM;
|
||||
var mainVM = new AdminModel(user);
|
||||
nextWindow.DataContext = mainVM;
|
||||
nextWindow.Show();
|
||||
}
|
||||
if (user.Role.Value == 2)
|
||||
{
|
||||
var nextWindow = new ByhalterWindow();
|
||||
|
||||
nextWindow.Show();
|
||||
var mainVM = new ByhalterModel(user);
|
||||
nextWindow.DataContext = mainVM;
|
||||
nextWindow.Show();
|
||||
}
|
||||
if (user.Role.Value == 3)
|
||||
{
|
||||
var nextWindow = new Views.Laborant();
|
||||
|
||||
var mainVM = new ViewModels.Laborant(user);
|
||||
nextWindow.DataContext = mainVM;
|
||||
nextWindow.Show();
|
||||
}
|
||||
if (user.Role.Value == 4)
|
||||
{
|
||||
var nextWindow = new Views.LaborantExplorer();
|
||||
|
||||
var mainVM = new ViewModels.LaborantExplorer(user);
|
||||
nextWindow.DataContext = mainVM;
|
||||
nextWindow.Show();
|
||||
}
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<Window x:Class="Labaratory.Views.SessionWindow"
|
||||
<Window x:Class="Labaratory.Views.AdminWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:local="clr-namespace:Labaratory.Views"
|
||||
mc:Ignorable="d"
|
||||
Title="SessionWindow" Height="450" Width="800">
|
||||
Title="AdminWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -15,11 +15,11 @@ using System.Windows.Shapes;
|
||||
namespace Labaratory.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для SessionWindow.xaml
|
||||
/// Логика взаимодействия для AdminWindow.xaml
|
||||
/// </summary>
|
||||
public partial class SessionWindow : Window
|
||||
public partial class AdminWindow : Window
|
||||
{
|
||||
public SessionWindow()
|
||||
public AdminWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
12
Labaratory/Labaratory/Views/ByhalterWindow.xaml
Normal file
12
Labaratory/Labaratory/Views/ByhalterWindow.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="Labaratory.Views.ByhalterWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:local="clr-namespace:Labaratory.Views"
|
||||
mc:Ignorable="d"
|
||||
Title="ByhalterWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
27
Labaratory/Labaratory/Views/ByhalterWindow.xaml.cs
Normal file
27
Labaratory/Labaratory/Views/ByhalterWindow.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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 System.Windows.Shapes;
|
||||
|
||||
namespace Labaratory.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ByhalterWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ByhalterWindow : Window
|
||||
{
|
||||
public ByhalterWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Labaratory/Labaratory/Views/LaborantExplorer.xaml
Normal file
12
Labaratory/Labaratory/Views/LaborantExplorer.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="Labaratory.Views.LaborantExplorer"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:local="clr-namespace:Labaratory.Views"
|
||||
mc:Ignorable="d"
|
||||
Title="LaborantExplorer" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
27
Labaratory/Labaratory/Views/LaborantExplorer.xaml.cs
Normal file
27
Labaratory/Labaratory/Views/LaborantExplorer.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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 System.Windows.Shapes;
|
||||
|
||||
namespace Labaratory.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для LaborantExplorer.xaml
|
||||
/// </summary>
|
||||
public partial class LaborantExplorer : Window
|
||||
{
|
||||
public LaborantExplorer()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Labaratory/Labaratory/Views/LaborantWindow.xaml
Normal file
12
Labaratory/Labaratory/Views/LaborantWindow.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="Labaratory.Views.Laborant"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:local="clr-namespace:Labaratory.Views"
|
||||
mc:Ignorable="d"
|
||||
Title="Laborant" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
27
Labaratory/Labaratory/Views/LaborantWindow.xaml.cs
Normal file
27
Labaratory/Labaratory/Views/LaborantWindow.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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 System.Windows.Shapes;
|
||||
|
||||
namespace Labaratory.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для Laborant.xaml
|
||||
/// </summary>
|
||||
public partial class Laborant : Window
|
||||
{
|
||||
public Laborant()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user