mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
34 lines
980 B
C#
34 lines
980 B
C#
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);
|
|
}
|
|
}
|
|
}
|