mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
Initial
This commit is contained in:
18
JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml
Normal file
18
JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelCategories"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.Categories}"
|
||||
InitializingNewItem="DataGrid_InitializingNewItem"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, ValidatesOnNotifyDataErrors=True}" Header="Название" Width="100" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
27
JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml.cs
Normal file
27
JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ModelCategories.xaml
|
||||
/// </summary>
|
||||
public partial class ModelCategories : UserControl
|
||||
{
|
||||
public ModelCategories()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
JetFrames.AppleJobs.Editor/Views/ModelJobPriceTemplates.xaml
Normal file
29
JetFrames.AppleJobs.Editor/Views/ModelJobPriceTemplates.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelJobPriceTemplates"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="774">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.ModelJobPriceTemplates}"
|
||||
CanUserAddRows="False" AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding ModelJob.Name}" Header="Работа" Width="120" SortMemberPath="ModelJob.Name"
|
||||
ClipboardContentBinding="{Binding ModelJob.Name}"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding ModelJob.Model.Name}" Header="Модель" Width="120" SortMemberPath="ModelJob.Model.Name"
|
||||
ClipboardContentBinding="{Binding ModelJob.Model.Name}"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding ModelJob.Model.ModelCategory.Name}"
|
||||
IsReadOnly="True" Header="Категория" Width="120" SortMemberPath="ModelJob.Model.ModelCategory.Name"
|
||||
ClipboardContentBinding="{Binding ModelJob.Model.ModelCategory.Name}" />
|
||||
<DataGridTextColumn Binding="{Binding Price, TargetNullValue=''}" Header="Цена" Width="100" ClipboardContentBinding="{Binding Price}" />
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsPriceFrom}" Header="Цена от" Width="80"
|
||||
EditingElementStyle="{StaticResource {x:Type CheckBox}}" ClipboardContentBinding="{Binding IsPriceFrom}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,32 @@
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ModelJobPriceTemplates.xaml
|
||||
/// </summary>
|
||||
public partial class ModelJobPriceTemplates : UserControl
|
||||
{
|
||||
public ModelJobPriceTemplates()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
if (e.NewItem is ModelJobPriceTemplate)
|
||||
{
|
||||
var mjpt = (ModelJobPriceTemplate)e.NewItem;
|
||||
mjpt.Customers_Id = 1;
|
||||
}
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml
Normal file
26
JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.ModelJobs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="527">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.ModelJobs}"
|
||||
InitializingNewItem="DataGrid_InitializingNewItem"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name}" Header="Название" Width="150" />
|
||||
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Model}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}"
|
||||
DisplayMemberPath="Name" Header="Модель" Width="120" SortMemberPath="Model.Name"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}"/>
|
||||
<DataGridTextColumn Binding="{Binding Description}" Header="Описание" Width="200" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
38
JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml.cs
Normal file
38
JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ModelJobs.xaml
|
||||
/// </summary>
|
||||
public partial class ModelJobs : UserControl
|
||||
{
|
||||
public ModelJobs()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
JetFrames.AppleJobs.Editor/Views/Models.xaml
Normal file
22
JetFrames.AppleJobs.Editor/Views/Models.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.Models"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute"
|
||||
ItemsSource="{Binding Editor.Models}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}" InitializingNewItem="DataGrid_InitializingNewItem">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name}" Header="Модель" Width="120" />
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding ModelCategory, ValidatesOnExceptions=True}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Categories}"
|
||||
DisplayMemberPath="Name" Header="Категория" Width="120" SortMemberPath="ModelCategory.Name"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
38
JetFrames.AppleJobs.Editor/Views/Models.xaml.cs
Normal file
38
JetFrames.AppleJobs.Editor/Views/Models.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Models.xaml
|
||||
/// </summary>
|
||||
public partial class Models : UserControl
|
||||
{
|
||||
public Models()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
JetFrames.AppleJobs.Editor/Views/NewPriceTemplateDialog.xaml
Normal file
29
JetFrames.AppleJobs.Editor/Views/NewPriceTemplateDialog.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<Window x:Class="JetFrames.AppleJobs.Editor.Views.NewPriceTemplateDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d" WindowStyle="ToolWindow" ShowInTaskbar="False" Title="Новая расценка"
|
||||
Height="239" Width="324">
|
||||
<Grid>
|
||||
<DockPanel Margin="10" LastChildFill="False">
|
||||
<Label DockPanel.Dock="Top">Модель*</Label>
|
||||
<ComboBox DockPanel.Dock="Top" Name="modCb" VerticalAlignment="Top" ItemsSource="{Binding Models}" SelectedItem="{Binding SelectedModel, Mode=OneWayToSource}"
|
||||
DisplayMemberPath="Name" />
|
||||
|
||||
<Label DockPanel.Dock="Top">Работа*</Label>
|
||||
<ComboBox DockPanel.Dock="Top" DisplayMemberPath="Name" VerticalAlignment="Top" ItemsSource="{Binding FreeModelJobs}" SelectedItem="{Binding SelectedModelJob}" />
|
||||
|
||||
<Label DockPanel.Dock="Top">Цена (руб)</Label>
|
||||
<TextBox DockPanel.Dock="Top" Text="{Binding NewPrice, TargetNullValue=''}"></TextBox>
|
||||
|
||||
|
||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Content="Создать" Margin="5,5,0,5" IsDefault="True" Padding="20,7" Command="{Binding CreateCommand}" />
|
||||
<Button Content="Закрыть" Margin="5,5,0,5" IsCancel="True" Padding="7" />
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
public partial class NewPriceTemplateDialog : Window
|
||||
{
|
||||
public NewPriceTemplateDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
55
JetFrames.AppleJobs.Editor/Views/Orders.xaml
Normal file
55
JetFrames.AppleJobs.Editor/Views/Orders.xaml
Normal file
@@ -0,0 +1,55 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.Orders"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="1084">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.Orders}"
|
||||
InitializingNewItem="DataGrid_InitializingNewItem"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Contact}" Header="Контакт" Width="200" />
|
||||
<DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.OrderStatuses}"
|
||||
SelectedValueBinding="{Binding OrderStatus}"
|
||||
DisplayMemberPath="Name" SortMemberPath="OrderStatus.Name" ClipboardContentBinding="{Binding Name}"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Статус" Width="80" />
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Model, UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}"
|
||||
DisplayMemberPath="Name" Header="Модель" Width="120" SortMemberPath="Model.Name"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}"/>
|
||||
<DataGridTextColumn Binding="{Binding Comment}" Header="Коментарий" Width="100" />
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsFast}" Header="Быстро" Width="60" />
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsDrive}" Header="Доставка" Width="60" />
|
||||
<DataGridTextColumn Binding="{Binding Price}" Header="Цена" Width="80" />
|
||||
<DataGridTemplateColumn Header="Работа" Width="80" ClipboardContentBinding="{Binding JobModel.Name}" SortMemberPath="JobModel.Name">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding JobModel.Name}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding Model.ModelJobs}" DisplayMemberPath="Name"
|
||||
SelectedItem="{Binding JobModel, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Accessories}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Accessories}"
|
||||
DisplayMemberPath="Name" SortMemberPath="Accessories.Name"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Инвентарь" Width="80" />
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Employee}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Employees}"
|
||||
DisplayMemberPath="Name" SortMemberPath="Employee.Name"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}"
|
||||
Header="Мастер" Width="80" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
33
JetFrames.AppleJobs.Editor/Views/Orders.xaml.cs
Normal file
33
JetFrames.AppleJobs.Editor/Views/Orders.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using AppleJobs.Data.Models;
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Orders.xaml
|
||||
/// </summary>
|
||||
public partial class Orders : UserControl
|
||||
{
|
||||
public Orders()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
if (e.NewItem is Order)
|
||||
{
|
||||
var mjpt = (Order)e.NewItem;
|
||||
mjpt.Customers_Id = 1;
|
||||
}
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user