diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB')
82 files changed, 2647 insertions, 76 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ByteArrayToFileSizeConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ByteArrayToFileSizeConverter.cs new file mode 100644 index 000000000..8a690450c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ByteArrayToFileSizeConverter.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.DB.Converters +{ + public class ByteArrayToFileSizeConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return BytesToString((int)value); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + static String BytesToString(long byteCount) + { + string[] suf = { "B", "KB", "MB", "GB", "TB", "PB", "EB" }; //Longs run out around EB + if (byteCount == 0) + return "0" + suf[0]; + long bytes = Math.Abs(byteCount); + int place = System.Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024))); + double num = Math.Round(bytes / Math.Pow(1024, place), 1); + return (Math.Sign(byteCount) * num).ToString() + suf[place]; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs new file mode 100644 index 000000000..4673d12b2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.DAL.Observables; +using Tango.MachineStudio.DB.ViewModels; + +namespace Tango.MachineStudio.DB.Converters +{ + public class EventTypeActionsToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) return ""; + + if (value is IEnumerable<EventTypesAction>) + { + IEnumerable<EventTypesAction> eventActions = value as IEnumerable<EventTypesAction>; + return String.Join(", ", eventActions.Where(x => !x.Deleted).Select(x => x.ActionTypes.Name)); + } + else + { + IEnumerable<MultiComboVM<ActionType>> eventActions = value as IEnumerable<MultiComboVM<ActionType>>; + return String.Join(", ", eventActions.Where(x => x.IsSelected).Select(x => x.Entity.Name)); + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/LiquidTypeRmlsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/LiquidTypeRmlsToStringConverter.cs new file mode 100644 index 000000000..0bbcd68a3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/LiquidTypeRmlsToStringConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.DAL.Observables; +using Tango.MachineStudio.DB.ViewModels; + +namespace Tango.MachineStudio.DB.Converters +{ + public class LiquidTypeRmlsToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) return ""; + + if (value is IEnumerable<LiquidTypesRml>) + { + IEnumerable<LiquidTypesRml> liquidRmls = value as IEnumerable<LiquidTypesRml>; + return String.Join(", ", liquidRmls.Where(x => !x.Deleted).Select(x => x.Rml.Name)); + } + else + { + IEnumerable<MultiComboVM<Rml>> rmls = value as IEnumerable<MultiComboVM<Rml>>; + return String.Join(", ", rmls.Where(x => x.IsSelected).Select(x => x.Entity.Name)); + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 deleted file mode 100644 index 8d95bb38e..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ExtensionMethods/INotificationProviderExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using MaterialDesignThemes.Wpf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -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 -{ - public static class INotificationProviderExtensions - { - 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"); - - 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/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index bb52ecb86..01cd9d1a9 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 @@ -87,11 +87,14 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="Converters\ByteArrayToFileSizeConverter.cs" /> + <Compile Include="Converters\EventTypeActionsToStringConverter.cs" /> + <Compile Include="Converters\LiquidTypeRmlsToStringConverter.cs" /> <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\ActionTypesViewVM.cs" /> <Compile Include="ViewModels\AddressesViewVM.cs" /> <Compile Include="ViewModels\ApplicationDisplayPanelVersionsViewVM.cs" /> <Compile Include="ViewModels\ApplicationFirmwareVersionsViewVM.cs" /> @@ -99,26 +102,110 @@ <Compile Include="ViewModels\ApplicationVersionsViewVM.cs" /> <Compile Include="ViewModels\CartridgesViewVM.cs" /> <Compile Include="ViewModels\CartridgeTypesViewVM.cs" /> + <Compile Include="ViewModels\CatsViewVM.cs" /> + <Compile Include="ViewModels\CctsViewVM.cs" /> <Compile Include="ViewModels\ConfigurationsViewVM.cs" /> + <Compile Include="ViewModels\ContactsViewVM.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\EventTypesViewVM.cs" /> + <Compile Include="ViewModels\FiberShapesViewVM.cs" /> + <Compile Include="ViewModels\FiberSynthsViewVM.cs" /> <Compile Include="ViewModels\HardwareVersionsViewVM.cs" /> <Compile Include="ViewModels\IdsPacksViewVM.cs" /> - <Compile Include="ViewModels\LiquidsViewVM.cs" /> + <Compile Include="ViewModels\LinearMassDensityUnitsViewVM.cs" /> + <Compile Include="ViewModels\LiquidTypesViewVM.cs" /> <Compile Include="ViewModels\MachinesViewVM.cs" /> <Compile Include="ViewModels\MachineVersionsViewVM.cs" /> + <Compile Include="ViewModels\MediaColorsViewVM.cs" /> + <Compile Include="ViewModels\MediaConditionsViewVM.cs" /> + <Compile Include="ViewModels\MediaMaterialsViewVM.cs" /> + <Compile Include="ViewModels\MediaPurposesViewVM.cs" /> <Compile Include="ViewModels\MultiComboVM.cs" /> <Compile Include="ViewModels\OrganizationsViewVM.cs" /> <Compile Include="ViewModels\PermissionsViewVM.cs" /> + <Compile Include="ViewModels\RmlsViewVM.cs" /> <Compile Include="ViewModels\RolesViewVM.cs" /> <Compile Include="ViewModels\UsersViewVM.cs" /> <Compile Include="ViewModels\EntityViewModel.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="ViewModelLocator.cs" /> + <Compile Include="Views\DBViews\ActionTypesView.xaml.cs"> + <DependentUpon>ActionTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ActionTypeView.xaml.cs"> + <DependentUpon>ActionTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CatsView.xaml.cs"> + <DependentUpon>CatsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CctsView.xaml.cs"> + <DependentUpon>CctsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CatView.xaml.cs"> + <DependentUpon>CatView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\CctView.xaml.cs"> + <DependentUpon>CctView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\RmlView.xaml.cs"> + <DependentUpon>RmlView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\RmlsView.xaml.cs"> + <DependentUpon>RmlsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ContactView.xaml.cs"> + <DependentUpon>ContactView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\ContactsView.xaml.cs"> + <DependentUpon>ContactsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaConditionsView.xaml.cs"> + <DependentUpon>MediaConditionsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaConditionView.xaml.cs"> + <DependentUpon>MediaConditionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LinearMassDensityUnitsView.xaml.cs"> + <DependentUpon>LinearMassDensityUnitsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\LinearMassDensityUnitView.xaml.cs"> + <DependentUpon>LinearMassDensityUnitView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\FiberShapesView.xaml.cs"> + <DependentUpon>FiberShapesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\FiberShapeView.xaml.cs"> + <DependentUpon>FiberShapeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\FiberSynthsView.xaml.cs"> + <DependentUpon>FiberSynthsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\FiberSynthView.xaml.cs"> + <DependentUpon>FiberSynthView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaPurposesView.xaml.cs"> + <DependentUpon>MediaPurposesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaMaterialsView.xaml.cs"> + <DependentUpon>MediaMaterialsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaColorView.xaml.cs"> + <DependentUpon>MediaColorView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaPurposView.xaml.cs"> + <DependentUpon>MediaPurposView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaMaterialView.xaml.cs"> + <DependentUpon>MediaMaterialView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MediaColorsView.xaml.cs"> + <DependentUpon>MediaColorsView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\IdsPacksView.xaml.cs"> <DependentUpon>IdsPacksView.xaml</DependentUpon> </Compile> @@ -149,11 +236,11 @@ <Compile Include="Views\DBViews\IdsPackView.xaml.cs"> <DependentUpon>IdsPackView.xaml</DependentUpon> </Compile> - <Compile Include="Views\DBViews\LiquidView.xaml.cs"> - <DependentUpon>LiquidView.xaml</DependentUpon> + <Compile Include="Views\DBViews\LiquidTypeView.xaml.cs"> + <DependentUpon>LiquidTypeView.xaml</DependentUpon> </Compile> - <Compile Include="Views\DBViews\LiquidsView.xaml.cs"> - <DependentUpon>LiquidsView.xaml</DependentUpon> + <Compile Include="Views\DBViews\LiquidTypesView.xaml.cs"> + <DependentUpon>LiquidTypesView.xaml</DependentUpon> </Compile> <Compile Include="Views\DBViews\HardwareVersionView.xaml.cs"> <DependentUpon>HardwareVersionView.xaml</DependentUpon> @@ -239,9 +326,15 @@ <Compile Include="Views\DBViews\OrganizationView.xaml.cs"> <DependentUpon>OrganizationView.xaml</DependentUpon> </Compile> + <Compile Include="Views\DBViews\EventTypesView.xaml.cs"> + <DependentUpon>EventTypesView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\UsersView.xaml.cs"> <DependentUpon>UsersView.xaml</DependentUpon> </Compile> + <Compile Include="Views\DBViews\EventTypeView.xaml.cs"> + <DependentUpon>EventTypeView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\UserView.xaml.cs"> <DependentUpon>UserView.xaml</DependentUpon> </Compile> @@ -266,6 +359,102 @@ <Compile Include="CustomAttributes\DBViewAttribute.cs" /> <Compile Include="Managers\RegisteredView.cs" /> <Compile Include="Managers\ViewsManager.cs" /> + <Page Include="Views\DBViews\ActionTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ActionTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CatsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CctsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CatView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\CctView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\RmlView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\RmlsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ContactView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\ContactsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaConditionsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaConditionView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LinearMassDensityUnitsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\LinearMassDensityUnitView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\FiberShapesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\FiberShapeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\FiberSynthsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\FiberSynthView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaPurposesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaMaterialsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaColorView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaPurposView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaMaterialView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MediaColorsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\IdsPacksView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -306,11 +495,11 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Views\DBViews\LiquidView.xaml"> + <Page Include="Views\DBViews\LiquidTypeView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Views\DBViews\LiquidsView.xaml"> + <Page Include="Views\DBViews\LiquidTypesView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> @@ -426,10 +615,18 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Views\DBViews\EventTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\UsersView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Views\DBViews\EventTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\UserView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> 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 48175ed17..857f0d3cf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -38,9 +38,26 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register<IdsPacksViewVM>(); SimpleIoc.Default.Register<DispensersViewVM>(); SimpleIoc.Default.Register<DispenserTypesViewVM>(); - SimpleIoc.Default.Register<LiquidsViewVM>(); + SimpleIoc.Default.Register<LiquidTypesViewVM>(); SimpleIoc.Default.Register<CartridgesViewVM>(); SimpleIoc.Default.Register<CartridgeTypesViewVM>(); + + SimpleIoc.Default.Register<EventTypesViewVM>(); + SimpleIoc.Default.Register<ActionTypesViewVM>(); + + SimpleIoc.Default.Register<ContactsViewVM>(); + + SimpleIoc.Default.Register<MediaMaterialsViewVM>(); + SimpleIoc.Default.Register<MediaColorsViewVM>(); + SimpleIoc.Default.Register<MediaPurposesViewVM>(); + SimpleIoc.Default.Register<MediaConditionsViewVM>(); + SimpleIoc.Default.Register<LinearMassDensityUnitsViewVM>(); + SimpleIoc.Default.Register<FiberShapesViewVM>(); + SimpleIoc.Default.Register<FiberSynthsViewVM>(); + SimpleIoc.Default.Register<RmlsViewVM>(); + + SimpleIoc.Default.Register<CctsViewVM>(); + SimpleIoc.Default.Register<CatsViewVM>(); } public static MainViewVM MainViewVM @@ -195,11 +212,11 @@ namespace Tango.MachineStudio.DB } } - public static LiquidsViewVM LiquidsViewVM + public static LiquidTypesViewVM LiquidTypesViewVM { get { - return ServiceLocator.Current.GetInstance<LiquidsViewVM>(); + return ServiceLocator.Current.GetInstance<LiquidTypesViewVM>(); } } @@ -218,5 +235,109 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance<CartridgeTypesViewVM>(); } } + + public static EventTypesViewVM EventTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<EventTypesViewVM>(); + } + } + + public static ActionTypesViewVM ActionTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ActionTypesViewVM>(); + } + } + + public static ContactsViewVM ContactsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<ContactsViewVM>(); + } + } + + public static MediaMaterialsViewVM MediaMaterialsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MediaMaterialsViewVM>(); + } + } + + public static MediaColorsViewVM MediaColorsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MediaColorsViewVM>(); + } + } + + public static MediaPurposesViewVM MediaPurposesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MediaPurposesViewVM>(); + } + } + + public static MediaConditionsViewVM MediaConditionsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MediaConditionsViewVM>(); + } + } + + public static LinearMassDensityUnitsViewVM LinearMassDensityUnitsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<LinearMassDensityUnitsViewVM>(); + } + } + + public static FiberShapesViewVM FiberShapesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<FiberShapesViewVM>(); + } + } + + public static FiberSynthsViewVM FiberSynthsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<FiberSynthsViewVM>(); + } + } + + public static RmlsViewVM RmlsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<RmlsViewVM>(); + } + } + + public static CctsViewVM CctsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CctsViewVM>(); + } + } + + public static CatsViewVM CatsViewVM + { + get + { + return ServiceLocator.Current.GetInstance<CatsViewVM>(); + } + } } }
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs new file mode 100644 index 000000000..fe9ebda26 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.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 ActionTypesViewVM : DbTableViewModel<ActionType> + { + public ActionTypesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs new file mode 100644 index 000000000..74a7e29eb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs @@ -0,0 +1,41 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CatsViewVM : DbTableViewModel<Cat> + { + public CatsViewVM(INotificationProvider notification) : base(notification) + { + SelectDataFileCommand = new RelayCommand(SelectDataFile); + } + + public RelayCommand SelectDataFileCommand { get; set; } + + private void SelectDataFile() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Color Adjustment Files|*.CAT"; + dlg.Title = "Select Color Adjustment File"; + if (dlg.ShowDialog().Value) + { + try + { + EditEntity.Data = File.ReadAllBytes(dlg.FileName); + } + catch (Exception ex) + { + _notification.ShowError(ex.Message); + } + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs new file mode 100644 index 000000000..02d7c351d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs @@ -0,0 +1,75 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CctsViewVM : DbTableViewModel<Cct> + { + public CctsViewVM(INotificationProvider notification) : base(notification) + { + SelectForwardFileCommand = new RelayCommand(SelectForwardFile); + SelectInverseFileCommand = new RelayCommand(SelectInverseFile); + } + + public RelayCommand SelectForwardFileCommand { get; set; } + + public RelayCommand SelectInverseFileCommand { get; set; } + + private void SelectInverseFile() + { + String file = SelectFile(); + if (file != null) + { + try + { + EditEntity.InverseData = File.ReadAllBytes(file); + EditEntity.InverseFileName = Path.GetFileName(file); + } + catch (Exception ex) + { + _notification.ShowError(ex.Message); + } + } + } + + private void SelectForwardFile() + { + String file = SelectFile(); + if (file != null) + { + try + { + EditEntity.ForwardData = File.ReadAllBytes(file); + EditEntity.ForwardFileName = Path.GetFileName(file); + } + catch (Exception ex) + { + _notification.ShowError(ex.Message); + } + } + } + + private String SelectFile() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Color Conversion Files|*.CCT"; + dlg.Title = "Select Color Conversion File"; + if (dlg.ShowDialog().Value) + { + return dlg.FileName; + } + else + { + return null; + } + } + } +} 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 index 617faab31..bdec4f91b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs @@ -18,7 +18,7 @@ namespace Tango.MachineStudio.DB.ViewModels protected override void InitializeEntity(Configuration entity) { base.InitializeEntity(entity); - entity.CreationDate = DateTime.Now; + entity.CreationDate = DateTime.UtcNow; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ContactsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ContactsViewVM.cs new file mode 100644 index 000000000..6f44d51f0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ContactsViewVM.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.Notifications; +using SimpleValidator.Extensions; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ContactsViewVM : DbTableViewModel<Contact> + { + public ContactsViewVM(INotificationProvider notification) : base(notification) + { + } + + protected override void OnValidating() + { + base.OnValidating(); + + if (!EditEntity.Email.IsEmail()) + { + ValidationErrors.Add("Email address is invalid"); + } + } + } +} 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 b6d77748e..bc8d54ce9 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 @@ -8,7 +8,6 @@ using Tango.DAL.Observables; 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; @@ -21,7 +20,7 @@ namespace Tango.MachineStudio.DB.ViewModels { public abstract class DbTableViewModel<T> : ViewModel, IShutdownRequestBlocker where T : class, IObservableEntity { - private INotificationProvider _notification; + protected INotificationProvider _notification; /// <summary> /// Initializes a new instance of the <see cref="DbTableViewModel"/> class. @@ -157,18 +156,17 @@ namespace Tango.MachineStudio.DB.ViewModels { using (_notification.PushTaskItem("Saving changes to database...")) { - var dependenctEntities = SelectedEntity.GetDependentEntitiesNameAndGuid(); + 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))); + _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(); + await SelectedEntity.SoftDeleteAsync(); } catch (Exception ex) { @@ -295,18 +293,44 @@ namespace Tango.MachineStudio.DB.ViewModels 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())); + return FilterEntity((T)entity, filter); }; } + private bool FilterEntity(T entity, String filter) + { + foreach (var prop in entity.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(byte[]) && !x.PropertyType.IsGenericType)) + { + object obj = prop.GetValue(entity); + + if (obj != null) + { + foreach (var innerProp in obj.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)))) + { + object value = innerProp.GetValue(obj); + + if (value != null) + { + if (value.ToString().ToLower().Contains(filter.ToLower())) + { + return true; + } + } + } + } + } + + 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) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs new file mode 100644 index 000000000..69e3c9ff6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +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 EventTypesViewVM : DbTableViewModel<EventType> + { + public EventTypesViewVM(INotificationProvider notification) : base(notification) + { + SelectedActions = new ObservableCollection<MultiComboVM<ActionType>>(); + } + + private ObservableCollection<MultiComboVM<ActionType>> _selectedActions; + public ObservableCollection<MultiComboVM<ActionType>> SelectedActions + { + get { return _selectedActions; } + set { _selectedActions = value; RaisePropertyChangedAuto(); } + } + + protected override void OnEdit() + { + SelectedActions = Adapter.ActionTypes.Select(x => new MultiComboVM<ActionType>(x, () => RaisePropertyChanged(nameof(SelectedActions)))).ToObservableCollection(); + + foreach (var actionType in SelectedActions) + { + if (SelectedEntity.EventTypesActions.ToList().Exists(x => x.ActionTypes == actionType.Entity && !x.Deleted)) + { + actionType.IsSelected = true; + } + } + + base.OnEdit(); + } + + protected override void OnAdd() + { + SelectedActions = Adapter.ActionTypes.Select(x => new MultiComboVM<ActionType>(x, () => RaisePropertyChanged(nameof(SelectedActions)))).ToObservableCollection(); + + base.OnAdd(); + } + + protected override void OnBeforeEntitySave(DialogOpenMode mode, EventType eventType) + { + base.OnBeforeEntitySave(mode, eventType); + + foreach (var actionType in SelectedActions) + { + var userRole = eventType.EventTypesActions.SingleOrDefault(x => x.ActionTypes == actionType.Entity); + + if (userRole != null) + { + userRole.Deleted = !actionType.IsSelected; + } + else + { + if (actionType.IsSelected) + { + eventType.EventTypesActions.Add(new EventTypesAction() + { + ActionTypes = actionType.Entity, + EventTypes = eventType, + ActionTypeGuid = actionType.Entity.Guid, + EventTypeGuid = eventType.Guid + }); + } + } + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberShapesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberShapesViewVM.cs new file mode 100644 index 000000000..c4954f9b3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberShapesViewVM.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 FiberShapesViewVM : DbTableViewModel<FiberShape> + { + public FiberShapesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberSynthsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberSynthsViewVM.cs new file mode 100644 index 000000000..6b157fc0d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberSynthsViewVM.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 FiberSynthsViewVM : DbTableViewModel<FiberSynth> + { + public FiberSynthsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LinearMassDensityUnitsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LinearMassDensityUnitsViewVM.cs new file mode 100644 index 000000000..9ac38a7c4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LinearMassDensityUnitsViewVM.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 LinearMassDensityUnitsViewVM : DbTableViewModel<LinearMassDensityUnit> + { + public LinearMassDensityUnitsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesViewVM.cs new file mode 100644 index 000000000..eaa482a41 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesViewVM.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +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 LiquidTypesViewVM : DbTableViewModel<LiquidType> + { + public LiquidTypesViewVM(INotificationProvider notification) : base(notification) + { + SelectedRmls = new ObservableCollection<MultiComboVM<Rml>>(); + } + + private ObservableCollection<MultiComboVM<Rml>> _selectedRmls; + public ObservableCollection<MultiComboVM<Rml>> SelectedRmls + { + get { return _selectedRmls; } + set { _selectedRmls = value; RaisePropertyChangedAuto(); } + } + + protected override void OnEdit() + { + SelectedRmls = Adapter.Rmls.Select(x => new MultiComboVM<Rml>(x, () => RaisePropertyChanged(nameof(SelectedRmls)))).ToObservableCollection(); + + foreach (var rml in SelectedRmls) + { + if (SelectedEntity.LiquidTypesRmls.ToList().Exists(x => x.Rml == rml.Entity && !x.Deleted)) + { + rml.IsSelected = true; + } + } + + base.OnEdit(); + } + + protected override void OnAdd() + { + SelectedRmls = Adapter.Rmls.Select(x => new MultiComboVM<Rml>(x, () => RaisePropertyChanged(nameof(SelectedRmls)))).ToObservableCollection(); + + base.OnAdd(); + } + + protected override void OnBeforeEntitySave(DialogOpenMode mode, LiquidType liquid) + { + base.OnBeforeEntitySave(mode, liquid); + + foreach (var rml in SelectedRmls) + { + var liquidRml = liquid.LiquidTypesRmls.SingleOrDefault(x => x.Rml == rml.Entity); + + if (liquidRml != null) + { + liquidRml.Deleted = !rml.IsSelected; + } + else + { + if (rml.IsSelected) + { + liquid.LiquidTypesRmls.Add(new LiquidTypesRml() + { + Rml = rml.Entity, + LiquidTypes = liquid, + RmlGuid = rml.Entity.Guid, + LiquidTypeGuid = liquid.Guid + }); + } + } + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs index fbec464bd..2349941fe 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs @@ -20,7 +20,7 @@ namespace Tango.MachineStudio.DB.ViewModels protected override void InitializeEntity(Machine entity) { base.InitializeEntity(entity); - entity.ProductionDate = DateTime.Now; + entity.ProductionDate = DateTime.UtcNow; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaColorsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaColorsViewVM.cs new file mode 100644 index 000000000..4227cc27a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaColorsViewVM.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 MediaColorsViewVM : DbTableViewModel<MediaColor> + { + public MediaColorsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaConditionsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaConditionsViewVM.cs new file mode 100644 index 000000000..451e20ff0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaConditionsViewVM.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 MediaConditionsViewVM : DbTableViewModel<MediaCondition> + { + public MediaConditionsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaMaterialsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaMaterialsViewVM.cs new file mode 100644 index 000000000..534ebc0d8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaMaterialsViewVM.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 MediaMaterialsViewVM : DbTableViewModel<MediaMaterial> + { + public MediaMaterialsViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaPurposesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaPurposesViewVM.cs new file mode 100644 index 000000000..4850f6316 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MediaPurposesViewVM.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 MediaPurposesViewVM : DbTableViewModel<MediaPurpos> + { + public MediaPurposesViewVM(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/RmlsViewVM.cs index e57f6606e..740a4969b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsViewVM.cs @@ -8,9 +8,9 @@ using Tango.MachineStudio.Common.Notifications; namespace Tango.MachineStudio.DB.ViewModels { - public class LiquidsViewVM : DbTableViewModel<Liquid> + public class RmlsViewVM : DbTableViewModel<Rml> { - public LiquidsViewVM(INotificationProvider notification) : base(notification) + public RmlsViewVM(INotificationProvider notification) : base(notification) { } } 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 6af1184aa..044b8a88a 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 @@ -80,12 +80,17 @@ namespace Tango.MachineStudio.DB.ViewModels if (EditEntity.Email != null) { - if (Adapter.Users.ToList().Exists(x => x.Email.ToLower() == EditEntity.Email.ToLower())) + if (Adapter.Users.ToList().Exists(x => x != EditEntity && x.Email.ToLower() == EditEntity.Email.ToLower())) { ValidationErrors.Add("Email already exist"); } } + if (!EditEntity.Email.IsEmail()) + { + ValidationErrors.Add("Email address is invalid"); + } + 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/ActionTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml new file mode 100644 index 000000000..11a472edb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml @@ -0,0 +1,31 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ActionTypeView" + 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:ActionTypesViewVM, 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> + <TextBlock Text="Description:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs new file mode 100644 index 000000000..05a56fb89 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.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 ActionTypeView : UserControl + { + public ActionTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml new file mode 100644 index 000000000..a9a14fb0c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ActionTypesView" + 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.ActionTypesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ActionTypesViewSource}" 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="Description" Binding="{Binding Description}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs new file mode 100644 index 000000000..aad79c87a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.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 ActionTypesView : UserControl + { + public ActionTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml new file mode 100644 index 000000000..442f77ae3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml @@ -0,0 +1,62 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CatView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" + 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:CatsViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <localConverters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter"></localConverters:ByteArrayToFileSizeConverter> + </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="Liquid Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.LiquidTypes}" SelectedItem="{Binding EditEntity.LiquidTypes,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="Machine:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding EditEntity.Machine,Mode=TwoWay}" DisplayMemberPath="SerialNumber"></ComboBox> + + <TextBlock Text="Calibration Data:" FontWeight="Bold"></TextBlock> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" Margin="0 0 0 -15" VerticalAlignment="Center" Text="{Binding EditEntity.Data.Length,Converter={StaticResource ByteArrayToFileSizeConverter},TargetNullValue=NONE,FallbackValue=NONE}"></TextBlock> + <Button DockPanel.Dock="Right" Margin="0 0 0 -2" Style="{StaticResource MaterialDesignFlatButton}" ToolTip="Select File" Padding="5 0 5 0" Command="{Binding SelectDataFileCommand}"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">BROWSE</TextBlock> + <materialDesign:PackIcon Margin="5 0 0 0" Kind="FolderOutline" Width="24" Height="24"></materialDesign:PackIcon> + </StackPanel> + </Button> + </DockPanel> + </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/CatView.xaml.cs index 653def003..9e389feb3 100644 --- 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/CatView.xaml.cs @@ -18,9 +18,9 @@ namespace Tango.MachineStudio.DB.Views.DBViews /// <summary> /// Interaction logic for MachineView.xaml /// </summary> - public partial class LiquidView : UserControl + public partial class CatView : UserControl { - public LiquidView() + public CatView() { InitializeComponent(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml new file mode 100644 index 000000000..d88a2a142 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml @@ -0,0 +1,43 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CatsView" + 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.MachineStudio.DB.Converters" + xmlns:sharedConverters="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.CatsViewVM}"> + + <UserControl.Resources> + <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter"></converters:ByteArrayToFileSizeConverter> + <sharedConverters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></sharedConverters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CatsViewSource}" 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="Liquid Type" Binding="{Binding LiquidTypes.Name}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Liquid Type Color"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="50"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter},Mode=TwoWay}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Machine" Binding="{Binding Machine.SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Calibration Data Size" Binding="{Binding Data.Length,Converter={StaticResource ByteArrayToFileSizeConverter}}"></DataGridTextColumn> + </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/CatsView.xaml.cs index 2d68d5ef5..ec9dae44f 100644 --- 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/CatsView.xaml.cs @@ -22,9 +22,9 @@ namespace Tango.MachineStudio.DB.Views.DBViews /// Interaction logic for MachinesView.xaml /// </summary> [DBView] - public partial class LiquidsView : UserControl + public partial class CatsView : UserControl { - public LiquidsView() : base() + public CatsView() : base() { InitializeComponent(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.xaml new file mode 100644 index 000000000..a5bfc2f14 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.xaml @@ -0,0 +1,58 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CctView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + 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:CctsViewVM, 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name}"></TextBox> + <TextBlock Text="Description:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Description}"></TextBox> + + <TextBlock Text="Forward File:" FontWeight="Bold"></TextBlock> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center" Text="{Binding EditEntity.ForwardFileName,TargetNullValue=NONE}"></TextBlock> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" ToolTip="Select File" Padding="5 0 5 0" Command="{Binding SelectForwardFileCommand}"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">BROWSE</TextBlock> + <materialDesign:PackIcon Margin="5 0 0 0" Kind="FolderOutline" Width="24" Height="24"></materialDesign:PackIcon> + </StackPanel> + </Button> + </DockPanel> + + <TextBlock Text="Inverse File:" FontWeight="Bold"></TextBlock> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center" Text="{Binding EditEntity.InverseFileName,TargetNullValue=NONE}"></TextBlock> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" ToolTip="Select File" Padding="5 0 5 0" Command="{Binding SelectInverseFileCommand}"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center">BROWSE</TextBlock> + <materialDesign:PackIcon Margin="5 0 0 0" Kind="FolderOutline" Width="24" Height="24"></materialDesign:PackIcon> + </StackPanel> + </Button> + </DockPanel> + + <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="Recommended Media:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding EditEntity.Rml,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.xaml.cs new file mode 100644 index 000000000..1a6ee6da7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctView.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 CctView : UserControl + { + public CctView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml new file mode 100644 index 000000000..09962447c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml @@ -0,0 +1,36 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.CctsView" + 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.MachineStudio.DB.Converters" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CctsViewVM}"> + + <UserControl.Resources> + <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter"></converters:ByteArrayToFileSizeConverter> + </UserControl.Resources> + + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CctsViewSource}" 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="Description" Binding="{Binding Description}"></DataGridTextColumn> + <DataGridTextColumn Header="Forward File" Binding="{Binding ForwardFileName}"></DataGridTextColumn> + <DataGridTextColumn Header="Forward File Size" Binding="{Binding ForwardData.Length,Converter={StaticResource ByteArrayToFileSizeConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="Inverse File" Binding="{Binding InverseFileName}"></DataGridTextColumn> + <DataGridTextColumn Header="Inverse File Size" Binding="{Binding InverseData.Length,Converter={StaticResource ByteArrayToFileSizeConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="Version" Binding="{Binding Version}"></DataGridTextColumn> + <DataGridTextColumn Header="RML" Binding="{Binding Rml.Name}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml.cs new file mode 100644 index 000000000..fa4d80bd2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.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 CctsView : UserControl + { + public CctsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.xaml new file mode 100644 index 000000000..999ad9e71 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ContactView" + 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" + 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="First Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.FirstName,Mode=TwoWay}"></TextBox> + <TextBlock Text="Last Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastName,Mode=TwoWay}"></TextBox> + <TextBlock Text="Email:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay}"></TextBox> + <TextBlock Text="Phone:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.PhoneNumber,Mode=TwoWay}"></TextBox> + <TextBlock Text="Fax:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Fax,Mode=TwoWay}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.xaml.cs new file mode 100644 index 000000000..88397c92a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactView.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 AddressView.xaml + /// </summary> + public partial class ContactView : UserControl + { + public ContactView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml new file mode 100644 index 000000000..e05808d83 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml @@ -0,0 +1,27 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ContactsView" + 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.ContactsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ContactsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="First Name" Binding="{Binding FirstName}"></DataGridTextColumn> + <DataGridTextColumn Header="Last Name" Binding="{Binding LastName}"></DataGridTextColumn> + <DataGridTextColumn Header="Full Name" Binding="{Binding FullName}"></DataGridTextColumn> + <DataGridTextColumn Header="Email" Binding="{Binding Email}"></DataGridTextColumn> + <DataGridTextColumn Header="Phone" Binding="{Binding PhoneNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="Fax" Binding="{Binding Fax}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml.cs new file mode 100644 index 000000000..a8c6eb814 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml.cs @@ -0,0 +1,31 @@ +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.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class ContactsView : UserControl + { + public ContactsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml new file mode 100644 index 000000000..4bbc741f0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml @@ -0,0 +1,45 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EventTypeView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300"> + + <UserControl.Resources> + <converters:EventTypeActionsToStringConverter x:Key="EventTypeActionsToStringConverter"></converters:EventTypeActionsToStringConverter> + </UserControl.Resources> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True" IsEnabled="False"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True" IsEnabled="False"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True" IsEnabled="False"></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="Description:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox> + <TextBlock Text="Actions:" FontWeight="Bold"></TextBlock> + <ComboBox x:Name="comboActions" SelectionChanged="comboRoles_SelectionChanged" ItemsSource="{Binding SelectedActions}" materialDesign:HintAssist.Hint="{Binding SelectedActions,Converter={StaticResource EventTypeActionsToStringConverter},UpdateSourceTrigger=PropertyChanged}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <CheckBox IsChecked="{Binding IsSelected}" Width="20"/> + <TextBlock Text="{Binding Entity.Name}" MinWidth="100" /> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs new file mode 100644 index 000000000..6294b14e7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs @@ -0,0 +1,34 @@ +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 UserView.xaml + /// </summary> + public partial class EventTypeView : UserControl + { + public EventTypeView() + { + InitializeComponent(); + } + + private void comboRoles_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + comboActions.SelectedItem = null; + comboActions.Text = "Press to select"; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml new file mode 100644 index 000000000..bb8f6e514 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml @@ -0,0 +1,31 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EventTypesView" + 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:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EventTypesViewVM}"> + + <UserControl.Resources> + <converters:EventTypeActionsToStringConverter x:Key="EventTypeActionsToStringConverter"></converters:EventTypeActionsToStringConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EventTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" 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="Description" Binding="{Binding Description}"></DataGridTextColumn> + <DataGridTextColumn Header="Actions" Binding="{Binding EventTypesActions,Converter={StaticResource EventTypeActionsToStringConverter}}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs new file mode 100644 index 000000000..3c197b7f2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs @@ -0,0 +1,30 @@ +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; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for UsersView.xaml + /// </summary> + [DBView] + public partial class EventTypesView : UserControl + { + public EventTypesView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.xaml new file mode 100644 index 000000000..dfca47372 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.FiberShapeView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.xaml.cs new file mode 100644 index 000000000..477a2445d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapeView.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 FiberShapeView : UserControl + { + public FiberShapeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml new file mode 100644 index 000000000..f46b5894e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.FiberShapesView" + 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.FiberShapesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.FiberShapesViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml.cs new file mode 100644 index 000000000..66190eee9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.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 FiberShapesView : UserControl + { + public FiberShapesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.xaml new file mode 100644 index 000000000..b200f9efc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.FiberSynthView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.xaml.cs new file mode 100644 index 000000000..55ac39620 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthView.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 FiberSynthView : UserControl + { + public FiberSynthView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml new file mode 100644 index 000000000..bec19add1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.FiberSynthsView" + 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.FiberSynthsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.FiberSynthsViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml.cs new file mode 100644 index 000000000..d6e652cf9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.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 FiberSynthsView : UserControl + { + public FiberSynthsView() : 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 index 308a549fa..be6b135ce 100644 --- 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 @@ -36,8 +36,8 @@ </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> - <TextBlock Text="Liquid:" FontWeight="Bold"></TextBlock> - <ComboBox ItemsSource="{Binding Adapter.Liquids}" SelectedItem="{Binding EditEntity.Liquid,Mode=TwoWay}"> + <TextBlock Text="Liquid Type:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.LiquidTypes}" SelectedItem="{Binding EditEntity.LiquidTypes,Mode=TwoWay}"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> 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 index df1557ec3..7720a07ae 100644 --- 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 @@ -29,16 +29,16 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <DataGridTemplateColumn Header="Liquid"> + <DataGridTemplateColumn Header="Liquid Type"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Rectangle Width="16" Height="16" VerticalAlignment="Center"> <Rectangle.Fill> - <SolidColorBrush Color="{Binding Liquid.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + <SolidColorBrush Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> </Rectangle.Fill> </Rectangle> - <TextBlock Margin="5 0 0 0" Text="{Binding Liquid.Name}" VerticalAlignment="Center"></TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding LiquidTypes.Name}" VerticalAlignment="Center"></TextBlock> </StackPanel> </DataTemplate> </DataGridTemplateColumn.CellTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.xaml new file mode 100644 index 000000000..e845249b4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LinearMassDensityUnitView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.xaml.cs new file mode 100644 index 000000000..bf37d1a5b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitView.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 LinearMassDensityUnitView : UserControl + { + public LinearMassDensityUnitView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml new file mode 100644 index 000000000..41d719dad --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LinearMassDensityUnitsView" + 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.LinearMassDensityUnitsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LinearMassDensityUnitsViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml.cs new file mode 100644 index 000000000..f419bc926 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.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 LinearMassDensityUnitsView : UserControl + { + public LinearMassDensityUnitsView() : 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/LiquidTypeView.xaml index 19bcc2674..3f934de0a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypeView.xaml @@ -1,4 +1,4 @@ -<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidView" +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidTypeView" 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" @@ -6,15 +6,18 @@ 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" 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}"> + d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:LiquidTypesViewVM, IsDesignTimeCreatable=False}"> <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> - + <localConverters:LiquidTypeRmlsToStringConverter x:Key="LiquidTypeRmlsToStringConverter"></localConverters:LiquidTypeRmlsToStringConverter> + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> <Setter Property="Margin" Value="2" /> @@ -37,6 +40,18 @@ <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> + + <TextBlock Text="Recommended Media:" FontWeight="Bold"></TextBlock> + <ComboBox x:Name="comboRmls" SelectionChanged="comboRmls_SelectionChanged" ItemsSource="{Binding SelectedRmls}" materialDesign:HintAssist.Hint="{Binding SelectedRmls,Converter={StaticResource LiquidTypeRmlsToStringConverter},UpdateSourceTrigger=PropertyChanged}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <CheckBox IsChecked="{Binding IsSelected}" Width="20"/> + <TextBlock Text="{Binding Entity.Name}" MinWidth="100" /> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> </controls:TableGrid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypeView.xaml.cs new file mode 100644 index 000000000..468f52586 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypeView.xaml.cs @@ -0,0 +1,34 @@ +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 LiquidTypeView : UserControl + { + public LiquidTypeView() + { + InitializeComponent(); + } + + private void comboRmls_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + comboRmls.SelectedItem = null; + comboRmls.Text = "Press to select"; + } + } +} 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/LiquidTypesView.xaml index 749b0ccd7..4da0a8b59 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml @@ -1,4 +1,4 @@ -<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidsView" +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.LiquidTypesView" 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" @@ -6,17 +6,19 @@ 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:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" 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}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidTypesViewVM}"> <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <localConverters:LiquidTypeRmlsToStringConverter x:Key="LiquidTypeRmlsToStringConverter"></localConverters:LiquidTypeRmlsToStringConverter> </UserControl.Resources> <Grid> <controls:DbTableView> - <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LiquidsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LiquidTypesViewSource}" 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> @@ -34,6 +36,7 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> + <DataGridTextColumn Header="Recommended Media" Binding="{Binding LiquidTypesRmls,Converter={StaticResource LiquidTypeRmlsToStringConverter}}"></DataGridTextColumn> </DataGrid.Columns> </DataGrid> </controls:DbTableView> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml.cs new file mode 100644 index 000000000..2bdb8ec67 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.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 LiquidTypesView : UserControl + { + public LiquidTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorView.xaml new file mode 100644 index 000000000..a88add000 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorView.xaml @@ -0,0 +1,34 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaColorView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" d:DesignWidth="300"> + + <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="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/MediaColorView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorView.xaml.cs new file mode 100644 index 000000000..de09b9aaf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorView.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 MediaColorView : UserControl + { + public MediaColorView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorsView.xaml new file mode 100644 index 000000000..644c865da --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorsView.xaml @@ -0,0 +1,38 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaColorsView" + 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.MediaColorsViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaColorsViewSource}" 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> + <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/MediaColorsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorsView.xaml.cs new file mode 100644 index 000000000..ceae18ec8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaColorsView.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 MediaColorsView : UserControl + { + public MediaColorsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.xaml new file mode 100644 index 000000000..cbee759b1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaConditionView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.xaml.cs new file mode 100644 index 000000000..64238c2fc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionView.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 MediaConditionView : UserControl + { + public MediaConditionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml new file mode 100644 index 000000000..08f144710 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaConditionsView" + 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.MediaConditionsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaConditionsViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml.cs new file mode 100644 index 000000000..74ab29af0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.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 MediaConditionsView : UserControl + { + public MediaConditionsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.xaml new file mode 100644 index 000000000..b7e0a88fe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaMaterialView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.xaml.cs new file mode 100644 index 000000000..4ddcca14e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialView.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 MediaMaterialView : UserControl + { + public MediaMaterialView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml new file mode 100644 index 000000000..7530cf9df --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaMaterialsView" + 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.MediaMaterialsViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaMaterialsViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml.cs new file mode 100644 index 000000000..26fbfb73a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.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 MediaMaterialsView : UserControl + { + public MediaMaterialsView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.xaml new file mode 100644 index 000000000..9b352cc59 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.xaml @@ -0,0 +1,25 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaPurposView" + 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" + mc:Ignorable="d" + d:DesignHeight="400" 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="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></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> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.xaml.cs new file mode 100644 index 000000000..08bc7f6a6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposView.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 MediaPurposView : UserControl + { + public MediaPurposView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml new file mode 100644 index 000000000..ee4903f69 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MediaPurposesView" + 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.MediaPurposesViewVM}"> + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaPurposesViewSource}" 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="Code" Binding="{Binding Code}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml.cs new file mode 100644 index 000000000..f780e5009 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.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 MediaPurposesView : UserControl + { + public MediaPurposesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml new file mode 100644 index 000000000..adf5310ee --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml @@ -0,0 +1,98 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.RmlView" + 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:RmlsViewVM, 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="Manufacturer:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Manufacturer}"></TextBox> + + <TextBlock Text="Material:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.MediaMaterials}" SelectedItem="{Binding EditEntity.MediaMaterials,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Color:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.MediaColors}" SelectedItem="{Binding EditEntity.MediaColors,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> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + + <TextBlock Text="Purpose:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.MediaPurposes}" SelectedItem="{Binding EditEntity.MediaPurposes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Condition:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.MediaConditions}" SelectedItem="{Binding EditEntity.MediaConditions,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Linear Mass Density Unit:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.LinearMassDensityUnits}" SelectedItem="{Binding EditEntity.LinearMassDensityUnits,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Fiber Shape:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.FiberShapes}" SelectedItem="{Binding EditEntity.FiberShapes,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Fiber Syntheses:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.FiberSynths}" SelectedItem="{Binding EditEntity.FiberSynths,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + + <TextBlock Text="Fiber Size:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.FiberSize,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Fibers Count:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.NumberOfFibers,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Plies Per Fiber:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.PliesPerFiber,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Plies Per Thread:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.PliesPerThread,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Twisted:" FontWeight="Bold"></TextBlock> + <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding EditEntity.Twisted}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> + + <TextBlock Text="Air Entanglement:" FontWeight="Bold"></TextBlock> + <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding EditEntity.AirEntanglement}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> + + <TextBlock Text="Lubricant:" FontWeight="Bold"></TextBlock> + <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding EditEntity.Lubricant}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> + + <TextBlock Text="Tensile Strength:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.TensileStrength,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Elongation Break Percentage:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.ElongationAtBreakPercentage,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Estimated Thread Diameter:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.EstimatedThreadDiameter,Mode=TwoWay}"></mahapps:NumericUpDown> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml.cs new file mode 100644 index 000000000..124f007ae --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.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 RmlView : UserControl + { + public RmlView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml new file mode 100644 index 000000000..0a02c6821 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml @@ -0,0 +1,57 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.RmlsView" + 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" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RmlsViewVM}"> + + <UserControl.Resources> + <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter"></converters:BooleanToYesNoConverter> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.RmlsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" 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="Manufacturer" Binding="{Binding Manufacturer}"></DataGridTextColumn> + <DataGridTextColumn Header="Material" Binding="{Binding MediaMaterials.Name}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Color"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="50"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding MediaColors.Color,Converter={StaticResource ColorToIntegerConverter},Mode=TwoWay}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Purpose" Binding="{Binding MediaPurposes.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Condition" Binding="{Binding MediaConditions.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Linear Mass Density Unit" Binding="{Binding LinearMassDensityUnits.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Fiber Shape" Binding="{Binding FiberShapes.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Fiber Syntheses" Binding="{Binding FiberSynths.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Fiber Size" Binding="{Binding FiberSize}"></DataGridTextColumn> + <DataGridTextColumn Header="Fibers Count" Binding="{Binding NumberOfFibers}"></DataGridTextColumn> + <DataGridTextColumn Header="Plies Per Fiber" Binding="{Binding PliesPerFiber}"></DataGridTextColumn> + <DataGridTextColumn Header="Plies Per Thread" Binding="{Binding PliesPerThread}"></DataGridTextColumn> + <DataGridTextColumn Header="Twisted" Binding="{Binding Twisted,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="Air Entanglement" Binding="{Binding AirEntanglement,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="Lubricant" Binding="{Binding Lubricant,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="Tensile Strength" Binding="{Binding TensileStrength}"></DataGridTextColumn> + <DataGridTextColumn Header="Elongation Break Percentage" Binding="{Binding ElongationAtBreakPercentage}"></DataGridTextColumn> + <DataGridTextColumn Header="Estimated Thread Diameter" Binding="{Binding EstimatedThreadDiameter}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml.cs new file mode 100644 index 000000000..2909bdb6f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml.cs @@ -0,0 +1,31 @@ +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.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for MachinesView.xaml + /// </summary> + [DBView] + public partial class RmlsView : UserControl + { + public RmlsView() : base() + { + InitializeComponent(); + } + } +} |
