diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB')
97 files changed, 2890 insertions, 48 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs index b1a268a9b..0928d2a1f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs @@ -25,7 +25,7 @@ namespace Tango.MachineStudio.DB public bool IsInitialized => _isInitialized; - public PermissionsEnum Permission => PermissionsEnum.RunDataBaseModule; + public Permissions Permission => Permissions.RunDataBaseModule; public void Dispose() { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs index 2da59724c..8d95bb38e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs @@ -9,6 +9,7 @@ using Tango.DAL.Observables; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.DB.ViewModels; using Tango.MachineStudio.DB.Views.DBViews; +using Tango.MachineStudio.DB.Windows; namespace Tango.MachineStudio.DB.ExtensionMethods { @@ -17,11 +18,13 @@ namespace Tango.MachineStudio.DB.ExtensionMethods public static bool ShowDialog<T>(this INotificationProvider provider, DialogOpenMode mode, DbTableViewModel<T> context) where T : class, IObservableEntity { Type viewType = typeof(INotificationProviderExtensions).Assembly.GetType(typeof(OrganizationView).Namespace + "." + typeof(T).Name + "View"); - return provider.ShowDialog( - (mode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus), - (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name, - Activator.CreateInstance(viewType) as FrameworkElement, - context); + + DBDialogWindow window = new DBDialogWindow(Activator.CreateInstance(viewType) as FrameworkElement); + window.IconKind = (mode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); + window.InnerTitle = (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name; + window.DataContext = context; + + return provider.ShowModalWindow(window).Value; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs index ba68fa358..2bb5969bc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/ViewsManager.cs @@ -22,9 +22,9 @@ namespace Tango.MachineStudio.DB.Managers DisplayedViews = new ObservableCollection<RegisteredView>(); DbViews = new ObservableCollection<RegisteredView>(); - foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute))) + foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute)).OrderBy(x => x.Name)) { - DbViews.Add(new RegisteredView(type.Name.Replace("View", ""), Activator.CreateInstance(type) as FrameworkElement)); + DbViews.Add(new RegisteredView(type.Name.Replace("View", "").ToTitle(), Activator.CreateInstance(type) as FrameworkElement)); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs new file mode 100644 index 000000000..97e5cf21c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/CloseEntityEditViewMessage.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Common.Messages; + +namespace Tango.MachineStudio.DB.Messages +{ + public class CloseEntityEditViewMessage : IStudioMessage + { + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs new file mode 100644 index 000000000..b3bf53f93 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Messages/OpenEntityEditViewMessage.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Messages; +using Tango.MachineStudio.DB.ViewModels; +using Tango.SharedUI; + +namespace Tango.MachineStudio.DB.Messages +{ + public class OpenEntityEditViewMessage : IStudioMessage + { + public DialogOpenMode DialogOpenMode { get; set; } + + public ViewModel Context { get; set; } + + public Type EntityType { get; set; } + + public OpenEntityEditViewMessage(DialogOpenMode mode, ViewModel context, Type entityType) + { + DialogOpenMode = mode; + Context = context; + EntityType = entityType; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index 712a99953..bb52ecb86 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -61,6 +61,9 @@ <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> + <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> @@ -79,15 +82,35 @@ <Reference Include="WindowsBase" /> <Reference Include="PresentationCore" /> <Reference Include="PresentationFramework" /> + <Reference Include="WriteableBitmapEx.Wpf, Version=1.5.0.0, Culture=neutral, PublicKeyToken=50375ca6144f1c69, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\WriteableBitmapEx.1.5.0.0\lib\net40\WriteableBitmapEx.Wpf.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Converters\RolesPermissionsToStringConverter.cs" /> <Compile Include="DBModule.cs" /> <Compile Include="ExtensionMethods\INotificationProviderExtensions.cs" /> + <Compile Include="Messages\CloseEntityEditViewMessage.cs" /> + <Compile Include="Messages\OpenEntityEditViewMessage.cs" /> <Compile Include="ViewModels\AddressesViewVM.cs" /> + <Compile Include="ViewModels\ApplicationDisplayPanelVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationFirmwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationOsVersionsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationVersionsViewVM.cs" /> + <Compile Include="ViewModels\CartridgesViewVM.cs" /> + <Compile Include="ViewModels\CartridgeTypesViewVM.cs" /> + <Compile Include="ViewModels\ConfigurationsViewVM.cs" /> <Compile Include="ViewModels\DbTableViewModel.cs" /> <Compile Include="ViewModels\DialogOpenMode.cs" /> + <Compile Include="ViewModels\DispenserTypesViewVM.cs" /> + <Compile Include="ViewModels\DispensersViewVM.cs" /> + <Compile Include="ViewModels\EmbeddedFirmwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\EmbeddedSoftwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\HardwareVersionsViewVM.cs" /> + <Compile Include="ViewModels\IdsPacksViewVM.cs" /> + <Compile Include="ViewModels\LiquidsViewVM.cs" /> <Compile Include="ViewModels\MachinesViewVM.cs" /> + <Compile Include="ViewModels\MachineVersionsViewVM.cs" /> <Compile Include="ViewModels\MultiComboVM.cs" /> <Compile Include="ViewModels\OrganizationsViewVM.cs" /> <Compile Include="ViewModels\PermissionsViewVM.cs" /> @@ -96,6 +119,96 @@ <Compile Include="ViewModels\EntityViewModel.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="ViewModelLocator.cs" /> + <Compile Include="Views\DBViews\IdsPacksView.xaml.cs"> + <DependentUpon>IdsPacksView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeTypesView.xaml.cs"> + <DependentUpon>CartridgeTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgesView.xaml.cs"> + <DependentUpon>CartridgesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispensersView.xaml.cs"> + <DependentUpon>DispensersView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserTypesView.xaml.cs"> + <DependentUpon>DispenserTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeTypeView.xaml.cs"> + <DependentUpon>CartridgeTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CartridgeView.xaml.cs"> + <DependentUpon>CartridgeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserView.xaml.cs"> + <DependentUpon>DispenserView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DispenserTypeView.xaml.cs"> + <DependentUpon>DispenserTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\IdsPackView.xaml.cs"> + <DependentUpon>IdsPackView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LiquidView.xaml.cs"> + <DependentUpon>LiquidView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LiquidsView.xaml.cs"> + <DependentUpon>LiquidsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\HardwareVersionView.xaml.cs"> + <DependentUpon>HardwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedSoftwareVersionView.xaml.cs"> + <DependentUpon>EmbeddedSoftwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedFirmwareVersionView.xaml.cs"> + <DependentUpon>EmbeddedFirmwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationVersionView.xaml.cs"> + <DependentUpon>ApplicationVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationOsVersionView.xaml.cs"> + <DependentUpon>ApplicationOsVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationFirmwareVersionView.xaml.cs"> + <DependentUpon>ApplicationFirmwareVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\HardwareVersionsView.xaml.cs"> + <DependentUpon>HardwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedSoftwareVersionsView.xaml.cs"> + <DependentUpon>EmbeddedSoftwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\EmbeddedFirmwareVersionsView.xaml.cs"> + <DependentUpon>EmbeddedFirmwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationVersionsView.xaml.cs"> + <DependentUpon>ApplicationVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationOsVersionsView.xaml.cs"> + <DependentUpon>ApplicationOsVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationFirmwareVersionsView.xaml.cs"> + <DependentUpon>ApplicationFirmwareVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ConfigurationsView.xaml.cs"> + <DependentUpon>ConfigurationsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationDisplayPanelVersionsView.xaml.cs"> + <DependentUpon>ApplicationDisplayPanelVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MachineVersionsView.xaml.cs"> + <DependentUpon>MachineVersionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ApplicationDisplayPanelVersionView.xaml.cs"> + <DependentUpon>ApplicationDisplayPanelVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MachineVersionView.xaml.cs"> + <DependentUpon>MachineVersionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ConfigurationView.xaml.cs"> + <DependentUpon>ConfigurationView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\PermissionView.xaml.cs"> <DependentUpon>PermissionView.xaml</DependentUpon> </Compile> @@ -135,6 +248,9 @@ <Compile Include="Views\MainDBView.xaml.cs"> <DependentUpon>MainDBView.xaml</DependentUpon> </Compile> + <Compile Include="Windows\DBDialogWindow.xaml.cs"> + <DependentUpon>DBDialogWindow.xaml</DependentUpon> + </Compile> <Page Include="Controls\DbTableView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -150,6 +266,126 @@ <Compile Include="CustomAttributes\DBViewAttribute.cs" /> <Compile Include="Managers\RegisteredView.cs" /> <Compile Include="Managers\ViewsManager.cs" /> + <Page Include="Views\DBViews\IdsPacksView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispensersView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CartridgeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\DispenserTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\IdsPackView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LiquidView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LiquidsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\HardwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedSoftwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedFirmwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationOsVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationFirmwareVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\HardwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedSoftwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\EmbeddedFirmwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationOsVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationFirmwareVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ConfigurationsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationDisplayPanelVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MachineVersionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ApplicationDisplayPanelVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MachineVersionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ConfigurationView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\PermissionView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -202,6 +438,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Windows\DBDialogWindow.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> @@ -229,6 +469,10 @@ </None> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj"> + <Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project> + <Name>Tango.ColorPicker</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> <Name>Tango.Core</Name> @@ -259,5 +503,6 @@ <ItemGroup> <Resource Include="Images\seamless-grid.jpg" /> </ItemGroup> + <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index c5f3f452e..48175ed17 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -24,6 +24,23 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register<UsersViewVM>(); SimpleIoc.Default.Register<RolesViewVM>(); SimpleIoc.Default.Register<PermissionsViewVM>(); + SimpleIoc.Default.Register<MachineVersionsViewVM>(); + SimpleIoc.Default.Register<ConfigurationsViewVM>(); + + SimpleIoc.Default.Register<ApplicationDisplayPanelVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationFirmwareVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationOsVersionsViewVM>(); + SimpleIoc.Default.Register<ApplicationVersionsViewVM>(); + SimpleIoc.Default.Register<EmbeddedFirmwareVersionsViewVM>(); + SimpleIoc.Default.Register<EmbeddedSoftwareVersionsViewVM>(); + SimpleIoc.Default.Register<HardwareVersionsViewVM>(); + + SimpleIoc.Default.Register<IdsPacksViewVM>(); + SimpleIoc.Default.Register<DispensersViewVM>(); + SimpleIoc.Default.Register<DispenserTypesViewVM>(); + SimpleIoc.Default.Register<LiquidsViewVM>(); + SimpleIoc.Default.Register<CartridgesViewVM>(); + SimpleIoc.Default.Register<CartridgeTypesViewVM>(); } public static MainViewVM MainViewVM @@ -81,5 +98,125 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance<PermissionsViewVM>(); } } + + public static MachineVersionsViewVM MachineVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MachineVersionsViewVM>(); + } + } + + public static ConfigurationsViewVM ConfigurationsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ConfigurationsViewVM>(); + } + } + + public static ApplicationDisplayPanelVersionsViewVM ApplicationDisplayPanelVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationDisplayPanelVersionsViewVM>(); + } + } + + public static ApplicationFirmwareVersionsViewVM ApplicationFirmwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationFirmwareVersionsViewVM>(); + } + } + + public static ApplicationOsVersionsViewVM ApplicationOsVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationOsVersionsViewVM>(); + } + } + + public static ApplicationVersionsViewVM ApplicationVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ApplicationVersionsViewVM>(); + } + } + + public static EmbeddedFirmwareVersionsViewVM EmbeddedFirmwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<EmbeddedFirmwareVersionsViewVM>(); + } + } + + public static EmbeddedSoftwareVersionsViewVM EmbeddedSoftwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<EmbeddedSoftwareVersionsViewVM>(); + } + } + + public static HardwareVersionsViewVM HardwareVersionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<HardwareVersionsViewVM>(); + } + } + + public static IdsPacksViewVM IdsPacksViewVM + { + get + { + return ServiceLocator.Current.GetInstance<IdsPacksViewVM>(); + } + } + + public static DispensersViewVM DispensersViewVM + { + get + { + return ServiceLocator.Current.GetInstance<DispensersViewVM>(); + } + } + + public static DispenserTypesViewVM DispenserTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<DispenserTypesViewVM>(); + } + } + + public static LiquidsViewVM LiquidsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<LiquidsViewVM>(); + } + } + + public static CartridgesViewVM CartridgesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CartridgesViewVM>(); + } + } + + public static CartridgeTypesViewVM CartridgeTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CartridgeTypesViewVM>(); + } + } } }
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs new file mode 100644 index 000000000..be458136a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationDisplayPanelVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationDisplayPanelVersionsViewVM : DbTableViewModel<ApplicationDisplayPanelVersion> + { + public ApplicationDisplayPanelVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs new file mode 100644 index 000000000..0814988ba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationFirmwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationFirmwareVersionsViewVM : DbTableViewModel<ApplicationFirmwareVersion> + { + public ApplicationFirmwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs new file mode 100644 index 000000000..3cdd8acb7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationOsVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationOsVersionsViewVM : DbTableViewModel<ApplicationOsVersion> + { + public ApplicationOsVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs new file mode 100644 index 000000000..6e25fe321 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ApplicationVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ApplicationVersionsViewVM : DbTableViewModel<ApplicationVersion> + { + public ApplicationVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs new file mode 100644 index 000000000..c8c6ba00b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgeTypesViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CartridgeTypesViewVM : DbTableViewModel<CartridgeType> + { + public CartridgeTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs new file mode 100644 index 000000000..8db217013 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CartridgesViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CartridgesViewVM : DbTableViewModel<Cartridge> + { + public CartridgesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs new file mode 100644 index 000000000..617faab31 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ConfigurationsViewVM : DbTableViewModel<Configuration> + { + public ConfigurationsViewVM(INotificationProvider notification) : base(notification) + { + + } + + protected override void InitializeEntity(Configuration entity) + { + base.InitializeEntity(entity); + entity.CreationDate = DateTime.Now; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index 7f6dd8d5f..b6d77748e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -9,10 +9,17 @@ using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.DB.Managers; using Tango.SharedUI; using Tango.MachineStudio.DB.ExtensionMethods; +using System.Data.Entity.Infrastructure; +using GalaSoft.MvvmLight.Messaging; +using Tango.MachineStudio.DB.Messages; +using System.Collections.ObjectModel; +using System.Reflection; +using Tango.MachineStudio.Common.StudioApplication; +using System.ComponentModel; namespace Tango.MachineStudio.DB.ViewModels { - public abstract class DbTableViewModel<T> : ViewModel where T : class, IObservableEntity + public abstract class DbTableViewModel<T> : ViewModel, IShutdownRequestBlocker where T : class, IObservableEntity { private INotificationProvider _notification; @@ -23,9 +30,10 @@ namespace Tango.MachineStudio.DB.ViewModels { _notification = notification; Adapter = ObservablesEntitiesAdapter.Instance; + ValidationErrors = new ObservableCollection<string>(); AddCommand = new RelayCommand(OnAdd); - EditCommand = new RelayCommand(OnEdit,(x) => SelectedEntity != null); + EditCommand = new RelayCommand(OnEdit, (x) => SelectedEntity != null); DeleteCommand = new RelayCommand(OnDelete, (x) => SelectedEntity != null); DialogOKCommand = new RelayCommand(() => OnDialogOKPressed(DialogOpenMode, EditEntity)); DialogCancelCommand = new RelayCommand(() => OnDialogCancelPressed(DialogOpenMode, EditEntity)); @@ -93,6 +101,16 @@ namespace Tango.MachineStudio.DB.ViewModels set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(value); } } + private ObservableCollection<String> _validationErrors; + /// <summary> + /// Gets or sets the validation errors. + /// </summary> + public ObservableCollection<String> ValidationErrors + { + get { return _validationErrors; } + set { _validationErrors = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Gets or sets the dialog OK command. /// </summary> @@ -118,13 +136,49 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> public RelayCommand DeleteCommand { get; set; } + protected override void OnValidating() + { + base.OnValidating(); + ValidationErrors.Clear(); + + foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) + { + if (prop.GetValue(EditEntity) == null) + { + ValidationErrors.Add(prop.Name + " is required"); + } + } + } + /// <summary> /// Called when delete command invoked. /// </summary> - protected virtual void OnDelete() + protected virtual async void OnDelete() { - SelectedEntity.Deleted = true; - SelectedEntity.Save(); + using (_notification.PushTaskItem("Saving changes to database...")) + { + var dependenctEntities = SelectedEntity.GetDependentEntitiesNameAndGuid(); + + if (dependenctEntities.Count > 0) + { + _notification.ShowError("The selected entity is being used by " + dependenctEntities.Count + " other entities." + Environment.NewLine + "Please delete any dependencies and try again." + Environment.NewLine + Environment.NewLine + String.Join(Environment.NewLine,dependenctEntities.Select(x => x.Key + ", ID: " + x.Value))); + return; + } + + try + { + SelectedEntity.Deleted = true; + await SelectedEntity.SaveAsync(); + } + catch (Exception ex) + { + SelectedEntity.Deleted = false; + Adapter.Invalidate(); + _notification.ShowError("Could not delete entity."); + } + + SelectedEntity = null; + } } /// <summary> @@ -132,9 +186,11 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> protected virtual void OnEdit() { + ValidationErrors.Clear(); DialogOpenMode = DialogOpenMode.Editing; EditEntity = GetEditableEntity(DialogOpenMode); - _notification.ShowDialog(DialogOpenMode, this); + //_notification.ShowDialog(DialogOpenMode, this); + Messenger.Default.Send(new OpenEntityEditViewMessage(DialogOpenMode, this, typeof(T))); IsDialogOpen = true; } @@ -143,9 +199,11 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> protected virtual void OnAdd() { + ValidationErrors.Clear(); DialogOpenMode = DialogOpenMode.Adding; EditEntity = GetEditableEntity(DialogOpenMode); - _notification.ShowDialog(DialogOpenMode, this); + //_notification.ShowDialog(DialogOpenMode, this); + Messenger.Default.Send(new OpenEntityEditViewMessage(DialogOpenMode, this, typeof(T))); IsDialogOpen = true; } @@ -153,8 +211,14 @@ namespace Tango.MachineStudio.DB.ViewModels /// Called when dialog closes with OK button. /// </summary> /// <param name="mode">The mode.</param> - protected virtual void OnDialogOKPressed(DialogOpenMode mode, T entity) + protected virtual async void OnDialogOKPressed(DialogOpenMode mode, T entity) { + if (!Validate()) return; + + if (ValidationErrors.Count > 0) return; + + Messenger.Default.Send(new CloseEntityEditViewMessage()); + if (mode == DialogOpenMode.Editing) { entity.ShallowCopyTo(SelectedEntity); @@ -163,10 +227,26 @@ namespace Tango.MachineStudio.DB.ViewModels OnBeforeEntitySave(mode, entity); - entity.Save(); - IsDialogOpen = false; - SelectedEntity = EditEntity; - SelectedEntity = null; + using (_notification.PushTaskItem("Saving changes to database...")) + { + try + { + await entity.SaveAsync(); + } + catch (DbUpdateException ex) + { + Adapter.Invalidate(); + _notification.ShowError("Could not save entity." + Environment.NewLine + ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : ex.InnerException.Message); + } + catch (Exception ex) + { + Adapter.Invalidate(); + _notification.ShowError("Could not save entity." + Environment.NewLine + "Please make sure all fields are properly populated."); + } + IsDialogOpen = false; + SelectedEntity = EditEntity; + SelectedEntity = null; + } } /// <summary> @@ -174,7 +254,7 @@ namespace Tango.MachineStudio.DB.ViewModels /// </summary> /// <param name="mode">The mode.</param> /// <param name="entity">The entity.</param> - protected virtual void OnBeforeEntitySave(DialogOpenMode mode,T entity) + protected virtual void OnBeforeEntitySave(DialogOpenMode mode, T entity) { } @@ -185,6 +265,7 @@ namespace Tango.MachineStudio.DB.ViewModels /// <param name="mode">The mode.</param> protected virtual void OnDialogCancelPressed(DialogOpenMode mode, T entity) { + Messenger.Default.Send(new CloseEntityEditViewMessage()); IsDialogOpen = false; } @@ -209,12 +290,31 @@ namespace Tango.MachineStudio.DB.ViewModels protected virtual void OnFilterChanged(String filter) { + String viewSourceName = this.GetType().Name.Replace("ViewVM", "ViewSource"); + ICollectionView collectionView = Adapter.GetType().GetProperty(viewSourceName).GetValue(Adapter) as ICollectionView; + collectionView.Filter = (entity) => + { + return + entity. + GetType(). + GetProperties(BindingFlags.Public | BindingFlags.Instance). + Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated"). + Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String))). + Select(prop => prop.GetValue(entity).ToString()). + ToList(). + Any(x => x.ToLower().Contains(filter.ToLower())); + }; } protected virtual void InitializeEntity(T entity) { } + + public Task<bool> OnShutdownRequest() + { + return Task.FromResult(true); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs new file mode 100644 index 000000000..5ffe0d58c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class DispenserTypesViewVM : DbTableViewModel<DispenserType> + { + public DispenserTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs new file mode 100644 index 000000000..0242c1dc7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispensersViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class DispensersViewVM : DbTableViewModel<Dispenser> + { + public DispensersViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs new file mode 100644 index 000000000..a248d919a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedFirmwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class EmbeddedFirmwareVersionsViewVM : DbTableViewModel<EmbeddedFirmwareVersion> + { + public EmbeddedFirmwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs new file mode 100644 index 000000000..b6436203d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EmbeddedSoftwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class EmbeddedSoftwareVersionsViewVM : DbTableViewModel<EmbeddedSoftwareVersion> + { + public EmbeddedSoftwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs new file mode 100644 index 000000000..02c90c442 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class HardwareVersionsViewVM : DbTableViewModel<HardwareVersion> + { + public HardwareVersionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs new file mode 100644 index 000000000..202dd959f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPacksViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class IdsPacksViewVM : DbTableViewModel<IdsPack> + { + public IdsPacksViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs new file mode 100644 index 000000000..e57f6606e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class LiquidsViewVM : DbTableViewModel<Liquid> + { + public LiquidsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs new file mode 100644 index 000000000..6a24f7d4c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachineVersionsViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class MachineVersionsViewVM : DbTableViewModel<MachineVersion> + { + public MachineVersionsViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs index 11c0adc0e..a0ce93a5a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs @@ -3,17 +3,16 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using Tango.SharedUI; namespace Tango.MachineStudio.DB.ViewModels { public class MainViewVM : ViewModel { - public String Text { get; set; } - public MainViewVM() : base() { - Text = "Hi ROy"; + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs index a394f9faa..0327557f1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/OrganizationsViewVM.cs @@ -13,14 +13,5 @@ namespace Tango.MachineStudio.DB.ViewModels public OrganizationsViewVM(INotificationProvider notification) : base(notification) { } - - protected override void OnFilterChanged(string filter) - { - Adapter.OrganizationsViewSource.Filter = (x) => - { - var org = x as Organization; - return org.Name.Contains(filter); - }; - } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs index 0b65d48ab..6af1184aa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/UsersViewVM.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Tango.DAL.Observables; using Tango.MachineStudio.Common.Notifications; +using SimpleValidator.Extensions; namespace Tango.MachineStudio.DB.ViewModels { @@ -72,5 +73,23 @@ namespace Tango.MachineStudio.DB.ViewModels } } } + + protected override void OnValidating() + { + base.OnValidating(); + + if (EditEntity.Email != null) + { + if (Adapter.Users.ToList().Exists(x => x.Email.ToLower() == EditEntity.Email.ToLower())) + { + ValidationErrors.Add("Email already exist"); + } + } + + if (!EditEntity.Password.IsMinLength(4)) + { + ValidationErrors.Add("Password must have at least 4 characters"); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml index ee46a9c11..e338f3c0f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Addresses}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.AddressesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml new file mode 100644 index 000000000..a1c8d6d7e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationDisplayPanelVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs new file mode 100644 index 000000000..6d372eaf7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationDisplayPanelVersionView : UserControl + { + public ApplicationDisplayPanelVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml new file mode 100644 index 000000000..704f5f5e2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationDisplayPanelVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs new file mode 100644 index 000000000..e514117dd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationDisplayPanelVersionsView : UserControl + { + public ApplicationDisplayPanelVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml new file mode 100644 index 000000000..70fde065d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationFirmwareVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs new file mode 100644 index 000000000..b63b05ccf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationFirmwareVersionView : UserControl + { + public ApplicationFirmwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml new file mode 100644 index 000000000..a216f4a1f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationFirmwareVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs new file mode 100644 index 000000000..855e51523 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationFirmwareVersionsView : UserControl + { + public ApplicationFirmwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml new file mode 100644 index 000000000..48f96597b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationOsVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs new file mode 100644 index 000000000..019fd207e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationOsVersionView : UserControl + { + public ApplicationOsVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml new file mode 100644 index 000000000..f53c182c3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationOsVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationOsVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs new file mode 100644 index 000000000..ca244d95b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationOsVersionsView : UserControl + { + public ApplicationOsVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml new file mode 100644 index 000000000..c5e33f3fa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs new file mode 100644 index 000000000..bde27ee0d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ApplicationVersionView : UserControl + { + public ApplicationVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml new file mode 100644 index 000000000..09df0fee4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ApplicationVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs new file mode 100644 index 000000000..23cab4296 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ApplicationVersionsView : UserControl + { + public ApplicationVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml new file mode 100644 index 000000000..a81f05646 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeTypeView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:CartridgeTypesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs new file mode 100644 index 000000000..fc23e504e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypeView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class CartridgeTypeView : UserControl + { + public CartridgeTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml new file mode 100644 index 000000000..d17f79c8d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeTypesView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CartridgeTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs new file mode 100644 index 000000000..428ebb296 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class CartridgeTypesView : UserControl + { + public CartridgeTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml new file mode 100644 index 000000000..98adef136 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgeView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:CartridgesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Serial Number:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.SerialNumber}"></TextBox> + <TextBlock Text="Cartridge Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.CartridgeTypes}" SelectedItem="{Binding EditEntity.CartridgeTypes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs new file mode 100644 index 000000000..d2402426c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class CartridgeView : UserControl + { + public CartridgeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml new file mode 100644 index 000000000..3fa7d0200 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CartridgesView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CartridgesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Serial Number" Binding="{Binding SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Cartridge Type" Binding="{Binding CartridgeTypes.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs new file mode 100644 index 000000000..27adfa44e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgesView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class CartridgesView : UserControl + { + public CartridgesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml new file mode 100644 index 000000000..afbaf660a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml @@ -0,0 +1,53 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ConfigurationView" + 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:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:ConfigurationsViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <DataTemplate x:Key="comTemplate"> + <TextBlock><Run Text="{Binding Name}"></Run><Run>,</Run> <Run Text="{Binding Version}"></Run></TextBlock> + </DataTemplate> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Creation Date:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.CreationDate,Mode=TwoWay}" IsReadOnly="True"></TextBox> + <TextBlock Text="Application Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationVersions}" SelectedItem="{Binding EditEntity.ApplicationVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Application Firmware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationFirmwareVersions}" SelectedItem="{Binding EditEntity.ApplicationFirmwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Application OS Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationOsVersions}" SelectedItem="{Binding EditEntity.ApplicationOsVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Display Panel Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersions}" SelectedItem="{Binding EditEntity.ApplicationDisplayPanelVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Embedded Firmware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.EmbeddedFirmwareVersions}" SelectedItem="{Binding EditEntity.EmbeddedFirmwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Embedded Software Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.EmbeddedSoftwareVersions}" SelectedItem="{Binding EditEntity.EmbeddedSoftwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + <TextBlock Text="Hardware Version:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.HardwareVersions}" SelectedItem="{Binding EditEntity.HardwareVersions,Mode=TwoWay}" ItemTemplate="{StaticResource comTemplate}"></ComboBox> + + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs new file mode 100644 index 000000000..8772bbae9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class ConfigurationView : UserControl + { + public ConfigurationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml new file mode 100644 index 000000000..235e49cc3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ConfigurationsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ConfigurationsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Creation Date" Binding="{Binding CreationDate}"></DataGridTextColumn> + <DataGridTextColumn Header="Application Version" Binding="{Binding ApplicationVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Application OS" Binding="{Binding ApplicationOsVersions.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Application Firmware Version" Binding="{Binding ApplicationFirmwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Display Panel" Binding="{Binding ApplicationDisplayPanelVersions.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Embedded Firmware Version" Binding="{Binding EmbeddedFirmwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Embedded Software Version" Binding="{Binding EmbeddedSoftwareVersions.Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Hardware Version" Binding="{Binding HardwareVersions.Version}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs new file mode 100644 index 000000000..de3fc9010 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ConfigurationsView : UserControl + { + public ConfigurationsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml new file mode 100644 index 000000000..b6e3336b3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserTypeView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:DispenserTypesViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs new file mode 100644 index 000000000..f13875714 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class DispenserTypeView : UserControl + { + public DispenserTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml new file mode 100644 index 000000000..874629128 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserTypesView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DispenserTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs new file mode 100644 index 000000000..89e0b05c1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class DispenserTypesView : UserControl + { + public DispenserTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml new file mode 100644 index 000000000..7dc4ec1ff --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispenserView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:DispensersViewVM, IsDesignTimeCreatable=False}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Serial Number:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.SerialNumber}"></TextBox> + <TextBlock Text="Dispenser Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.DispenserTypes}" SelectedItem="{Binding EditEntity.DispenserTypes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs new file mode 100644 index 000000000..4ad5d74fe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class DispenserView : UserControl + { + public DispenserView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml new file mode 100644 index 000000000..7fdb70bbe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DispensersView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispensersViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DispensersViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Serial Number" Binding="{Binding SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Dispenser Type" Binding="{Binding DispenserTypes.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs new file mode 100644 index 000000000..d86bd2e31 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispensersView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class DispensersView : UserControl + { + public DispensersView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml new file mode 100644 index 000000000..56dccb7dc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedFirmwareVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs new file mode 100644 index 000000000..82aa4f7b4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class EmbeddedFirmwareVersionView : UserControl + { + public EmbeddedFirmwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml new file mode 100644 index 000000000..219230d32 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedFirmwareVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EmbeddedFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs new file mode 100644 index 000000000..39c50aa39 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class EmbeddedFirmwareVersionsView : UserControl + { + public EmbeddedFirmwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml new file mode 100644 index 000000000..279c15c84 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedSoftwareVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs new file mode 100644 index 000000000..e2e626fb5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class EmbeddedSoftwareVersionView : UserControl + { + public EmbeddedSoftwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml new file mode 100644 index 000000000..64814a416 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EmbeddedSoftwareVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedSoftwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EmbeddedSoftwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs new file mode 100644 index 000000000..55f7a03a6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedSoftwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class EmbeddedSoftwareVersionsView : UserControl + { + public EmbeddedSoftwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml new file mode 100644 index 000000000..45d36fb14 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.HardwareVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs new file mode 100644 index 000000000..1419434bf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class HardwareVersionView : UserControl + { + public HardwareVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml new file mode 100644 index 000000000..4a60ffcaa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.HardwareVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.HardwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs new file mode 100644 index 000000000..0e552cdb7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class HardwareVersionsView : UserControl + { + public HardwareVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml new file mode 100644 index 000000000..308a549fa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml @@ -0,0 +1,64 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPackView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:IdsPacksViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name}"></TextBox> + <TextBlock Text="Configuration:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Configurations}" SelectedItem="{Binding EditEntity.Configuration,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Dispenser:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Dispensers}" SelectedItem="{Binding EditEntity.Dispenser,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding DispenserTypes.Name}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <TextBlock Text="Liquid:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Liquids}" SelectedItem="{Binding EditEntity.Liquid,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <Rectangle Width="16" Height="16" VerticalAlignment="Center"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <TextBlock Text="Cartridge:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Cartridges}" SelectedItem="{Binding EditEntity.Cartridge,Mode=TwoWay}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding CartridgeTypes.Name}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs new file mode 100644 index 000000000..766b3087e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class IdsPackView : UserControl + { + public IdsPackView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml new file mode 100644 index 000000000..df1557ec3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml @@ -0,0 +1,57 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPacksView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.IdsPacksViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Configuration" Binding="{Binding Configuration.Name}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Dispenser"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Dispenser.SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding Dispenser.DispenserTypes.Name}"></Run></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="Liquid"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <Rectangle Width="16" Height="16" VerticalAlignment="Center"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Liquid.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + <TextBlock Margin="5 0 0 0" Text="{Binding Liquid.Name}" VerticalAlignment="Center"></TextBlock> + </StackPanel> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="Cartridge"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Cartridge.SerialNumber}"></Run><Run>,</Run> <Run Text="{Binding Dispenser.CartridgeTypes.Name}"></Run></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs new file mode 100644 index 000000000..3f1a0189b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class IdsPacksView : UserControl + { + public IdsPacksView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml new file mode 100644 index 000000000..19bcc2674 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml @@ -0,0 +1,42 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:LiquidsViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> + <Setter Property="Margin" Value="2" /> + </Style> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Code:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Color:" FontWeight="Bold"></TextBlock> + <colorPicker:ColorPickerCombo SelectedColor="{Binding EditEntity.Color,Mode=TwoWay,Converter={StaticResource ColorToIntegerConverter},UpdateSourceTrigger=PropertyChanged}"></colorPicker:ColorPickerCombo> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs new file mode 100644 index 000000000..653def003 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class LiquidView : UserControl + { + public LiquidView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml new file mode 100644 index 000000000..749b0ccd7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml @@ -0,0 +1,41 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidsViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LiquidsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Color"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="50"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter},Mode=TwoWay}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs new file mode 100644 index 000000000..2d68d5ef5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class LiquidsView : UserControl + { + public LiquidsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml new file mode 100644 index 000000000..50a1c790b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml @@ -0,0 +1,27 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MachineVersionView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Version:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Version,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox> + <TextBlock Text="Default Configuration:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Configurations}" SelectedItem="{Binding EditEntity.Configuration,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs new file mode 100644 index 000000000..5e284cd47 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionView.xaml.cs @@ -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 Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class MachineVersionView : UserControl + { + public MachineVersionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml new file mode 100644 index 000000000..08cac568f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MachineVersionsView" + 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:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachineVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="Default Configuration" Binding="{Binding Configuration.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs new file mode 100644 index 000000000..275445917 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class MachineVersionsView : UserControl + { + public MachineVersionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml index f5913bd2c..ebd3b2c7e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachinesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml index d773dc58a..9455fd519 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml @@ -10,7 +10,7 @@ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Permissions}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.PermissionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml index dcb61eacb..858cfd37b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml @@ -15,7 +15,7 @@ <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Roles}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.RolesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml index e63c1c131..6bfb2fbb8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UserView.xaml @@ -23,7 +23,7 @@ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True" IsEnabled="False"></TextBox> <TextBlock Text="Email:" FontWeight="Bold"></TextBlock> - <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay}"></TextBox> + <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay, ValidatesOnNotifyDataErrors=True}"></TextBox> <TextBlock Text="Password:" FontWeight="Bold"></TextBlock> <TextBox Text="{Binding EditEntity.Password,Mode=TwoWay}"></TextBox> <TextBlock Text="Roles:" FontWeight="Bold"></TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml index 5b6c2e842..ad3814185 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml @@ -16,7 +16,7 @@ <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Users}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.UsersViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml index c7c636d53..6c7cb2b95 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml @@ -12,12 +12,16 @@ xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1270" Background="White" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="720" d:DesignWidth="1270" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> + + <UserControl.Background> + <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush> + </UserControl.Background> <Grid> <Grid> <Grid.ColumnDefinitions> - <ColumnDefinition Width="200"/> - <ColumnDefinition Width="486*"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border Background="{StaticResource AccentColorBrush}" Margin="5" CornerRadius="5"> @@ -34,7 +38,7 @@ <materialDesign:PackIcon Kind="Table" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock Margin="5 0 0 0" Style="{StaticResource MaterialDesignBody2TextBlock}" VerticalAlignment="Center" Text="{Binding Header}" Background="Transparent" HorizontalAlignment="Stretch"></TextBlock> </StackPanel> - <materialDesign:PackIcon ToolTip="View Table" VerticalAlignment="Center" DockPanel.Dock="Right" Kind="ArrowRight"></materialDesign:PackIcon> + <materialDesign:PackIcon Margin="10 0 0 0" ToolTip="View Table" VerticalAlignment="Center" DockPanel.Dock="Right" Kind="ArrowRight"></materialDesign:PackIcon> </DockPanel> </DataTemplate> </ListBox.ItemTemplate> @@ -42,12 +46,112 @@ </Border> <Grid Grid.Column="1"> - <Grid.Background> - <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush> - </Grid.Background> - <commonControls:MdiContainerControl ItemsSource="{x:Static managers:ViewsManager.DisplayedViews}"></commonControls:MdiContainerControl> </Grid> </Grid> + + <Grid IsHitTestVisible="False"> + <Grid.Background> + <SolidColorBrush Color="Black" Opacity="0.8"></SolidColorBrush> + </Grid.Background> + + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Opacity" Value="1"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsEditViewOpen}" Value="False"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"> + <DiscreteBooleanKeyFrame Value="False" KeyTime="00:00:00"></DiscreteBooleanKeyFrame> + </BooleanAnimationUsingKeyFrames> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"> + <DiscreteBooleanKeyFrame Value="True" KeyTime="00:00:00"></DiscreteBooleanKeyFrame> + </BooleanAnimationUsingKeyFrames> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + </Grid> + + <Grid x:Name="grid" HorizontalAlignment="Right" MinWidth="300" RenderTransformOrigin="1,0" VerticalAlignment="Top" Margin="0 100 0 0"> + + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsEditViewOpen}" Value="False"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.3"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Border Padding="10" CornerRadius="10 0 0 10" Background="White"> + <Border.Effect> + <DropShadowEffect/> + </Border.Effect> + <DockPanel LastChildFill="True"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Top"> + <materialDesign:PackIcon x:Name="icon" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> + <TextBlock x:Name="txtTitle" Margin="10 0 0 0" Foreground="{StaticResource AccentColorBrush}" FontSize="16"></TextBlock> + </StackPanel> + <StackPanel DockPanel.Dock="Bottom"> + <ItemsControl ItemsSource="{Binding ValidationErrors}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Exclamation" Foreground="Red" Width="16" Height="16"></materialDesign:PackIcon> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Foreground="Red" Text="{Binding}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{Binding DialogOKCommand}"> + ACCEPT + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{Binding DialogCancelCommand}"> + CANCEL + </Button> + </StackPanel> + </StackPanel> + <ScrollViewer Margin="0 10 0 0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="5"> + <ContentPresenter x:Name="presenter"></ContentPresenter> + </ScrollViewer> + </DockPanel> + </Border> + + <Thumb HorizontalAlignment="Left" Opacity="0" Width="5" VerticalAlignment="Stretch" Cursor="SizeWE" DragDelta="Thumb_DragDelta"></Thumb> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs index 9e327b575..1ffdf7eb0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs @@ -1,4 +1,6 @@ -using System; +using GalaSoft.MvvmLight.Messaging; +using MaterialDesignThemes.Wpf; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,6 +14,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.DB.Messages; +using Tango.MachineStudio.DB.ViewModels; +using Tango.MachineStudio.DB.Views.DBViews; using Tango.SharedUI; using Tango.SharedUI.Controls; @@ -25,6 +30,50 @@ namespace Tango.MachineStudio.DB.Views public MainDBView() : base() { InitializeComponent(); + + Messenger.Default.Register<OpenEntityEditViewMessage>(this, HandleOpenEntityViewMessage); + Messenger.Default.Register<CloseEntityEditViewMessage>(this, HandleCloseEntityViewMessage); + } + + public bool IsEditViewOpen + { + get { return (bool)GetValue(IsEditViewOpenProperty); } + set { SetValue(IsEditViewOpenProperty, value); } + } + public static readonly DependencyProperty IsEditViewOpenProperty = + DependencyProperty.Register("IsEditViewOpen", typeof(bool), typeof(MainDBView), new PropertyMetadata(false)); + + private void HandleCloseEntityViewMessage(CloseEntityEditViewMessage message) + { + IsEditViewOpen = false; + } + + private void HandleOpenEntityViewMessage(OpenEntityEditViewMessage message) + { + Type viewType = typeof(MainDBView).Assembly.GetType(typeof(OrganizationView).Namespace + "." + message.EntityType.Name + "View"); + + presenter.DataContext = message.Context; + var view = Activator.CreateInstance(viewType) as FrameworkElement; + view.DataContext = message.Context; + grid.DataContext = message.Context; + presenter.Content = view; + icon.Kind = (message.DialogOpenMode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); + txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + message.EntityType.Name.ToTitle(); + + IsEditViewOpen = true; + } + + private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) + { + if (double.IsNaN(grid.Width)) + { + grid.Width = grid.ActualWidth; + } + + if (grid.Width + -e.HorizontalChange > 100) + { + grid.Width += -e.HorizontalChange; + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml new file mode 100644 index 000000000..83cd48926 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml @@ -0,0 +1,32 @@ +<mahapps:MetroWindow x:Class="Tango.MachineStudio.DB.Windows.DBDialogWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Windows" + mc:Ignorable="d" + Title="Machine Studio" Height="450" Width="650" EnableDWMDropShadow="True" ShowCloseButton="False" WindowTransitionsEnabled="False" ShowMaxRestoreButton="False" ShowMinButton="False" TitleCaps="False" BorderThickness="1" WindowStartupLocation="CenterOwner"> + <Grid> + <Border Margin="16"> + <DockPanel LastChildFill="True"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" VerticalAlignment="Top"> + <materialDesign:PackIcon Kind="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconKind}" VerticalAlignment="Center" Width="32" Height="32" Foreground="{StaticResource AccentColorBrush}" /> + <TextBlock Margin="10 0 0 0" Foreground="{StaticResource AccentColorBrush}" FontSize="16" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=InnerTitle}"></TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{Binding DialogOKCommand}" Click="OnOKClicked"> + ACCEPT + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{Binding DialogCancelCommand}" Click="OnCancelClicked"> + CANCEL + </Button> + </StackPanel> + <ScrollViewer Margin="0 10 0 10" VerticalScrollBarVisibility="Auto" Padding="5"> + <ContentPresenter x:Name="presenter"></ContentPresenter> + </ScrollViewer> + </DockPanel> + </Border> + </Grid> +</mahapps:MetroWindow> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs new file mode 100644 index 000000000..d9629c642 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Windows/DBDialogWindow.xaml.cs @@ -0,0 +1,68 @@ +using MahApps.Metro.Controls; +using MaterialDesignThemes.Wpf; +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.Shapes; +namespace Tango.MachineStudio.DB.Windows +{ + /// <summary> + /// Interaction logic for DBDialogWindow.xaml + /// </summary> + public partial class DBDialogWindow : MetroWindow + { + public DBDialogWindow() + { + InitializeComponent(); + } + + public String InnerTitle + { + get { return (String)GetValue(InnerTitleProperty); } + set { SetValue(InnerTitleProperty, value); } + } + public static readonly DependencyProperty InnerTitleProperty = + DependencyProperty.Register("InnerTitle", typeof(String), typeof(DBDialogWindow), new PropertyMetadata(null)); + + + + public PackIconKind IconKind + { + get { return (PackIconKind)GetValue(IconKindProperty); } + set { SetValue(IconKindProperty, value); } + } + + // Using a DependencyProperty as the backing store for IconKind. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IconKindProperty = + DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(DBDialogWindow), new PropertyMetadata(PackIconKind.TableEdit)); + + + + + public DBDialogWindow(FrameworkElement content) : this() + { + presenter.Content = content; + } + + private void OnOKClicked(object sender, RoutedEventArgs e) + { + DialogResult = true; + Close(); + } + + private void OnCancelClicked(object sender, RoutedEventArgs e) + { + DialogResult = false; + Close(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config index ab8c25d56..138a48ec7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/packages.config @@ -8,4 +8,6 @@ <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> <package id="MvvmLight" version="5.3.0.0" targetFramework="net46" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> + <package id="WriteableBitmapEx" version="1.5.0.0" targetFramework="net46" /> </packages>
\ No newline at end of file |
