From 6ead62af6e6432e4af8527afffc10a4a4fd21130 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 9 Jan 2017 13:25:52 +0300 Subject: [PATCH] Initial --- AppleJobs.Data/App.config | 24 + AppleJobs.Data/AppleJobs.Data.csproj | 124 + AppleJobs.Data/AppleJobsContext.cs | 51 + AppleJobs.Data/Models/Customer.cs | 14 + .../Models/Inventory/Accessories.cs | 12 + AppleJobs.Data/Models/Inventory/Employee.cs | 14 + AppleJobs.Data/Models/ModelsJobs/Model.cs | 21 + .../Models/ModelsJobs/ModelCategory.cs | 15 + AppleJobs.Data/Models/ModelsJobs/ModelJob.cs | 19 + .../ModelsJobs/ModelJobPriceTemplate.cs | 22 + AppleJobs.Data/Models/Orders/Order.cs | 104 + AppleJobs.Data/Models/Orders/OrderCategory.cs | 15 + AppleJobs.Data/Models/Orders/OrderStatus.cs | 14 + AppleJobs.Data/Models/TsModelAttribute.cs | 8 + AppleJobs.Data/Properties/AssemblyInfo.cs | 46 + .../Properties/Resources.Designer.cs | 71 + AppleJobs.Data/Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 30 + AppleJobs.Data/Properties/Settings.settings | 7 + AppleJobs.Data/packages.config | 8 + BrightSharp.Ui.Tests/App.config | 6 + BrightSharp.Ui.Tests/App.xaml | 14 + BrightSharp.Ui.Tests/App.xaml.cs | 17 + .../BrightSharp.Ui.Tests.csproj | 113 + BrightSharp.Ui.Tests/ListViewItemModel.cs | 121 + BrightSharp.Ui.Tests/MainWindow.xaml | 138 + BrightSharp.Ui.Tests/MainWindow.xaml.cs | 48 + .../Properties/AssemblyInfo.cs | 55 + .../Properties/Resources.Designer.cs | 71 + .../Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 30 + .../Properties/Settings.settings | 7 + BrightSharp.sln | 18 + .../Behaviors/FiterGridTextBoxBehavior.cs | 115 + BrightSharp/BrightSharp.csproj | 96 +- BrightSharp/Commands/AsyncCommand.cs | 70 + BrightSharp/Commands/RelayCommand.cs | 66 + BrightSharp/Converters/ThicknessConverter.cs | 40 + .../Diagrams/Adorners/ResizeRotateAdorner.cs | 47 + .../Diagrams/Adorners/ResizeRotateChrome.cs | 13 + BrightSharp/Diagrams/Adorners/SizeAdorner.cs | 44 + BrightSharp/Diagrams/Adorners/SizeChrome.cs | 31 + BrightSharp/Diagrams/DesignerItemDecorator.cs | 105 + .../Diagrams/Resources/DesignerItem.xaml | 43 + .../Resources/ResizeRotateChrome.xaml | 112 + .../Diagrams/Resources/SizeChrome.xaml | 49 + BrightSharp/Diagrams/SelectionBehavior.cs | 91 + BrightSharp/Diagrams/Thumbs/MoveThumb.cs | 49 + BrightSharp/Diagrams/Thumbs/ResizeThumb.cs | 139 + BrightSharp/Diagrams/Thumbs/RotateThumb.cs | 86 + .../Extensions/MarkupExtensionProperties.cs | 140 + BrightSharp/Extensions/WpfExtensions.cs | 72 + BrightSharp/Generic.cs | 26 + BrightSharp/Generic.xaml | 5648 +++++++++++++++++ BrightSharp/Mvvm/ViewModelBase.cs | 102 + BrightSharp/Properties/AssemblyInfo.cs | 5 + BrightSharp/Style.Blue.xaml | 286 + BrightSharp/Style.DarkBlue.xaml | 277 + BrightSharp/Style.DevLab.xaml | 236 + BrightSharp/Style.Silver.xaml | 284 + BrightSharp/ThemeManager.cs | 53 + BrightSharp/UserControl1.xaml | 12 - BrightSharp/UserControl1.xaml.cs | 28 - BrightSharp/ZoomControl.cs | 210 + BrightSharp/icons/app.png | Bin 0 -> 367 bytes BrightSharp/icons/copy.png | Bin 0 -> 503 bytes BrightSharp/icons/cut.png | Bin 0 -> 510 bytes BrightSharp/icons/paste.png | Bin 0 -> 715 bytes BrightSharp/icons/undo.png | Bin 0 -> 1307 bytes JetFrames.AppleJobs.Editor/App.config | 119 + JetFrames.AppleJobs.Editor/App.xaml | 14 + JetFrames.AppleJobs.Editor/App.xaml.cs | 24 + .../Converters/ModelFilterConverter.cs | 27 + JetFrames.AppleJobs.Editor/EditorViewModel.cs | 334 + .../JetFrames.AppleJobs.Editor.csproj | 192 + JetFrames.AppleJobs.Editor/MainWindow.xaml | 117 + JetFrames.AppleJobs.Editor/MainWindow.xaml.cs | 50 + .../Properties/AssemblyInfo.cs | 55 + .../Properties/Resources.Designer.cs | 71 + .../Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 362 ++ .../Properties/Settings.settings | 90 + JetFrames.AppleJobs.Editor/Settings.cs | 28 + .../ViewModelLocator.cs | 33 + .../ViewModels/NewPriceTemplateVm.cs | 64 + .../Views/ModelCategories.xaml | 18 + .../Views/ModelCategories.xaml.cs | 27 + .../Views/ModelJobPriceTemplates.xaml | 29 + .../Views/ModelJobPriceTemplates.xaml.cs | 32 + .../Views/ModelJobs.xaml | 26 + .../Views/ModelJobs.xaml.cs | 38 + JetFrames.AppleJobs.Editor/Views/Models.xaml | 22 + .../Views/Models.xaml.cs | 38 + .../Views/NewPriceTemplateDialog.xaml | 29 + .../Views/NewPriceTemplateDialog.xaml.cs | 12 + JetFrames.AppleJobs.Editor/Views/Orders.xaml | 55 + .../Views/Orders.xaml.cs | 33 + JetFrames.AppleJobs.Editor/packages.config | 8 + 98 files changed, 12058 insertions(+), 72 deletions(-) create mode 100644 AppleJobs.Data/App.config create mode 100644 AppleJobs.Data/AppleJobs.Data.csproj create mode 100644 AppleJobs.Data/AppleJobsContext.cs create mode 100644 AppleJobs.Data/Models/Customer.cs create mode 100644 AppleJobs.Data/Models/Inventory/Accessories.cs create mode 100644 AppleJobs.Data/Models/Inventory/Employee.cs create mode 100644 AppleJobs.Data/Models/ModelsJobs/Model.cs create mode 100644 AppleJobs.Data/Models/ModelsJobs/ModelCategory.cs create mode 100644 AppleJobs.Data/Models/ModelsJobs/ModelJob.cs create mode 100644 AppleJobs.Data/Models/ModelsJobs/ModelJobPriceTemplate.cs create mode 100644 AppleJobs.Data/Models/Orders/Order.cs create mode 100644 AppleJobs.Data/Models/Orders/OrderCategory.cs create mode 100644 AppleJobs.Data/Models/Orders/OrderStatus.cs create mode 100644 AppleJobs.Data/Models/TsModelAttribute.cs create mode 100644 AppleJobs.Data/Properties/AssemblyInfo.cs create mode 100644 AppleJobs.Data/Properties/Resources.Designer.cs create mode 100644 AppleJobs.Data/Properties/Resources.resx create mode 100644 AppleJobs.Data/Properties/Settings.Designer.cs create mode 100644 AppleJobs.Data/Properties/Settings.settings create mode 100644 AppleJobs.Data/packages.config create mode 100644 BrightSharp.Ui.Tests/App.config create mode 100644 BrightSharp.Ui.Tests/App.xaml create mode 100644 BrightSharp.Ui.Tests/App.xaml.cs create mode 100644 BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj create mode 100644 BrightSharp.Ui.Tests/ListViewItemModel.cs create mode 100644 BrightSharp.Ui.Tests/MainWindow.xaml create mode 100644 BrightSharp.Ui.Tests/MainWindow.xaml.cs create mode 100644 BrightSharp.Ui.Tests/Properties/AssemblyInfo.cs create mode 100644 BrightSharp.Ui.Tests/Properties/Resources.Designer.cs create mode 100644 BrightSharp.Ui.Tests/Properties/Resources.resx create mode 100644 BrightSharp.Ui.Tests/Properties/Settings.Designer.cs create mode 100644 BrightSharp.Ui.Tests/Properties/Settings.settings create mode 100644 BrightSharp/Behaviors/FiterGridTextBoxBehavior.cs create mode 100644 BrightSharp/Commands/AsyncCommand.cs create mode 100644 BrightSharp/Commands/RelayCommand.cs create mode 100644 BrightSharp/Converters/ThicknessConverter.cs create mode 100644 BrightSharp/Diagrams/Adorners/ResizeRotateAdorner.cs create mode 100644 BrightSharp/Diagrams/Adorners/ResizeRotateChrome.cs create mode 100644 BrightSharp/Diagrams/Adorners/SizeAdorner.cs create mode 100644 BrightSharp/Diagrams/Adorners/SizeChrome.cs create mode 100644 BrightSharp/Diagrams/DesignerItemDecorator.cs create mode 100644 BrightSharp/Diagrams/Resources/DesignerItem.xaml create mode 100644 BrightSharp/Diagrams/Resources/ResizeRotateChrome.xaml create mode 100644 BrightSharp/Diagrams/Resources/SizeChrome.xaml create mode 100644 BrightSharp/Diagrams/SelectionBehavior.cs create mode 100644 BrightSharp/Diagrams/Thumbs/MoveThumb.cs create mode 100644 BrightSharp/Diagrams/Thumbs/ResizeThumb.cs create mode 100644 BrightSharp/Diagrams/Thumbs/RotateThumb.cs create mode 100644 BrightSharp/Extensions/MarkupExtensionProperties.cs create mode 100644 BrightSharp/Extensions/WpfExtensions.cs create mode 100644 BrightSharp/Generic.cs create mode 100644 BrightSharp/Generic.xaml create mode 100644 BrightSharp/Mvvm/ViewModelBase.cs create mode 100644 BrightSharp/Style.Blue.xaml create mode 100644 BrightSharp/Style.DarkBlue.xaml create mode 100644 BrightSharp/Style.DevLab.xaml create mode 100644 BrightSharp/Style.Silver.xaml create mode 100644 BrightSharp/ThemeManager.cs delete mode 100644 BrightSharp/UserControl1.xaml delete mode 100644 BrightSharp/UserControl1.xaml.cs create mode 100644 BrightSharp/ZoomControl.cs create mode 100644 BrightSharp/icons/app.png create mode 100644 BrightSharp/icons/copy.png create mode 100644 BrightSharp/icons/cut.png create mode 100644 BrightSharp/icons/paste.png create mode 100644 BrightSharp/icons/undo.png create mode 100644 JetFrames.AppleJobs.Editor/App.config create mode 100644 JetFrames.AppleJobs.Editor/App.xaml create mode 100644 JetFrames.AppleJobs.Editor/App.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Converters/ModelFilterConverter.cs create mode 100644 JetFrames.AppleJobs.Editor/EditorViewModel.cs create mode 100644 JetFrames.AppleJobs.Editor/JetFrames.AppleJobs.Editor.csproj create mode 100644 JetFrames.AppleJobs.Editor/MainWindow.xaml create mode 100644 JetFrames.AppleJobs.Editor/MainWindow.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Properties/AssemblyInfo.cs create mode 100644 JetFrames.AppleJobs.Editor/Properties/Resources.Designer.cs create mode 100644 JetFrames.AppleJobs.Editor/Properties/Resources.resx create mode 100644 JetFrames.AppleJobs.Editor/Properties/Settings.Designer.cs create mode 100644 JetFrames.AppleJobs.Editor/Properties/Settings.settings create mode 100644 JetFrames.AppleJobs.Editor/Settings.cs create mode 100644 JetFrames.AppleJobs.Editor/ViewModelLocator.cs create mode 100644 JetFrames.AppleJobs.Editor/ViewModels/NewPriceTemplateVm.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelCategories.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelJobPriceTemplates.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelJobPriceTemplates.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/ModelJobs.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/Models.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/Models.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/NewPriceTemplateDialog.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/NewPriceTemplateDialog.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/Views/Orders.xaml create mode 100644 JetFrames.AppleJobs.Editor/Views/Orders.xaml.cs create mode 100644 JetFrames.AppleJobs.Editor/packages.config diff --git a/AppleJobs.Data/App.config b/AppleJobs.Data/App.config new file mode 100644 index 0000000..c3680c2 --- /dev/null +++ b/AppleJobs.Data/App.config @@ -0,0 +1,24 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AppleJobs.Data/AppleJobs.Data.csproj b/AppleJobs.Data/AppleJobs.Data.csproj new file mode 100644 index 0000000..3a02a15 --- /dev/null +++ b/AppleJobs.Data/AppleJobs.Data.csproj @@ -0,0 +1,124 @@ + + + + + Debug + AnyCPU + {B4695C76-31FF-4BF1-9DC6-1BC62D374091} + Library + Properties + AppleJobs.Data + AppleJobs.Data + v4.5.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.dll + True + + + ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll + True + + + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + True + + + ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll + True + + + ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll + True + + + ..\packages\MySql.Data.Entity.6.9.9\lib\net45\MySql.Data.Entity.EF6.dll + True + + + + + + + + + + + + 4.0 + + + + + + + + + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + \ No newline at end of file diff --git a/AppleJobs.Data/AppleJobsContext.cs b/AppleJobs.Data/AppleJobsContext.cs new file mode 100644 index 0000000..25a699d --- /dev/null +++ b/AppleJobs.Data/AppleJobsContext.cs @@ -0,0 +1,51 @@ +using AppleJobs.Data.Models; +using AppleJobs.Data.Models.ModelsJobs; +using Microsoft.AspNet.Identity.EntityFramework; +using MySql.Data.Entity; +using System.ComponentModel.DataAnnotations.Schema; +using System.Data.Entity; + +namespace AppleJobs.Data +{ + [DbConfigurationType(typeof(MySqlEFConfiguration))] + public class AppleJobsContext : IdentityDbContext + { + #region Common + + public DbSet Customers { get; set; } + + #endregion + + #region Orders + + public DbSet OrderCategories { get; set; } + public DbSet Orders { get; set; } + public DbSet OrdersView { get; set; } + public DbSet OrderStatuses { get; set; } + + #endregion + + #region Inventory + + public DbSet Accessories { get; set; } + public DbSet Employees { get; set; } + + #endregion + + #region Prices + + public DbSet Models { get; set; } + public DbSet ModelJobs { get; set; } + public DbSet ModelCategories { get; set; } + public DbSet ModelJobPriceTemplates { get; set; } + + #endregion + + public AppleJobsContext(string connection = "Default") : base(connection) + { + } + } + public class ApplicationUser : IdentityUser + { + } +} diff --git a/AppleJobs.Data/Models/Customer.cs b/AppleJobs.Data/Models/Customer.cs new file mode 100644 index 0000000..690d2e7 --- /dev/null +++ b/AppleJobs.Data/Models/Customer.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models.ModelsJobs +{ + public class Customer + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + public string Code { get; set; } + public string MainEmail { get; set; } + } +} diff --git a/AppleJobs.Data/Models/Inventory/Accessories.cs b/AppleJobs.Data/Models/Inventory/Accessories.cs new file mode 100644 index 0000000..be9f2ed --- /dev/null +++ b/AppleJobs.Data/Models/Inventory/Accessories.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models +{ + public class Accessories + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/AppleJobs.Data/Models/Inventory/Employee.cs b/AppleJobs.Data/Models/Inventory/Employee.cs new file mode 100644 index 0000000..cddaf4d --- /dev/null +++ b/AppleJobs.Data/Models/Inventory/Employee.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models +{ + public class Employee + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + public string ContactInfo { get; set; } + public string Email { get; set; } + } +} diff --git a/AppleJobs.Data/Models/ModelsJobs/Model.cs b/AppleJobs.Data/Models/ModelsJobs/Model.cs new file mode 100644 index 0000000..2146ff5 --- /dev/null +++ b/AppleJobs.Data/Models/ModelsJobs/Model.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models.ModelsJobs +{ + public class Model + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + public int ModelCategories_Id { get; set; } + + [ForeignKey(nameof(ModelCategories_Id))] + public virtual ModelCategory ModelCategory { get; set; } + public virtual ICollection ModelJobs { get; set; } + + public string FilterString { get { return string.Format("{0},{1}", Name, ModelCategory?.FilterString); } } + + } +} diff --git a/AppleJobs.Data/Models/ModelsJobs/ModelCategory.cs b/AppleJobs.Data/Models/ModelsJobs/ModelCategory.cs new file mode 100644 index 0000000..3d3ca20 --- /dev/null +++ b/AppleJobs.Data/Models/ModelsJobs/ModelCategory.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models.ModelsJobs +{ + public class ModelCategory + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + + public string FilterString { get { return string.Format("{0}", Name); } } + + } +} diff --git a/AppleJobs.Data/Models/ModelsJobs/ModelJob.cs b/AppleJobs.Data/Models/ModelsJobs/ModelJob.cs new file mode 100644 index 0000000..0ecd89f --- /dev/null +++ b/AppleJobs.Data/Models/ModelsJobs/ModelJob.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models.ModelsJobs +{ + public class ModelJob + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public int Models_Id { get; set; } + + [ForeignKey(nameof(Models_Id))] + public virtual Model Model { get; set; } + + public string FilterString { get { return string.Format("{0},{1},{2}", Name, Description, Model?.FilterString); } } + } +} diff --git a/AppleJobs.Data/Models/ModelsJobs/ModelJobPriceTemplate.cs b/AppleJobs.Data/Models/ModelsJobs/ModelJobPriceTemplate.cs new file mode 100644 index 0000000..8430e9d --- /dev/null +++ b/AppleJobs.Data/Models/ModelsJobs/ModelJobPriceTemplate.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models.ModelsJobs +{ + public class ModelJobPriceTemplate + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public double? Price { get; set; } + public bool IsPriceFrom { get; set; } + public int ModelJobs_Id { get; set; } + public int Customers_Id { get; set; } + + [ForeignKey(nameof(Customers_Id))] + public virtual Customer Customer { get; set; } + [ForeignKey(nameof(ModelJobs_Id))] + public virtual ModelJob ModelJob { get; set; } + + public string FilterString { get { return string.Format("{0},{1}", Price, ModelJob?.FilterString); } } + } +} diff --git a/AppleJobs.Data/Models/Orders/Order.cs b/AppleJobs.Data/Models/Orders/Order.cs new file mode 100644 index 0000000..ca6a356 --- /dev/null +++ b/AppleJobs.Data/Models/Orders/Order.cs @@ -0,0 +1,104 @@ +using AppleJobs.Data.Models.ModelsJobs; +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models +{ + [TsModel] + public class OrderView + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + public string Contact { get; set; } + public string Comment { get; set; } + public DateTime DateCreated { get; set; } + public DateTime? DateClosed { get; set; } + public DateTime DateUpdated { get; set; } + public string UserCreated { get; set; } + public bool? IsFast { get; set; } + public bool? IsDrive { get; set; } + public int? Price { get; set; } + + 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; } + public int OrderCategories_Id { get; set; } + + //Joined + public string Status { get; set; } + public string Model { get; set; } + public string ModelJob { get; set; } + public string Customer { get; set; } + public string Accessories { get; set; } + public string Employee { get; set; } + public string OrderCategory { get; set; } + public string FilterString { get; set; } + } + + [TsModel] + public class Order + { + public Order() + { + DateCreated = DateUpdated = DateTime.Now; + } + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + public string Contact { get; set; } + public string Comment { get; set; } + public DateTime DateCreated { get; set; } + public DateTime? DateClosed { get; set; } + public DateTime DateUpdated { get; set; } + public string UserCreated { get; set; } + public bool? IsFast { get; set; } + public bool? IsDrive { get; set; } + public int? Price { get; set; } + + 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; } + + + [ForeignKey(nameof(OrderStatuses_Id))] + public virtual OrderStatus OrderStatus { get; set; } + + [ForeignKey(nameof(Models_Id))] + public virtual Model Model { get; set; } + + [ForeignKey(nameof(ModelJobs_Id))] + public virtual ModelJob JobModel { get; set; } + + [ForeignKey(nameof(Customers_Id))] + public virtual Customer Customer { get; set; } + + [ForeignKey(nameof(Accessories_Id))] + public virtual Accessories Accessories { get; set; } + + [ForeignKey(nameof(Employees_Id))] + public virtual Employee Employee { get; set; } + + public string FilterString + { + 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); + } + } + } +} \ No newline at end of file diff --git a/AppleJobs.Data/Models/Orders/OrderCategory.cs b/AppleJobs.Data/Models/Orders/OrderCategory.cs new file mode 100644 index 0000000..8910a62 --- /dev/null +++ b/AppleJobs.Data/Models/Orders/OrderCategory.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models +{ + [TsModel] + public class OrderCategory + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + public string Name { get; set; } + public string FullName { get; set; } + } +} diff --git a/AppleJobs.Data/Models/Orders/OrderStatus.cs b/AppleJobs.Data/Models/Orders/OrderStatus.cs new file mode 100644 index 0000000..3f3004a --- /dev/null +++ b/AppleJobs.Data/Models/Orders/OrderStatus.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AppleJobs.Data.Models +{ + [TsModel] + [Table("OrderStatuses")] + public class OrderStatus + { + [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/AppleJobs.Data/Models/TsModelAttribute.cs b/AppleJobs.Data/Models/TsModelAttribute.cs new file mode 100644 index 0000000..3a1e9c7 --- /dev/null +++ b/AppleJobs.Data/Models/TsModelAttribute.cs @@ -0,0 +1,8 @@ +using System; + +namespace AppleJobs.Data.Models +{ + public class TsModelAttribute : Attribute + { + } +} diff --git a/AppleJobs.Data/Properties/AssemblyInfo.cs b/AppleJobs.Data/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b72a3de --- /dev/null +++ b/AppleJobs.Data/Properties/AssemblyInfo.cs @@ -0,0 +1,46 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AppleJobs.Data")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AppleJobs.Data")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AppleJobs.Data/Properties/Resources.Designer.cs b/AppleJobs.Data/Properties/Resources.Designer.cs new file mode 100644 index 0000000..35faca7 --- /dev/null +++ b/AppleJobs.Data/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AppleJobs.Data.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppleJobs.Data.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/AppleJobs.Data/Properties/Resources.resx b/AppleJobs.Data/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/AppleJobs.Data/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AppleJobs.Data/Properties/Settings.Designer.cs b/AppleJobs.Data/Properties/Settings.Designer.cs new file mode 100644 index 0000000..32935f6 --- /dev/null +++ b/AppleJobs.Data/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AppleJobs.Data.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/AppleJobs.Data/Properties/Settings.settings b/AppleJobs.Data/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/AppleJobs.Data/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/AppleJobs.Data/packages.config b/AppleJobs.Data/packages.config new file mode 100644 index 0000000..b8fa147 --- /dev/null +++ b/AppleJobs.Data/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/BrightSharp.Ui.Tests/App.config b/BrightSharp.Ui.Tests/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/BrightSharp.Ui.Tests/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BrightSharp.Ui.Tests/App.xaml b/BrightSharp.Ui.Tests/App.xaml new file mode 100644 index 0000000..7cdf935 --- /dev/null +++ b/BrightSharp.Ui.Tests/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/BrightSharp.Ui.Tests/App.xaml.cs b/BrightSharp.Ui.Tests/App.xaml.cs new file mode 100644 index 0000000..7c5978c --- /dev/null +++ b/BrightSharp.Ui.Tests/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace BrightSharp.Ui.Tests +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj b/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj new file mode 100644 index 0000000..387178b --- /dev/null +++ b/BrightSharp.Ui.Tests/BrightSharp.Ui.Tests.csproj @@ -0,0 +1,113 @@ + + + + + Debug + AnyCPU + {0D6E1828-8D07-4701-B98A-65DBF1604D3F} + WinExe + Properties + BrightSharp.Ui.Tests + BrightSharp.Ui.Tests + v4.5.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {acc3c556-f8e4-4f2a-a23d-8e8749679a1b} + BrightSharp + + + + + \ No newline at end of file diff --git a/BrightSharp.Ui.Tests/ListViewItemModel.cs b/BrightSharp.Ui.Tests/ListViewItemModel.cs new file mode 100644 index 0000000..97bcd56 --- /dev/null +++ b/BrightSharp.Ui.Tests/ListViewItemModel.cs @@ -0,0 +1,121 @@ +using BrightSharp.Mvvm; +using System; +using System.ComponentModel; + +namespace BrightSharp.Ui.Tests +{ + public class CustomerViewModel : ObservableObject + { + static Random rnd = new Random(); + private string _customerId; + private string _companyName; + private string _contactName; + private string _contactTitle; + private string _address; + private string _city; + private string _region; + private string _postalCode; + private string _country; + private string _phone; + private string _fax; + private string _color; + + public CustomerViewModel() + { + byte[] colorBytes = new byte[3]; + rnd.NextBytes(colorBytes); + Color = System.Windows.Media.Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]).ToString(); + } + + public string CustomerID + { + get { return _customerId; } + set { _customerId = value; RaisePropertyChanged(nameof(CustomerID)); } + } + + public string CompanyName + { + get { return _companyName; } + set { _companyName = value; RaisePropertyChanged(nameof(CompanyName)); } + } + + public string ContactName + { + get { return _contactName; } + set { _contactName = value; RaisePropertyChanged(nameof(ContactName)); } + } + + public string ContactTitle + { + get { return _contactTitle; } + set { _contactTitle = value; RaisePropertyChanged(nameof(ContactTitle)); } + } + [Category("Location")] + public string Address + { + get { return _address; } + set { _address = value; RaisePropertyChanged(nameof(Address)); } + } + [Category("Location")] + public string City + { + get { return _city; } + set { _city = value; RaisePropertyChanged(nameof(City)); } + } + [Category("Location")] + public string Region + { + get { return _region; } + set { _region = value; RaisePropertyChanged(nameof(Region)); } + } + [Category("Contact Information")] + [Description("Postal code for Customer")] + public string PostalCode + { + get { return _postalCode; } + set { _postalCode = value; RaisePropertyChanged(nameof(PostalCode)); } + } + [Category("Location")] + [Description("Country for Customer")] + public string Country + { + get { return _country; } + set { _country = value; RaisePropertyChanged(nameof(Country)); } + } + + [Category("Contact Information")] + [Description("Phone for Customer")] + public string Phone + { + get { return _phone; } + set { _phone = value; RaisePropertyChanged(nameof(Phone)); } + } + + [Category("Contact Information")] + [Description("Fax for Customer")] + public string Fax + { + get { return _fax; } + set { _fax = value; RaisePropertyChanged(nameof(Fax)); } + } + [Category("Appearance")] + public string Color + { + get { return _color; } + set { _color = value; RaisePropertyChanged(nameof(Color)); } + } + + public int NumberProperty { get; set; } + public double DoubleNumberProperty { get; set; } + + + [Category("PropertyGrid Explore Group")] + [Description("Indicates that Customer is has active state")] + [DisplayName("Is Active")] + public bool IsActive { get; set; } + [Category("PropertyGrid Explore Group")] + [Description("Indicates that Customer is has active state or it absent")] + [DisplayName("Is Active Or Not Exists")] + public bool? IsActiveOrEmpty { get; set; } + } +} diff --git a/BrightSharp.Ui.Tests/MainWindow.xaml b/BrightSharp.Ui.Tests/MainWindow.xaml new file mode 100644 index 0000000..ce37615 --- /dev/null +++ b/BrightSharp.Ui.Tests/MainWindow.xaml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + +