mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
v1.0
This commit is contained in:
17
JetFrames.AppleJobs.Editor/Views/Accessories.xaml
Normal file
17
JetFrames.AppleJobs.Editor/Views/Accessories.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.Accessories"
|
||||
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 x:Name="dg" ItemsSource="{Binding Editor.Accessories}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, ValidatesOnNotifyDataErrors=True}" Header="Название" Width="100" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
27
JetFrames.AppleJobs.Editor/Views/Accessories.xaml.cs
Normal file
27
JetFrames.AppleJobs.Editor/Views/Accessories.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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
public partial class Accessories : UserControl
|
||||
{
|
||||
public Accessories()
|
||||
{
|
||||
InitializeComponent();
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@
|
||||
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"
|
||||
<DataGrid x:Name="dg" ItemsSource="{Binding Editor.Categories}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, ValidatesOnNotifyDataErrors=True}" Header="Название" Width="100" />
|
||||
|
||||
@@ -11,17 +11,7 @@ namespace JetFrames.AppleJobs.Editor.Views
|
||||
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);
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
mc:Ignorable="d" d:DataContext="{StaticResource ViewModelLocator}"
|
||||
d:DesignHeight="300" d:DesignWidth="774">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.ModelJobPriceTemplates}"
|
||||
<DataGrid x:Name="dg" ItemsSource="{Binding Editor.ModelJobPriceTemplates}"
|
||||
CanUserAddRows="False" AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding ModelJob.Name}" Header="Работа" Width="120" SortMemberPath="ModelJob.Name"
|
||||
@@ -21,7 +21,7 @@
|
||||
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}" />
|
||||
ClipboardContentBinding="{Binding IsPriceFrom}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
@@ -12,21 +10,7 @@ namespace JetFrames.AppleJobs.Editor.Views
|
||||
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);
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
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"
|
||||
<DataGrid x:Name="dg" ItemsSource="{Binding Editor.ModelJobs}"
|
||||
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}}"/>
|
||||
ClipboardContentBinding="{Binding Model.Name}"
|
||||
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>
|
||||
|
||||
@@ -23,16 +23,7 @@ namespace JetFrames.AppleJobs.Editor.Views
|
||||
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);
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
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 x:Name="dg" ItemsSource="{Binding Editor.Models}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<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}}" />
|
||||
ClipboardContentBinding="{Binding ModelCategory.Name}"
|
||||
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>
|
||||
|
||||
@@ -23,16 +23,7 @@ namespace JetFrames.AppleJobs.Editor.Views
|
||||
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);
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
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"
|
||||
WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
|
||||
mc:Ignorable="d" WindowStyle="ToolWindow" ShowInTaskbar="False" Title="Новая расценка"
|
||||
Height="239" Width="324">
|
||||
<Grid>
|
||||
|
||||
27
JetFrames.AppleJobs.Editor/Views/News.xaml
Normal file
27
JetFrames.AppleJobs.Editor/Views/News.xaml
Normal file
@@ -0,0 +1,27 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.News"
|
||||
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="1000">
|
||||
<Grid>
|
||||
<DataGrid x:Name="dg" ItemsSource="{Binding Editor.News}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Title}" Header="Название" Width="200" />
|
||||
<DataGridTextColumn Binding="{Binding Content}" Header="Содержание" Width="250" />
|
||||
<DataGridTextColumn Binding="{Binding Date, StringFormat=MM/dd/yyyy}" Header="Дата" Width="100" />
|
||||
<DataGridTextColumn Binding="{Binding State}" Header="Настройки" Width="100" />
|
||||
<DataGridTextColumn Binding="{Binding OrderIndex}" Header="Порядковый номер" Width="100" />
|
||||
<DataGridTextColumn Binding="{Binding CharCount}" Header="Число символов" IsReadOnly="True" Width="100" />
|
||||
<DataGridComboBoxColumn SelectedItemBinding="{Binding NewsCategory}" DisplayMemberPath="CategoryDescription"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.NewsCategories}"
|
||||
ClipboardContentBinding="{Binding NewsCategory.CategoryDescription}"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}"
|
||||
Header="Категория" Width="100" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
17
JetFrames.AppleJobs.Editor/Views/News.xaml.cs
Normal file
17
JetFrames.AppleJobs.Editor/Views/News.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for News.xaml
|
||||
/// </summary>
|
||||
public partial class News : UserControl
|
||||
{
|
||||
public News()
|
||||
{
|
||||
InitializeComponent();
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
JetFrames.AppleJobs.Editor/Views/NewsCategories.xaml
Normal file
19
JetFrames.AppleJobs.Editor/Views/NewsCategories.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<UserControl x:Class="JetFrames.AppleJobs.Editor.Views.NewsCategories"
|
||||
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 x:Name="dg" ItemsSource="{Binding Editor.NewsCategories}"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding CategoryName, ValidatesOnNotifyDataErrors=True}" Header="Категория" Width="100" />
|
||||
<DataGridTextColumn Binding="{Binding CategoryDescription, ValidatesOnNotifyDataErrors=True}" Header="Название" Width="200" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
JetFrames.AppleJobs.Editor/Views/NewsCategories.xaml.cs
Normal file
28
JetFrames.AppleJobs.Editor/Views/NewsCategories.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 NewsCategories.xaml
|
||||
/// </summary>
|
||||
public partial class NewsCategories : UserControl
|
||||
{
|
||||
public NewsCategories()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,26 +5,27 @@
|
||||
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">
|
||||
d:DesignHeight="300" d:DesignWidth="1204">
|
||||
<Grid>
|
||||
<DataGrid CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute" ItemsSource="{Binding Editor.Orders}"
|
||||
InitializingNewItem="DataGrid_InitializingNewItem"
|
||||
AlternatingRowBackground="{DynamicResource AlternatingRowBackgroundBrush}">
|
||||
<DataGrid x:Name="dg" ItemsSource="{Binding Editor.Orders}"
|
||||
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}"
|
||||
DisplayMemberPath="Name" SortMemberPath="OrderStatus.Name" ClipboardContentBinding="{Binding OrderStatus.Name}"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Статус" Width="80" />
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Model, UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}"
|
||||
ClipboardContentBinding="{Binding Model.Name}"
|
||||
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 Header="Работа" Width="150" ClipboardContentBinding="{Binding JobModel.Name}" SortMemberPath="JobModel.Name">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding JobModel.Name}" />
|
||||
@@ -42,12 +43,40 @@
|
||||
<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" />
|
||||
ClipboardContentBinding="{Binding Accessories.Name}"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}" Header="Инвентарь" Width="120" />
|
||||
<DataGridComboBoxColumn SelectedValueBinding="{Binding Employee}"
|
||||
ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Employees}"
|
||||
DisplayMemberPath="Name" SortMemberPath="Employee.Name"
|
||||
ClipboardContentBinding="{Binding Employee.Name}"
|
||||
EditingElementStyle="{StaticResource {x:Type ComboBox}}"
|
||||
Header="Мастер" Width="80" />
|
||||
Header="Мастер" Width="120" />
|
||||
<DataGridTextColumn Binding="{Binding DateCreated}" Header="Дата создания" IsReadOnly="True" />
|
||||
<DataGridTemplateColumn Header="Дата закрытия" SortMemberPath="DateClosed" ClipboardContentBinding="{Binding DateClosed}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DateClosed, StringFormat='MM/dd/yyyy'}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<DatePicker SelectedDate="{Binding DateClosed}">
|
||||
<DatePicker.Resources>
|
||||
<Style TargetType="{x:Type DatePickerTextBox}">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<TextBox x:Name="PART_TextBox"
|
||||
Text="{Binding Path=SelectedDate, RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}, StringFormat=M/d/yyyy}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</DatePicker.Resources>
|
||||
</DatePicker>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AppleJobs.Data.Models;
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using AppleJobs.Data.Models.Orders;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
@@ -13,21 +14,8 @@ namespace JetFrames.AppleJobs.Editor.Views
|
||||
public Orders()
|
||||
{
|
||||
InitializeComponent();
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
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