This commit is contained in:
Vitaliy
2017-01-10 21:06:47 +03:00
parent 6ead62af6e
commit 2bbf0580f7
44 changed files with 565 additions and 893 deletions

View File

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