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:
@@ -77,8 +77,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppleJobsContext.cs" />
|
||||
<Compile Include="Models\Articles\NewsCategory.cs" />
|
||||
<Compile Include="Models\Articles\News.cs" />
|
||||
<Compile Include="Models\Inventory\Accessories.cs" />
|
||||
<Compile Include="Models\Customer.cs" />
|
||||
<Compile Include="Models\Common\Customer.cs" />
|
||||
<Compile Include="Models\Inventory\Employee.cs" />
|
||||
<Compile Include="Models\ModelsJobs\Model.cs" />
|
||||
<Compile Include="Models\ModelsJobs\ModelJobPriceTemplate.cs" />
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using AppleJobs.Data.Models;
|
||||
using AppleJobs.Data.Models.Articles;
|
||||
using AppleJobs.Data.Models.Common;
|
||||
using AppleJobs.Data.Models.Inventory;
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using AppleJobs.Data.Models.Orders;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using MySql.Data.Entity;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
|
||||
namespace AppleJobs.Data
|
||||
@@ -41,6 +43,13 @@ namespace AppleJobs.Data
|
||||
|
||||
#endregion
|
||||
|
||||
#region Articles / News
|
||||
|
||||
public DbSet<News> News { get; set; }
|
||||
public DbSet<NewsCategory> NewsCategories { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public AppleJobsContext(string connection = "Default") : base(connection)
|
||||
{
|
||||
}
|
||||
|
||||
25
AppleJobs.Data/Models/Articles/News.cs
Normal file
25
AppleJobs.Data/Models/Articles/News.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.Articles
|
||||
{
|
||||
[Table("ApjNews")]
|
||||
public class News
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Content { get; set; }
|
||||
public int OrderIndex { get; set; }
|
||||
public int CharCount { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string State { get; set; }
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(CategoryId))]
|
||||
public virtual NewsCategory NewsCategory { get; set; }
|
||||
|
||||
public string FilterString { get { return string.Join(",", Title, Content, OrderIndex, CharCount, Date, State, NewsCategory.CategoryDescription); } }
|
||||
}
|
||||
}
|
||||
15
AppleJobs.Data/Models/Articles/NewsCategory.cs
Normal file
15
AppleJobs.Data/Models/Articles/NewsCategory.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.Articles
|
||||
{
|
||||
[Table("ApjNewsCategory")]
|
||||
public class NewsCategory
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public string CategoryDescription { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.ModelsJobs
|
||||
namespace AppleJobs.Data.Models.Common
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
@@ -10,5 +10,6 @@ namespace AppleJobs.Data.Models.ModelsJobs
|
||||
public string Name { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string MainEmail { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models
|
||||
namespace AppleJobs.Data.Models.Inventory
|
||||
{
|
||||
public class Accessories
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models
|
||||
namespace AppleJobs.Data.Models.Inventory
|
||||
{
|
||||
public class Employee
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.ModelsJobs
|
||||
{
|
||||
[TsModel]
|
||||
public class Model
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.ModelsJobs
|
||||
{
|
||||
[TsModel]
|
||||
public class ModelCategory
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.ModelsJobs
|
||||
{
|
||||
[TsModel]
|
||||
public class ModelJob
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using AppleJobs.Data.Models.Common;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models.ModelsJobs
|
||||
{
|
||||
[TsModel]
|
||||
public class ModelJobPriceTemplate
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using AppleJobs.Data.Models.Common;
|
||||
using AppleJobs.Data.Models.Inventory;
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models
|
||||
namespace AppleJobs.Data.Models.Orders
|
||||
{
|
||||
[TsModel]
|
||||
public class OrderView
|
||||
@@ -60,12 +62,14 @@ namespace AppleJobs.Data.Models
|
||||
public bool? IsDrive { get; set; }
|
||||
public int? Price { get; set; }
|
||||
|
||||
#region ForeignKeys
|
||||
public int OrderStatuses_Id { get; set; }
|
||||
public int Models_Id { get; set; }
|
||||
public int? ModelJobs_Id { get; set; }
|
||||
public int Customers_Id { get; set; }
|
||||
public int? Accessories_Id { get; set; }
|
||||
public int? Employees_Id { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
[ForeignKey(nameof(OrderStatuses_Id))]
|
||||
@@ -90,14 +94,8 @@ namespace AppleJobs.Data.Models
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}",
|
||||
Contact, Comment, DateCreated, DateClosed, DateUpdated,
|
||||
OrderStatus?.Name,
|
||||
Model.FilterString,
|
||||
JobModel.FilterString,
|
||||
Customer?.Name,
|
||||
Accessories?.Name,
|
||||
Employee?.Name);
|
||||
return string.Join(",", Contact, Comment, DateCreated, DateClosed, DateUpdated,
|
||||
OrderStatus?.Name, Model.FilterString, JobModel.FilterString, Customer?.Name, Accessories?.Name, Employee?.Name, Price);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models
|
||||
namespace AppleJobs.Data.Models.Orders
|
||||
{
|
||||
[TsModel]
|
||||
public class OrderCategory
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace AppleJobs.Data.Models
|
||||
namespace AppleJobs.Data.Models.Orders
|
||||
{
|
||||
[TsModel]
|
||||
[Table("OrderStatuses")]
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace BrightSharp.Behaviors
|
||||
{
|
||||
timer.Tick += Timer_Tick;
|
||||
FilterDelay = TimeSpan.FromSeconds(1);
|
||||
IgnoreCase = null;
|
||||
IgnoreCase = null; //Case sensitive if any char upper case
|
||||
FilterStringPropertyName = "FilterString";
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace BrightSharp.Behaviors
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string FilterStringPropertyName { get; set; }
|
||||
|
||||
public bool HasFilterText
|
||||
{
|
||||
@@ -64,7 +65,7 @@ namespace BrightSharp.Behaviors
|
||||
private Predicate<object> GetDefaultFilter(Type filterItemType)
|
||||
{
|
||||
Func<object, string> dataFunc;
|
||||
var pInfo = filterItemType.GetProperty("FilterString");
|
||||
var pInfo = filterItemType.GetProperty(FilterStringPropertyName);
|
||||
if (pInfo == null)
|
||||
{
|
||||
dataFunc = (x) => string.Join(",", filterItemType.GetProperties().Where(p => !p.Name.EndsWith("Id")).Select(p => (p.GetValue(x, null) ?? string.Empty).ToString()));
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Diagrams/Resources/DesignerItem.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<sys:Boolean x:Key="IsInverseTheme">False</sys:Boolean>
|
||||
|
||||
|
||||
<CornerRadius x:Key="DefaultRadiusSmall">1</CornerRadius>
|
||||
<CornerRadius x:Key="DefaultRadiusNormal">3</CornerRadius>
|
||||
|
||||
|
||||
@@ -21,99 +21,13 @@
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.data>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data><userSettings>
|
||||
<JetFrames.AppleJobs.Editor.Properties.Settings>
|
||||
<setting name="Grid01LayoutX" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Grid01LayoutY" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Grid01LayoutWidth" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid01LayoutHeight" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid02LayoutX" serializeAs="String">
|
||||
<value>100</value>
|
||||
</setting>
|
||||
<setting name="Grid03LayoutX" serializeAs="String">
|
||||
<value>200</value>
|
||||
</setting>
|
||||
<setting name="Grid04LayoutX" serializeAs="String">
|
||||
<value>300</value>
|
||||
</setting>
|
||||
<setting name="Grid02LayoutY" serializeAs="String">
|
||||
<value>100</value>
|
||||
</setting>
|
||||
<setting name="Grid03LayoutY" serializeAs="String">
|
||||
<value>200</value>
|
||||
</setting>
|
||||
<setting name="Grid04LayoutY" serializeAs="String">
|
||||
<value>300</value>
|
||||
</setting>
|
||||
<setting name="Grid02LayoutWidth" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid03LayoutWidth" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid04LayoutWidth" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid02LayoutHeight" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid03LayoutHeight" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid04LayoutHeight" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid01Expanded" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="Grid02Expanded" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="Grid03Expanded" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="Grid04Expanded" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="ZoomPadX" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="ZoomPadY" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Zoom" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="Grid05Expanded" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="Grid05LayoutX" serializeAs="String">
|
||||
<value>400</value>
|
||||
</setting>
|
||||
<setting name="Grid05LayoutY" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Grid05LayoutWidth" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
<setting name="Grid05LayoutHeight" serializeAs="String">
|
||||
<value>NaN</value>
|
||||
</setting>
|
||||
</JetFrames.AppleJobs.Editor.Properties.Settings>
|
||||
</userSettings>
|
||||
</system.data>
|
||||
</configuration>
|
||||
@@ -13,12 +13,6 @@ namespace JetFrames.AppleJobs.Editor
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
public static ViewModelLocator Locator { get { return (ViewModelLocator)Current.TryFindResource("ViewModelLocator"); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor.Converters
|
||||
{
|
||||
public class ModelFilterConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var initCollection = (IEnumerable<ModelJob>)values[0];
|
||||
var modelJob = (ModelJob)values[1];
|
||||
if (modelJob == null) return initCollection;
|
||||
return initCollection.Where(mj => mj.Models_Id == modelJob.Models_Id);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,12 @@ using System.Windows;
|
||||
using BrightSharp.Extensions;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System;
|
||||
using AppleJobs.Data.Models;
|
||||
using JetFrames.AppleJobs.Editor.Views;
|
||||
using JetFrames.AppleJobs.Editor.ViewModels;
|
||||
using System.Collections;
|
||||
using AppleJobs.Data.Models.Articles;
|
||||
using AppleJobs.Data.Models.Orders;
|
||||
using AppleJobs.Data.Models.Inventory;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor
|
||||
{
|
||||
@@ -27,31 +28,59 @@ namespace JetFrames.AppleJobs.Editor
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
#region Data Properties
|
||||
|
||||
List<Model> _models;
|
||||
public IEnumerable<Model> Models
|
||||
{
|
||||
get
|
||||
{
|
||||
return _models ?? (_models = context.Models.ToList());
|
||||
}
|
||||
}
|
||||
public IEnumerable<Model> Models { get { return GetSingleton(ref _models, context.Models); } }
|
||||
List<ModelCategory> _categories;
|
||||
public IEnumerable<ModelCategory> Categories
|
||||
public IEnumerable<ModelCategory> Categories { get { return GetSingleton(ref _categories, context.ModelCategories); } }
|
||||
private List<News> _news;
|
||||
public IEnumerable<News> News { get { return GetSingleton(ref _news, context.News); } }
|
||||
private List<NewsCategory> _newsCategories;
|
||||
public IEnumerable<NewsCategory> NewsCategories { get { return GetSingleton(ref _newsCategories, context.NewsCategories); } }
|
||||
List<ModelJobPriceTemplate> _modelJobPriceTemplates;
|
||||
public IEnumerable<ModelJobPriceTemplate> ModelJobPriceTemplates
|
||||
{
|
||||
get
|
||||
{
|
||||
return _categories ?? (_categories = context.ModelCategories.ToList());
|
||||
context.ModelJobs.Count();
|
||||
return GetSingleton(ref _modelJobPriceTemplates, context.ModelJobPriceTemplates);
|
||||
}
|
||||
}
|
||||
List<ModelJob> _modelJobs;
|
||||
public IEnumerable<ModelJob> ModelJobs { get { return GetSingleton(ref _modelJobs, context.ModelJobs); } }
|
||||
List<Order> _orders;
|
||||
public IEnumerable<Order> Orders { get { return GetSingleton(ref _orders, context.Orders.OrderByDescending(o => o.DateCreated).Take(2000)); } }
|
||||
List<OrderStatus> _orderStatuses;
|
||||
public IEnumerable<OrderStatus> OrderStatuses { get { return GetSingleton(ref _orderStatuses, context.OrderStatuses); } }
|
||||
List<Accessories> _accessories;
|
||||
public IEnumerable<Accessories> Accessories { get { return GetSingleton(ref _accessories, context.Accessories); } }
|
||||
List<Employee> _employees;
|
||||
public IEnumerable<Employee> Employees { get { return GetSingleton(ref _employees, context.Employees); } }
|
||||
|
||||
public void OnLoaded()
|
||||
#endregion
|
||||
|
||||
#region Initialize Grid
|
||||
|
||||
public static void InitGrid(DataGrid dg)
|
||||
{
|
||||
|
||||
CommandManager.AddPreviewCanExecuteHandler(dg, DataGridPreviewCanExecute);
|
||||
dg.InitializingNewItem += DataGridInitializingNewItem;
|
||||
}
|
||||
private static void DataGridPreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
}
|
||||
|
||||
private static void DataGridInitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
{
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Commands
|
||||
public bool CanAdd(object item)
|
||||
{
|
||||
if (item is ModelJobPriceTemplate)
|
||||
@@ -80,60 +109,6 @@ namespace JetFrames.AppleJobs.Editor
|
||||
return true;
|
||||
}
|
||||
|
||||
List<ModelJobPriceTemplate> _modelJobPriceTemplates;
|
||||
public IEnumerable<ModelJobPriceTemplate> ModelJobPriceTemplates
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ModelJobs == null) throw new InvalidOperationException();
|
||||
return _modelJobPriceTemplates ?? (_modelJobPriceTemplates = context.ModelJobPriceTemplates.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
List<ModelJob> _modelJobs;
|
||||
public IEnumerable<ModelJob> ModelJobs
|
||||
{
|
||||
get
|
||||
{
|
||||
return _modelJobs ?? (_modelJobs = context.ModelJobs.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
List<Order> _orders;
|
||||
public IEnumerable<Order> Orders
|
||||
{
|
||||
get
|
||||
{
|
||||
return _orders ?? (_orders = context.Orders.Take(1000).ToList());
|
||||
}
|
||||
}
|
||||
List<OrderStatus> _orderStatuses;
|
||||
public IEnumerable<OrderStatus> OrderStatuses
|
||||
{
|
||||
get
|
||||
{
|
||||
return _orderStatuses ?? (_orderStatuses = context.OrderStatuses.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
List<Accessories> _accessories;
|
||||
public IEnumerable<Accessories> Accessories
|
||||
{
|
||||
get
|
||||
{
|
||||
return _accessories ?? (_accessories = context.Accessories.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
List<Employee> _employees;
|
||||
public IEnumerable<Employee> Employees
|
||||
{
|
||||
get
|
||||
{
|
||||
return _employees ?? (_employees = context.Employees.ToList());
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand SaveCommand
|
||||
{
|
||||
get
|
||||
@@ -181,7 +156,6 @@ namespace JetFrames.AppleJobs.Editor
|
||||
RaisePropertyChanged(nameof(Orders));
|
||||
RaisePropertyChanged(nameof(OrderStatuses));
|
||||
ShowMessage("Обновлено из базы данных");
|
||||
OnLoaded();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -192,42 +166,27 @@ namespace JetFrames.AppleJobs.Editor
|
||||
{
|
||||
return new RelayCommand(p =>
|
||||
{
|
||||
var vm = new NewPriceTemplateVm(Models, ModelJobs, ModelJobPriceTemplates, CreateNewModelJobPriceTemplate);
|
||||
var dialog = new NewPriceTemplateDialog
|
||||
{
|
||||
DataContext = vm,
|
||||
Owner = Application.Current.MainWindow
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
CreateNewModelJobPriceTemplate(vm);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateNewModelJobPriceTemplate(NewPriceTemplateVm vm)
|
||||
var vm = new NewPriceTemplateVm(Models, ModelJobs, ModelJobPriceTemplates, viewModel =>
|
||||
{
|
||||
var item = new ModelJobPriceTemplate
|
||||
{
|
||||
Price = vm.NewPrice,
|
||||
Price = viewModel.NewPrice,
|
||||
Customers_Id = 1,
|
||||
ModelJobs_Id = vm.SelectedModelJob.Id,
|
||||
ModelJobs_Id = viewModel.SelectedModelJob.Id,
|
||||
IsPriceFrom = true
|
||||
};
|
||||
_modelJobPriceTemplates.Add(item);
|
||||
context.Entry(item).State = EntityState.Added;
|
||||
CollectionViewSource.GetDefaultView(ModelJobPriceTemplates).Refresh();
|
||||
}
|
||||
|
||||
private object _currentRow;
|
||||
|
||||
public object CurrentRow
|
||||
});
|
||||
var dialog = new Views.NewPriceTemplateDialog
|
||||
{
|
||||
get { return _currentRow; }
|
||||
set { _currentRow = value; RaisePropertyChanged(nameof(CurrentRow)); }
|
||||
DataContext = vm,
|
||||
Owner = Application.Current.MainWindow
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICommand ModelJobDropDownLoadedCommand
|
||||
{
|
||||
@@ -260,6 +219,8 @@ namespace JetFrames.AppleJobs.Editor
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public bool DeleteEntity(object entity, bool promt)
|
||||
{
|
||||
if (entity != null && (entity.GetType().IsPublic || entity is IEnumerable))
|
||||
@@ -291,11 +252,21 @@ namespace JetFrames.AppleJobs.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEntity(object entity)
|
||||
public void AddEntity(object newItem)
|
||||
{
|
||||
if (entity != null)
|
||||
if (newItem != null)
|
||||
{
|
||||
context.Entry(entity).State = EntityState.Added;
|
||||
if (newItem is Order)
|
||||
{
|
||||
var mjpt = (Order)newItem;
|
||||
mjpt.Customers_Id = 1;
|
||||
}
|
||||
if (newItem is ModelJobPriceTemplate)
|
||||
{
|
||||
var mjpt = (ModelJobPriceTemplate)newItem;
|
||||
mjpt.Customers_Id = 1;
|
||||
}
|
||||
context.Entry(newItem).State = EntityState.Added;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,5 +301,16 @@ namespace JetFrames.AppleJobs.Editor
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static IEnumerable<T> GetSingleton<T>(ref List<T> entities, IQueryable<T> query) where T : class
|
||||
{
|
||||
if (entities != null) return entities;
|
||||
entities = query.ToList();
|
||||
|
||||
var view = CollectionViewSource.GetDefaultView(entities) as IEditableCollectionView;
|
||||
if (view != null) view.NewItemPlaceholderPosition = NewItemPlaceholderPosition.AtBeginning;
|
||||
|
||||
return entities;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,11 +82,12 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Converters\ModelFilterConverter.cs" />
|
||||
<Compile Include="EditorViewModel.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="ViewModelLocator.cs" />
|
||||
<Compile Include="ViewModels\NewPriceTemplateVm.cs" />
|
||||
<Compile Include="Views\Accessories.xaml.cs">
|
||||
<DependentUpon>Accessories.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModelCategories.xaml.cs">
|
||||
<DependentUpon>ModelCategories.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -102,6 +103,12 @@
|
||||
<Compile Include="Views\NewPriceTemplateDialog.xaml.cs">
|
||||
<DependentUpon>NewPriceTemplateDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\News.xaml.cs">
|
||||
<DependentUpon>News.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NewsCategories.xaml.cs">
|
||||
<DependentUpon>NewsCategories.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Orders.xaml.cs">
|
||||
<DependentUpon>Orders.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -117,6 +124,10 @@
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Views\Accessories.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModelCategories.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -137,6 +148,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\News.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NewsCategories.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Orders.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -180,7 +199,9 @@
|
||||
<Name>BrightSharp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="Converters\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -5,33 +5,162 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:int="http://schemas.microsoft.com/expression/2010/interactions"
|
||||
xmlns:conv="clr-namespace:JetFrames.AppleJobs.Editor.Converters"
|
||||
xmlns:view="clr-namespace:JetFrames.AppleJobs.Editor.Views"
|
||||
xmlns:local="clr-namespace:JetFrames.AppleJobs.Editor"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:bs="http://schemas.brightsharp.com/developer"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="700" Width="1000">
|
||||
mc:Ignorable="d" DataContext="{Binding Editor, Source={StaticResource ViewModelLocator}}"
|
||||
Title="MainWindow" Height="700" d:DesignWidth="2000">
|
||||
<Window.Resources>
|
||||
<conv:ModelFilterConverter x:Key="ModelFilterConverter" />
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<ObjectDataProvider x:Key="themes" MethodName="GetValues"
|
||||
ObjectType="{x:Type sys:Enum}">
|
||||
<ObjectDataProvider.MethodParameters>
|
||||
<x:Type TypeName="bs:ColorThemes"/>
|
||||
</ObjectDataProvider.MethodParameters>
|
||||
</ObjectDataProvider>
|
||||
<TabItem Header="Модели" x:Key="ModelsViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.Models}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:Models Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Категории моделей" x:Key="ModelCategoriesViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Editor.Categories}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:ModelCategories Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Виды работ" x:Key="ModelJobsViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.ModelJobs}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:ModelJobs Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Расценки" x:Key="ModelJobPricesViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.ModelJobPriceTemplates}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Command="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.AddNewPriceTemplateCommand}" Margin="0,3,0,0">
|
||||
<Path Fill="Blue">
|
||||
<Path.Data>
|
||||
<CombinedGeometry>
|
||||
<CombinedGeometry.Geometry1>
|
||||
<RectangleGeometry Rect="0,5,12,2" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
<CombinedGeometry.Geometry2>
|
||||
<RectangleGeometry Rect="5,0,2,12" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Button>
|
||||
<view:ModelJobPriceTemplates Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Инвентарь" x:Key="AccessoriesViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.Accessories}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:Accessories Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Заказы" x:Key="OrdersViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.Orders}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:Orders Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem Header="Статьи" x:Key="NewsViewTab">
|
||||
<TabItem.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{StaticResource ViewModelLocator}">
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200" Margin="0,5,0,0">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Path=Editor.News}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:News Margin="0,30,0,0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabItem.ContentTemplate>
|
||||
</TabItem>
|
||||
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Menu VerticalAlignment="Top">
|
||||
<Menu VerticalAlignment="Top" Grid.ColumnSpan="2">
|
||||
<MenuItem Header="Данные">
|
||||
<MenuItem Header="Обновить" Command="{Binding Editor.RefreshCommand}" />
|
||||
<MenuItem Header="Обновить" Command="{Binding RefreshCommand}" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="Сайт"></MenuItem>
|
||||
<MenuItem Header="Сохранить" Command="{Binding Editor.SaveCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"></MenuItem>
|
||||
<TextBlock IsHitTestVisible="False" Text="{Binding Editor.Message}" Foreground="{Binding Editor.MessageForeground}" Opacity="0">
|
||||
<MenuItem Header="Вид" ItemsSource="{Binding Source={StaticResource themes}}" MenuItem.Click="MenuItem_Click" />
|
||||
|
||||
<MenuItem Header="Сохранить" Command="{Binding SaveCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"></MenuItem>
|
||||
<TextBlock IsHitTestVisible="False" Text="{Binding Message}" Foreground="{Binding MessageForeground}" Opacity="0">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Editor.MessageAnimationState}" Value="New">
|
||||
<DataTrigger Binding="{Binding MessageAnimationState}" Value="New">
|
||||
<DataTrigger.EnterActions>
|
||||
<BeginStoryboard Name="NewAnimation">
|
||||
<Storyboard>
|
||||
@@ -54,63 +183,29 @@
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Menu>
|
||||
<TabControl Grid.Row="1" SelectionChanged="TabControl_SelectionChanged" DataContext="{x:Null}">
|
||||
<TabItem Header="Категории моделей">
|
||||
<Grid>
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Categories}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:ModelCategories Margin="0,50,0,0" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Модели">
|
||||
<Grid>
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Models}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:Models Margin="0,50,0,0" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Виды работ">
|
||||
<Grid>
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.ModelJobs}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:ModelJobs Margin="0,50,0,0" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Расценки">
|
||||
<Grid>
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.ModelJobPriceTemplates}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Command="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.AddNewPriceTemplateCommand}">+Добавить</Button>
|
||||
<view:ModelJobPriceTemplates Margin="0,50,0,0" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Заказы">
|
||||
<Grid>
|
||||
<TextBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
|
||||
<bs:MarkupExtensionProperties.Header>Фильтрация</bs:MarkupExtensionProperties.Header>
|
||||
<i:Interaction.Behaviors>
|
||||
<bs:FilterDefaultViewTextBoxBehavior ItemsSource="{Binding Source={StaticResource ViewModelLocator}, Path=Editor.Orders}" />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<view:Orders Margin="0,50,0,0" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TreeView Grid.Row="1" SelectedItemChanged="TreeView_SelectedItemChanged">
|
||||
<TreeViewItem Header="Модели и расценки">
|
||||
<TreeViewItem Header="Модели" Tag="{StaticResource ModelsViewTab}" />
|
||||
<TreeViewItem Header="Категории моделей" Tag="{StaticResource ModelCategoriesViewTab}" />
|
||||
<TreeViewItem Header="Виды работ" Tag="{StaticResource ModelJobsViewTab}"/>
|
||||
<TreeViewItem Header="Расценки" Tag="{StaticResource ModelJobPricesViewTab}" />
|
||||
</TreeViewItem>
|
||||
|
||||
<TreeViewItem Header="Ресурсы">
|
||||
<TreeViewItem Header="Инвентарь" Tag="{StaticResource AccessoriesViewTab}" />
|
||||
<!--TODO-->
|
||||
<TreeViewItem Header="Специалисты" />
|
||||
</TreeViewItem>
|
||||
<TreeViewItem Header="Заказы" Tag="{StaticResource OrdersViewTab}" />
|
||||
<TreeViewItem Header="Статьи (новости)">
|
||||
<TreeViewItem Header="Статьи" Tag="{StaticResource NewsViewTab}" />
|
||||
<!--TODO-->
|
||||
<TreeViewItem Header="Категории статей" />
|
||||
</TreeViewItem>
|
||||
|
||||
</TreeView>
|
||||
<TabControl x:Name="tabs" Grid.Column="1" Grid.Row="1">
|
||||
<!--<StaticResource ResourceKey="ModelsViewTab" />-->
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,50 +1,34 @@
|
||||
using AppleJobs.Data.Models.ModelsJobs;
|
||||
using System.ComponentModel;
|
||||
using BrightSharp;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace JetFrames.AppleJobs.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
DataContext = App.Locator;
|
||||
InitializeComponent();
|
||||
Loaded += (s, e) => App.Locator.Editor.OnLoaded();
|
||||
}
|
||||
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
var dg = (DataGrid)sender;
|
||||
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(dg.SelectedValue, true);
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ThemeManager.Theme = (ColorThemes)((FrameworkElement)e.OriginalSource).DataContext;
|
||||
}
|
||||
|
||||
private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
|
||||
private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||
{
|
||||
if (e.NewItem is ModelJobPriceTemplate)
|
||||
var item = (TreeViewItem)e.NewValue;
|
||||
var tabitem = (TabItem)item.Tag;
|
||||
if (tabitem != null)
|
||||
{
|
||||
var mjpt = (ModelJobPriceTemplate)e.NewItem;
|
||||
mjpt.Customers_Id = 1;
|
||||
if (!tabs.Items.Contains(tabitem))
|
||||
{
|
||||
tabs.Items.Add(tabitem);
|
||||
}
|
||||
App.Locator.Editor.AddEntity(e.NewItem);
|
||||
tabs.SelectedItem = tabitem;
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Save();
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
((TabItem)((TabControl)sender).SelectedItem).DataContext = App.Locator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,341 +22,5 @@ namespace JetFrames.AppleJobs.Editor.Properties {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public double Grid01LayoutX {
|
||||
get {
|
||||
return ((double)(this["Grid01LayoutX"]));
|
||||
}
|
||||
set {
|
||||
this["Grid01LayoutX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public double Grid01LayoutY {
|
||||
get {
|
||||
return ((double)(this["Grid01LayoutY"]));
|
||||
}
|
||||
set {
|
||||
this["Grid01LayoutY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid01LayoutWidth {
|
||||
get {
|
||||
return ((double)(this["Grid01LayoutWidth"]));
|
||||
}
|
||||
set {
|
||||
this["Grid01LayoutWidth"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid01LayoutHeight {
|
||||
get {
|
||||
return ((double)(this["Grid01LayoutHeight"]));
|
||||
}
|
||||
set {
|
||||
this["Grid01LayoutHeight"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("100")]
|
||||
public double Grid02LayoutX {
|
||||
get {
|
||||
return ((double)(this["Grid02LayoutX"]));
|
||||
}
|
||||
set {
|
||||
this["Grid02LayoutX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("200")]
|
||||
public double Grid03LayoutX {
|
||||
get {
|
||||
return ((double)(this["Grid03LayoutX"]));
|
||||
}
|
||||
set {
|
||||
this["Grid03LayoutX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("300")]
|
||||
public double Grid04LayoutX {
|
||||
get {
|
||||
return ((double)(this["Grid04LayoutX"]));
|
||||
}
|
||||
set {
|
||||
this["Grid04LayoutX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("100")]
|
||||
public double Grid02LayoutY {
|
||||
get {
|
||||
return ((double)(this["Grid02LayoutY"]));
|
||||
}
|
||||
set {
|
||||
this["Grid02LayoutY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("200")]
|
||||
public double Grid03LayoutY {
|
||||
get {
|
||||
return ((double)(this["Grid03LayoutY"]));
|
||||
}
|
||||
set {
|
||||
this["Grid03LayoutY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("300")]
|
||||
public double Grid04LayoutY {
|
||||
get {
|
||||
return ((double)(this["Grid04LayoutY"]));
|
||||
}
|
||||
set {
|
||||
this["Grid04LayoutY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid02LayoutWidth {
|
||||
get {
|
||||
return ((double)(this["Grid02LayoutWidth"]));
|
||||
}
|
||||
set {
|
||||
this["Grid02LayoutWidth"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid03LayoutWidth {
|
||||
get {
|
||||
return ((double)(this["Grid03LayoutWidth"]));
|
||||
}
|
||||
set {
|
||||
this["Grid03LayoutWidth"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid04LayoutWidth {
|
||||
get {
|
||||
return ((double)(this["Grid04LayoutWidth"]));
|
||||
}
|
||||
set {
|
||||
this["Grid04LayoutWidth"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid02LayoutHeight {
|
||||
get {
|
||||
return ((double)(this["Grid02LayoutHeight"]));
|
||||
}
|
||||
set {
|
||||
this["Grid02LayoutHeight"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid03LayoutHeight {
|
||||
get {
|
||||
return ((double)(this["Grid03LayoutHeight"]));
|
||||
}
|
||||
set {
|
||||
this["Grid03LayoutHeight"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid04LayoutHeight {
|
||||
get {
|
||||
return ((double)(this["Grid04LayoutHeight"]));
|
||||
}
|
||||
set {
|
||||
this["Grid04LayoutHeight"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Grid01Expanded {
|
||||
get {
|
||||
return ((bool)(this["Grid01Expanded"]));
|
||||
}
|
||||
set {
|
||||
this["Grid01Expanded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Grid02Expanded {
|
||||
get {
|
||||
return ((bool)(this["Grid02Expanded"]));
|
||||
}
|
||||
set {
|
||||
this["Grid02Expanded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Grid03Expanded {
|
||||
get {
|
||||
return ((bool)(this["Grid03Expanded"]));
|
||||
}
|
||||
set {
|
||||
this["Grid03Expanded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Grid04Expanded {
|
||||
get {
|
||||
return ((bool)(this["Grid04Expanded"]));
|
||||
}
|
||||
set {
|
||||
this["Grid04Expanded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public double ZoomPadX {
|
||||
get {
|
||||
return ((double)(this["ZoomPadX"]));
|
||||
}
|
||||
set {
|
||||
this["ZoomPadX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public double ZoomPadY {
|
||||
get {
|
||||
return ((double)(this["ZoomPadY"]));
|
||||
}
|
||||
set {
|
||||
this["ZoomPadY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("1")]
|
||||
public double Zoom {
|
||||
get {
|
||||
return ((double)(this["Zoom"]));
|
||||
}
|
||||
set {
|
||||
this["Zoom"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Grid05Expanded {
|
||||
get {
|
||||
return ((bool)(this["Grid05Expanded"]));
|
||||
}
|
||||
set {
|
||||
this["Grid05Expanded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("400")]
|
||||
public double Grid05LayoutX {
|
||||
get {
|
||||
return ((double)(this["Grid05LayoutX"]));
|
||||
}
|
||||
set {
|
||||
this["Grid05LayoutX"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public double Grid05LayoutY {
|
||||
get {
|
||||
return ((double)(this["Grid05LayoutY"]));
|
||||
}
|
||||
set {
|
||||
this["Grid05LayoutY"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid05LayoutWidth {
|
||||
get {
|
||||
return ((double)(this["Grid05LayoutWidth"]));
|
||||
}
|
||||
set {
|
||||
this["Grid05LayoutWidth"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
|
||||
public double Grid05LayoutHeight {
|
||||
get {
|
||||
return ((double)(this["Grid05LayoutHeight"]));
|
||||
}
|
||||
set {
|
||||
this["Grid05LayoutHeight"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="JetFrames.AppleJobs.Editor.Properties" GeneratedClassName="Settings">
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Grid01LayoutX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid01LayoutY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid01LayoutWidth" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid01LayoutHeight" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid02LayoutX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">100</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid03LayoutX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">200</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid04LayoutX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">300</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid02LayoutY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">100</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid03LayoutY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">200</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid04LayoutY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">300</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid02LayoutWidth" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid03LayoutWidth" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid04LayoutWidth" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid02LayoutHeight" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid03LayoutHeight" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid04LayoutHeight" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid01Expanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid02Expanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid03Expanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid04Expanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="ZoomPadX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="ZoomPadY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="Zoom" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">1</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid05Expanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid05LayoutX" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">400</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid05LayoutY" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid05LayoutWidth" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
<Setting Name="Grid05LayoutHeight" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">NaN</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,28 +0,0 @@
|
||||
namespace JetFrames.AppleJobs.Editor.Properties {
|
||||
|
||||
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
public sealed partial class Settings {
|
||||
|
||||
public Settings() {
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,5 @@ namespace JetFrames.AppleJobs.Editor
|
||||
|
||||
public EditorViewModel Editor { get; private set; }
|
||||
|
||||
public Properties.Settings Settings { get { return Properties.Settings.Default; } }
|
||||
}
|
||||
}
|
||||
|
||||
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,13 +7,13 @@
|
||||
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}"
|
||||
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}}"/>
|
||||
|
||||
@@ -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,12 +7,12 @@
|
||||
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}"
|
||||
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}}" />
|
||||
|
||||
@@ -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"
|
||||
<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();
|
||||
}
|
||||
private void DataGrid_PreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
if (e.Command == DataGrid.DeleteCommand)
|
||||
e.Handled = App.Locator.Editor.DeleteEntity(((DataGrid)sender).SelectedItems, true);
|
||||
EditorViewModel.InitGrid(dg);
|
||||
}
|
||||
|
||||
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