This commit is contained in:
Vitaliy
2017-01-09 13:25:52 +03:00
parent a9f4f0f297
commit 6ead62af6e
98 changed files with 12058 additions and 72 deletions

View 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);
}
}
}